[PATCH] swap 13/13 may_enter_fs?

Hugh Dickins (hugh@veritas.com)
Tue, 25 Mar 2003 22:23:43 +0000 (GMT)


shrink_list's may_enter_fs (may_write_page would be a better name)
currently reflects that swapcache page I/O won't suffer from FS
complications, so can be done if __GFP_IO without __GFP_FS; but
the same is true of a tmpfs page (which is just this stage away
from being a swapcache page), so check bdi->memory_backed instead.

--- swap12/mm/vmscan.c Tue Mar 25 20:43:07 2003
+++ swap13/mm/vmscan.c Tue Mar 25 20:45:08 2003
@@ -235,7 +235,6 @@
pagevec_init(&freed_pvec, 1);
while (!list_empty(page_list)) {
struct page *page;
- int may_enter_fs;

page = list_entry(page_list->prev, struct page, lru);
list_del(&page->lru);
@@ -248,8 +247,6 @@
(*nr_mapped)++;

BUG_ON(PageActive(page));
- may_enter_fs = (gfp_mask & __GFP_FS) ||
- (PageSwapCache(page) && (gfp_mask & __GFP_IO));

if (PageWriteback(page))
goto keep_locked;
@@ -315,15 +312,19 @@
* See swapfile.c:page_queue_congested().
*/
if (PageDirty(page)) {
+ struct backing_dev_info *bdi;
+
if (!is_page_cache_freeable(page))
goto keep_locked;
if (!mapping)
goto keep_locked;
if (mapping->a_ops->writepage == NULL)
goto activate_locked;
- if (!may_enter_fs)
+ bdi = mapping->backing_dev_info;
+ if (!(gfp_mask & (bdi->memory_backed?
+ __GFP_IO: __GFP_FS)))
goto keep_locked;
- if (!may_write_to_queue(mapping->backing_dev_info))
+ if (!may_write_to_queue(bdi))
goto keep_locked;
write_lock(&mapping->page_lock);
if (test_clear_page_dirty(page)) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/