Commit bc48f001 authored by Jens Axboe's avatar Jens Axboe

buffer: eliminate the need to call free_more_memory() in __getblk_slow()

Since the previous commit removed any case where grow_buffers()
would return failure due to memory allocations, we can safely
remove the case where we have to call free_more_memory() in
this function.

Since this is also the last user of free_more_memory(), kill
it off completely.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 94dc24c0
...@@ -252,27 +252,6 @@ __find_get_block_slow(struct block_device *bdev, sector_t block) ...@@ -252,27 +252,6 @@ __find_get_block_slow(struct block_device *bdev, sector_t block)
return ret; return ret;
} }
/*
* Kick the writeback threads then try to free up some ZONE_NORMAL memory.
*/
static void free_more_memory(void)
{
struct zoneref *z;
int nid;
wakeup_flusher_threads(1024, WB_REASON_FREE_MORE_MEM);
yield();
for_each_online_node(nid) {
z = first_zones_zonelist(node_zonelist(nid, GFP_NOFS),
gfp_zone(GFP_NOFS), NULL);
if (z->zone)
try_to_free_pages(node_zonelist(nid, GFP_NOFS), 0,
GFP_NOFS, NULL);
}
}
/* /*
* I/O completion handler for block_read_full_page() - pages * I/O completion handler for block_read_full_page() - pages
* which come unlocked at the end of I/O. * which come unlocked at the end of I/O.
...@@ -1086,8 +1065,6 @@ __getblk_slow(struct block_device *bdev, sector_t block, ...@@ -1086,8 +1065,6 @@ __getblk_slow(struct block_device *bdev, sector_t block,
ret = grow_buffers(bdev, block, size, gfp); ret = grow_buffers(bdev, block, size, gfp);
if (ret < 0) if (ret < 0)
return NULL; return NULL;
if (ret == 0)
free_more_memory();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment