diff options
-rw-r--r-- | include/linux/mmzone.h | 1 | ||||
-rw-r--r-- | mm/vmscan.c | 9 | ||||
-rw-r--r-- | mm/vmstat.c | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index ec57779c5a5..2c41b2c1943 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -100,6 +100,7 @@ enum zone_stat_item { | |||
100 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | 100 | NR_UNSTABLE_NFS, /* NFS unstable pages */ |
101 | NR_BOUNCE, | 101 | NR_BOUNCE, |
102 | NR_VMSCAN_WRITE, | 102 | NR_VMSCAN_WRITE, |
103 | NR_VMSCAN_WRITE_SKIP, | ||
103 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ | 104 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ |
104 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ | 105 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ |
105 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ | 106 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ |
diff --git a/mm/vmscan.c b/mm/vmscan.c index d29b2bdb9e0..10f9c59aed5 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -865,6 +865,15 @@ static unsigned long shrink_page_list(struct list_head *page_list, | |||
865 | if (PageDirty(page)) { | 865 | if (PageDirty(page)) { |
866 | nr_dirty++; | 866 | nr_dirty++; |
867 | 867 | ||
868 | /* | ||
869 | * Only kswapd can writeback filesystem pages to | ||
870 | * avoid risk of stack overflow | ||
871 | */ | ||
872 | if (page_is_file_cache(page) && !current_is_kswapd()) { | ||
873 | inc_zone_page_state(page, NR_VMSCAN_WRITE_SKIP); | ||
874 | goto keep_locked; | ||
875 | } | ||
876 | |||
868 | if (references == PAGEREF_RECLAIM_CLEAN) | 877 | if (references == PAGEREF_RECLAIM_CLEAN) |
869 | goto keep_locked; | 878 | goto keep_locked; |
870 | if (!may_enter_fs) | 879 | if (!may_enter_fs) |
diff --git a/mm/vmstat.c b/mm/vmstat.c index d52b13d28e8..210bd8ff3a6 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -702,6 +702,7 @@ const char * const vmstat_text[] = { | |||
702 | "nr_unstable", | 702 | "nr_unstable", |
703 | "nr_bounce", | 703 | "nr_bounce", |
704 | "nr_vmscan_write", | 704 | "nr_vmscan_write", |
705 | "nr_vmscan_write_skip", | ||
705 | "nr_writeback_temp", | 706 | "nr_writeback_temp", |
706 | "nr_isolated_anon", | 707 | "nr_isolated_anon", |
707 | "nr_isolated_file", | 708 | "nr_isolated_file", |