Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272128
b: refs/heads/master
c: f84f6e2
h: refs/heads/master
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Nov 1, 2011
1 parent f5e194b commit 4016423
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 966dbde2c208e07bab7a45a7855e1e693eabe661
refs/heads/master: f84f6e2b0868f198f97a32ba503d6f9f319a249a
13 changes: 8 additions & 5 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ static noinline_for_stack void free_page_list(struct list_head *free_pages)
*/
static unsigned long shrink_page_list(struct list_head *page_list,
struct zone *zone,
struct scan_control *sc)
struct scan_control *sc,
int priority)
{
LIST_HEAD(ret_pages);
LIST_HEAD(free_pages);
Expand Down Expand Up @@ -856,9 +857,11 @@ static unsigned long shrink_page_list(struct list_head *page_list,

/*
* Only kswapd can writeback filesystem pages to
* avoid risk of stack overflow
* avoid risk of stack overflow but do not writeback
* unless under significant pressure.
*/
if (page_is_file_cache(page) && !current_is_kswapd()) {
if (page_is_file_cache(page) &&
(!current_is_kswapd() || priority >= DEF_PRIORITY - 2)) {
inc_zone_page_state(page, NR_VMSCAN_WRITE_SKIP);
goto keep_locked;
}
Expand Down Expand Up @@ -1509,12 +1512,12 @@ shrink_inactive_list(unsigned long nr_to_scan, struct zone *zone,

spin_unlock_irq(&zone->lru_lock);

nr_reclaimed = shrink_page_list(&page_list, zone, sc);
nr_reclaimed = shrink_page_list(&page_list, zone, sc, priority);

/* Check if we should syncronously wait for writeback */
if (should_reclaim_stall(nr_taken, nr_reclaimed, priority, sc)) {
set_reclaim_mode(priority, sc, true);
nr_reclaimed += shrink_page_list(&page_list, zone, sc);
nr_reclaimed += shrink_page_list(&page_list, zone, sc, priority);
}

local_irq_disable();
Expand Down

0 comments on commit 4016423

Please sign in to comment.