linux/fs/ext4
Michal Hocko 8a5c743e30 mm, memcg: use consistent gfp flags during readahead
Vladimir has noticed that we might declare memcg oom even during
readahead because read_pages only uses GFP_KERNEL (with mapping_gfp
restriction) while __do_page_cache_readahead uses
page_cache_alloc_readahead which adds __GFP_NORETRY to prevent from
OOMs.  This gfp mask discrepancy is really unfortunate and easily
fixable.  Drop page_cache_alloc_readahead() which only has one user and
outsource the gfp_mask logic into readahead_gfp_mask and propagate this
mask from __do_page_cache_readahead down to read_pages.

This alone would have only very limited impact as most filesystems are
implementing ->readpages and the common implementation mpage_readpages
does GFP_KERNEL (with mapping_gfp restriction) again.  We can tell it to
use readahead_gfp_mask instead as this function is called only during
readahead as well.  The same applies to read_cache_pages.

ext4 has its own ext4_mpage_readpages but the path which has pages !=
NULL can use the same gfp mask.  Btrfs, cifs, f2fs and orangefs are
doing a very similar pattern to mpage_readpages so the same can be
applied to them as well.

[akpm@linux-foundation.org: coding-style fixes]
[mhocko@suse.com: restrict gfp mask in mpage_alloc]
  Link: http://lkml.kernel.org/r/20160610074223.GC32285@dhcp22.suse.cz
Link: http://lkml.kernel.org/r/1465301556-26431-1-git-send-email-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Cc: Vladimir Davydov <vdavydov@parallels.com>
Cc: Chris Mason <clm@fb.com>
Cc: Steve French <sfrench@samba.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>
Cc: Mike Marshall <hubcap@omnibond.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Changman Lee <cm224.lee@samsung.com>
Cc: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-07-26 16:19:19 -07:00
..
Kconfig
Makefile
acl.c posix_acl: Inode acl caching fixes 2016-03-31 00:30:15 -04:00
acl.h
balloc.c ext4: fix race in transient ENOSPC detection 2016-05-13 00:42:40 -04:00
bitmap.c
block_validity.c
crypto.c ext4/fscrypto: avoid RCU lookup in d_revalidate 2016-04-12 20:01:35 -07:00
crypto_fname.c
crypto_key.c
crypto_policy.c
dir.c Fix a number of bugs, most notably a potential stale data exposure 2016-05-24 12:55:26 -07:00
ext4.h ext4: pre-zero allocated blocks for DAX IO 2016-05-13 00:51:15 -04:00
ext4_crypto.h
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h ext4: do not ask jbd2 to write data for delalloc buffers 2016-04-24 00:56:08 -04:00
extents.c ext4: remove unmeetable inconsisteny check from ext4_find_extent() 2016-05-05 22:43:04 -04:00
extents_status.c ext4: remove trailing \n from ext4_warning/ext4_error calls 2016-04-27 01:11:21 -04:00
extents_status.h
file.c dax: remote unused fault wrappers 2016-07-26 16:19:19 -07:00
fsync.c
hash.c
ialloc.c ext4: clean up error handling when orphan list is corrupted 2016-04-30 00:49:54 -04:00
indirect.c ext4: refactor direct IO code 2016-05-13 00:44:16 -04:00
inline.c ext4: remove trailing \n from ext4_warning/ext4_error calls 2016-04-27 01:11:21 -04:00
inode.c Fix a number of bugs, most notably a potential stale data exposure 2016-05-24 12:55:26 -07:00
ioctl.c Fix a number of bugs, most notably a potential stale data exposure 2016-05-24 12:55:26 -07:00
mballoc.c ext4: silence UBSAN in ext4_mb_init() 2016-05-05 19:46:19 -04:00
mballoc.h
migrate.c
mmp.c ext4: remove trailing \n from ext4_warning/ext4_error calls 2016-04-27 01:11:21 -04:00
move_extent.c ext4: do not ask jbd2 to write data for delalloc buffers 2016-04-24 00:56:08 -04:00
namei.c Fix a number of bugs, most notably a potential stale data exposure 2016-05-24 12:55:26 -07:00
page-io.c ext4: remove unnecessary bio get/put 2016-05-05 22:09:49 -04:00
readpage.c mm, memcg: use consistent gfp flags during readahead 2016-07-26 16:19:19 -07:00
resize.c ext4: remove trailing \n from ext4_warning/ext4_error calls 2016-04-27 01:11:21 -04:00
super.c ext4: Add alignment check for DAX mount 2016-05-17 00:44:11 -06:00
symlink.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
sysfs.c
truncate.h
xattr.c ext4: check if in-inode xattr is corrupted in ext4_expand_extra_isize_ea() 2016-03-22 16:13:15 -04:00
xattr.h
xattr_security.c switch xattr_handler->set() to passing dentry and inode separately 2016-05-27 15:39:43 -04:00
xattr_trusted.c switch xattr_handler->set() to passing dentry and inode separately 2016-05-27 15:39:43 -04:00
xattr_user.c switch xattr_handler->set() to passing dentry and inode separately 2016-05-27 15:39:43 -04:00