diff options
author | Andrew Morton <akpm@osdl.org> | 2004-05-14 05:42:56 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-14 05:42:56 -0700 |
commit | 485ba3c3b6da6ca02daee0f961fe70beaebd32b3 (patch) | |
tree | 86972e45681ee206f837cc2e36e8b37a3f69b1f7 /mm | |
parent | c78a6f265684bbe76a03d45666b8b6dee4952045 (diff) | |
download | history-485ba3c3b6da6ca02daee0f961fe70beaebd32b3.tar.gz |
[PATCH] rmap-5-swap_unplug-page-revert
Revert the pre-2.6.6 per-address-space unplugging changes. This removes a
swapper_space exceptionality, syncs things with Andrea and provides for
simplification of the swap unplug function.
Diffstat (limited to 'mm')
-rw-r--r-- | mm/filemap.c | 2 | ||||
-rw-r--r-- | mm/nommu.c | 5 | ||||
-rw-r--r-- | mm/swap_state.c | 4 | ||||
-rw-r--r-- | mm/swapfile.c | 23 |
4 files changed, 16 insertions, 18 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 1b3e894aee7d5b..29848de5d4b494 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -127,7 +127,7 @@ static inline int sync_page(struct page *page) if (mapping->a_ops && mapping->a_ops->sync_page) return mapping->a_ops->sync_page(page); } else if (PageSwapCache(page)) { - swap_unplug_io_fn(page); + swap_unplug_io_fn(NULL); } return 0; } diff --git a/mm/nommu.c b/mm/nommu.c index c940756b49e545..1432dbab85eba2 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -18,6 +18,7 @@ #include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/blkdev.h> +#include <linux/backing-dev.h> #include <asm/pgalloc.h> #include <asm/uaccess.h> @@ -571,3 +572,7 @@ unsigned long get_unmapped_area(struct file *file, unsigned long addr, void pte_chain_init(void) { } + +void swap_unplug_io_fn(struct backing_dev_info *) +{ +} diff --git a/mm/swap_state.c b/mm/swap_state.c index b6232384d4110b..d76b2d1bcf79dd 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -25,13 +25,13 @@ static struct address_space_operations swap_aops = { }; static struct backing_dev_info swap_backing_dev_info = { - .state = 0, /* uncongested */ + .memory_backed = 1, /* Does not contribute to dirty memory */ + .unplug_io_fn = swap_unplug_io_fn, }; struct address_space swapper_space = { .page_tree = RADIX_TREE_INIT(GFP_ATOMIC), .tree_lock = SPIN_LOCK_UNLOCKED, - .nrpages = 0, /* total_swapcache_pages */ .a_ops = &swap_aops, .backing_dev_info = &swap_backing_dev_info, }; diff --git a/mm/swapfile.c b/mm/swapfile.c index 9ca222bc032ada..69b145555402c5 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -88,26 +88,19 @@ static void remove_swap_bdev(struct block_device *bdev) BUG(); } -/* - * Unlike a standard unplug_io_fn, swap_unplug_io_fn is never called - * through swap's backing_dev_info (which is only used by shrink_list), - * but directly from sync_page when PageSwapCache: and takes the page - * as argument, so that it can find the right device from swp_entry_t. - */ -void swap_unplug_io_fn(struct page *page) +void swap_unplug_io_fn(struct backing_dev_info *unused_bdi) { - swp_entry_t entry; + int i; down(&swap_bdevs_sem); - entry.val = page->private; - if (PageSwapCache(page)) { - struct block_device *bdev = swap_bdevs[swp_type(entry)]; + for (i = 0; i < MAX_SWAPFILES; i++) { + struct block_device *bdev = swap_bdevs[i]; struct backing_dev_info *bdi; - if (bdev) { - bdi = bdev->bd_inode->i_mapping->backing_dev_info; - (*bdi->unplug_io_fn)(bdi); - } + if (bdev == NULL) + break; + bdi = bdev->bd_inode->i_mapping->backing_dev_info; + (*bdi->unplug_io_fn)(bdi); } up(&swap_bdevs_sem); } |