Skip to content

Commit 1742f19

Browse files
Andrew MortonLinus Torvalds
authored andcommitted
[PATCH] vmscan: rename functions
We have: try_to_free_pages ->shrink_caches(struct zone **zones, ..) ->shrink_zone(struct zone *, ...) ->shrink_cache(struct zone *, ...) ->shrink_list(struct list_head *, ...) ->refill_inactive_list((struct zone *, ...) which is fairly irrational. Rename things so that we have try_to_free_pages ->shrink_zones(struct zone **zones, ..) ->shrink_zone(struct zone *, ...) ->shrink_inactive_list(struct zone *, ...) ->shrink_page_list(struct list_head *, ...) ->shrink_active_list(struct zone *, ...) Cc: Nick Piggin <[email protected]> Cc: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 05ff513 commit 1742f19

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

mm/vmscan.c

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ static void handle_write_error(struct address_space *mapping,
298298
}
299299

300300
/*
301-
* pageout is called by shrink_list() for each dirty page. Calls ->writepage().
301+
* pageout is called by shrink_page_list() for each dirty page.
302+
* Calls ->writepage().
302303
*/
303304
static pageout_t pageout(struct page *page, struct address_space *mapping)
304305
{
@@ -406,10 +407,10 @@ static int remove_mapping(struct address_space *mapping, struct page *page)
406407
}
407408

408409
/*
409-
* shrink_list return the number of reclaimed pages
410+
* shrink_page_list() returns the number of reclaimed pages
410411
*/
411-
static unsigned long shrink_list(struct list_head *page_list,
412-
struct scan_control *sc)
412+
static unsigned long shrink_page_list(struct list_head *page_list,
413+
struct scan_control *sc)
413414
{
414415
LIST_HEAD(ret_pages);
415416
struct pagevec freed_pvec;
@@ -1103,10 +1104,11 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
11031104
}
11041105

11051106
/*
1106-
* shrink_cache() return the number of reclaimed pages
1107+
* shrink_inactive_list() is a helper for shrink_zone(). It returns the number
1108+
* of reclaimed pages
11071109
*/
1108-
static unsigned long shrink_cache(unsigned long max_scan, struct zone *zone,
1109-
struct scan_control *sc)
1110+
static unsigned long shrink_inactive_list(unsigned long max_scan,
1111+
struct zone *zone, struct scan_control *sc)
11101112
{
11111113
LIST_HEAD(page_list);
11121114
struct pagevec pvec;
@@ -1134,7 +1136,7 @@ static unsigned long shrink_cache(unsigned long max_scan, struct zone *zone,
11341136
goto done;
11351137

11361138
nr_scanned += nr_scan;
1137-
nr_freed = shrink_list(&page_list, sc);
1139+
nr_freed = shrink_page_list(&page_list, sc);
11381140
nr_reclaimed += nr_freed;
11391141
local_irq_disable();
11401142
if (current_is_kswapd()) {
@@ -1187,9 +1189,8 @@ static unsigned long shrink_cache(unsigned long max_scan, struct zone *zone,
11871189
* The downside is that we have to touch page->_count against each page.
11881190
* But we had to alter page->flags anyway.
11891191
*/
1190-
static void
1191-
refill_inactive_zone(unsigned long nr_pages, struct zone *zone,
1192-
struct scan_control *sc)
1192+
static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
1193+
struct scan_control *sc)
11931194
{
11941195
unsigned long pgmoved;
11951196
int pgdeactivate = 0;
@@ -1360,14 +1361,15 @@ static unsigned long shrink_zone(int priority, struct zone *zone,
13601361
nr_to_scan = min(nr_active,
13611362
(unsigned long)sc->swap_cluster_max);
13621363
nr_active -= nr_to_scan;
1363-
refill_inactive_zone(nr_to_scan, zone, sc);
1364+
shrink_active_list(nr_to_scan, zone, sc);
13641365
}
13651366

13661367
if (nr_inactive) {
13671368
nr_to_scan = min(nr_inactive,
13681369
(unsigned long)sc->swap_cluster_max);
13691370
nr_inactive -= nr_to_scan;
1370-
nr_reclaimed += shrink_cache(nr_to_scan, zone, sc);
1371+
nr_reclaimed += shrink_inactive_list(nr_to_scan, zone,
1372+
sc);
13711373
}
13721374
}
13731375

@@ -1393,7 +1395,7 @@ static unsigned long shrink_zone(int priority, struct zone *zone,
13931395
* If a zone is deemed to be full of pinned pages then just give it a light
13941396
* scan then give up on it.
13951397
*/
1396-
static unsigned long shrink_caches(int priority, struct zone **zones,
1398+
static unsigned long shrink_zones(int priority, struct zone **zones,
13971399
struct scan_control *sc)
13981400
{
13991401
unsigned long nr_reclaimed = 0;
@@ -1466,7 +1468,7 @@ unsigned long try_to_free_pages(struct zone **zones, gfp_t gfp_mask)
14661468
sc.nr_scanned = 0;
14671469
if (!priority)
14681470
disable_swap_token();
1469-
nr_reclaimed += shrink_caches(priority, zones, &sc);
1471+
nr_reclaimed += shrink_zones(priority, zones, &sc);
14701472
shrink_slab(sc.nr_scanned, gfp_mask, lru_pages);
14711473
if (reclaim_state) {
14721474
nr_reclaimed += reclaim_state->reclaimed_slab;

0 commit comments

Comments
 (0)