diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-05-22 08:00:19 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-22 08:00:19 -0700 |
| commit | 8ea360d493ec1b969dc08a7d1413033eb52079de (patch) | |
| tree | 161e085d9b9e9e8e956d13ed1660b72480ef7ca0 | |
| parent | e74193ade30270984a8f49b3604cff69c045ea4e (diff) | |
[PATCH] vmscan: revert may_enter_fs changes
Fix up the "may we call writepage" logic for the swapcache changes.
| -rw-r--r-- | mm/vmscan.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 7eca25317149..2a111c86b912 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -247,7 +247,6 @@ static int shrink_list(struct list_head *page_list, unsigned int gfp_mask, int *nr_scanned, int do_writepage) { - struct address_space *mapping; LIST_HEAD(ret_pages); struct pagevec freed_pvec; int pgactivate = 0; @@ -257,6 +256,7 @@ shrink_list(struct list_head *page_list, unsigned int gfp_mask, pagevec_init(&freed_pvec, 1); while (!list_empty(page_list)) { + struct address_space *mapping; struct page *page; int may_enter_fs; int referenced; @@ -284,9 +284,6 @@ shrink_list(struct list_head *page_list, unsigned int gfp_mask, goto activate_locked; } - mapping = page_mapping(page); - may_enter_fs = (gfp_mask & __GFP_FS); - #ifdef CONFIG_SWAP /* * Anonymous process memory has backing store? @@ -300,12 +297,12 @@ shrink_list(struct list_head *page_list, unsigned int gfp_mask, goto activate_locked; page_map_lock(page); } - if (PageSwapCache(page)) { - mapping = &swapper_space; - may_enter_fs = (gfp_mask & __GFP_IO); - } #endif /* CONFIG_SWAP */ + mapping = page_mapping(page); + may_enter_fs = (gfp_mask & __GFP_FS) || + (PageSwapCache(page) && (gfp_mask & __GFP_IO)); + /* * The page is mapped into the page tables of one or more * processes. Try to unmap it here. |
