aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Henriques <luis.henriques@canonical.com>2013-10-31 14:27:18 +0000
committerLuis Henriques <luis.henriques@canonical.com>2013-10-31 14:27:18 +0000
commit4686f5f3f1fa7bdbd6b899f6c04c6afb558aef9f (patch)
treee58ffe715375cd5df8e4492193ad7b5bdae7e1c1
parentf6d0dd738b18e0d20349c85dfe6b4bbad593b315 (diff)
Revert "fs: buffer: move allocation failure loop into the allocator"
This reverts commit 4e0c7c422e59801cab17bb567e91df725d797645 which is commit 84235de394d9775bfaa7fa9762a59d91fef0c1fc upstream. As requested by Johannes Weiner, I'm reverting this commit it is part of a bigger series and was tagged for stable as a reminder only: "This is a followup patch of the memcg OOM killer rewrite. It is stable material but kind of invasive so the original patches weren't tagged right away. I tagged this fix as a reminder. Please don't apply for now..." Cc: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
-rw-r--r--fs/buffer.c14
-rw-r--r--mm/memcontrol.c2
2 files changed, 2 insertions, 14 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 2675e5a154e8..2c78739f54cf 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -957,19 +957,9 @@ grow_dev_page(struct block_device *bdev, sector_t block,
struct buffer_head *bh;
sector_t end_block;
int ret = 0; /* Will call free_more_memory() */
- gfp_t gfp_mask;
- gfp_mask = mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS;
- gfp_mask |= __GFP_MOVABLE;
- /*
- * XXX: __getblk_slow() can not really deal with failure and
- * will endlessly loop on improvised global reclaim. Prefer
- * looping in the allocator rather than here, at least that
- * code knows what it's doing.
- */
- gfp_mask |= __GFP_NOFAIL;
-
- page = find_or_create_page(inode->i_mapping, index, gfp_mask);
+ page = find_or_create_page(inode->i_mapping, index,
+ (mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS)|__GFP_MOVABLE);
if (!page)
return ret;
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 953bf3ca7146..226b63e2e525 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2405,8 +2405,6 @@ done:
return 0;
nomem:
*ptr = NULL;
- if (gfp_mask & __GFP_NOFAIL)
- return 0;
return -ENOMEM;
bypass:
*ptr = root_mem_cgroup;