From: Mel Gorman This patch flags the allocations from low memory that may be migrated. A GFP_USER_MOVABLE similar to GFP_HIGH_MOVABLE is not provided in this patch because it would only be used once. This patch uses __GFP_MOVABLE twice for a GFP_USER and a GFP_NOIO allocation. There is little point defining GFP_*_MOVABLE for one use unless people feel it would help self-documentation. Signed-off-by: Mel Gorman Signed-off-by: Andrew Morton --- fs/block_dev.c | 2 +- fs/buffer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff -puN fs/block_dev.c~add-__gfp_movable-for-callers-to-flag-allocations-from-low-memory-that-may-be-migrated fs/block_dev.c --- a/fs/block_dev.c~add-__gfp_movable-for-callers-to-flag-allocations-from-low-memory-that-may-be-migrated +++ a/fs/block_dev.c @@ -575,7 +575,7 @@ struct block_device *bdget(dev_t dev) inode->i_rdev = dev; inode->i_bdev = bdev; inode->i_data.a_ops = &def_blk_aops; - mapping_set_gfp_mask(&inode->i_data, GFP_USER); + mapping_set_gfp_mask(&inode->i_data, GFP_USER|__GFP_MOVABLE); inode->i_data.backing_dev_info = &default_backing_dev_info; spin_lock(&bdev_lock); list_add(&bdev->bd_list, &all_bdevs); diff -puN fs/buffer.c~add-__gfp_movable-for-callers-to-flag-allocations-from-low-memory-that-may-be-migrated fs/buffer.c --- a/fs/buffer.c~add-__gfp_movable-for-callers-to-flag-allocations-from-low-memory-that-may-be-migrated +++ a/fs/buffer.c @@ -2650,7 +2650,7 @@ int submit_bh(int rw, struct buffer_head * from here on down, it's all bio -- do the initial mapping, * submit_bio -> generic_make_request may further map this bio around */ - bio = bio_alloc(GFP_NOIO, 1); + bio = bio_alloc(GFP_NOIO|__GFP_MOVABLE, 1); bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9); bio->bi_bdev = bh->b_bdev; _