linux/drivers/s390/char
Michal Hocko dcda9b0471 mm, tree wide: replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic
__GFP_REPEAT was designed to allow retry-but-eventually-fail semantic to
the page allocator.  This has been true but only for allocations
requests larger than PAGE_ALLOC_COSTLY_ORDER.  It has been always
ignored for smaller sizes.  This is a bit unfortunate because there is
no way to express the same semantic for those requests and they are
considered too important to fail so they might end up looping in the
page allocator for ever, similarly to GFP_NOFAIL requests.

Now that the whole tree has been cleaned up and accidental or misled
usage of __GFP_REPEAT flag has been removed for !costly requests we can
give the original flag a better name and more importantly a more useful
semantic.  Let's rename it to __GFP_RETRY_MAYFAIL which tells the user
that the allocator would try really hard but there is no promise of a
success.  This will work independent of the order and overrides the
default allocator behavior.  Page allocator users have several levels of
guarantee vs.  cost options (take GFP_KERNEL as an example)

 - GFP_KERNEL & ~__GFP_RECLAIM - optimistic allocation without _any_
   attempt to free memory at all. The most light weight mode which even
   doesn't kick the background reclaim. Should be used carefully because
   it might deplete the memory and the next user might hit the more
   aggressive reclaim

 - GFP_KERNEL & ~__GFP_DIRECT_RECLAIM (or GFP_NOWAIT)- optimistic
   allocation without any attempt to free memory from the current
   context but can wake kswapd to reclaim memory if the zone is below
   the low watermark. Can be used from either atomic contexts or when
   the request is a performance optimization and there is another
   fallback for a slow path.

 - (GFP_KERNEL|__GFP_HIGH) & ~__GFP_DIRECT_RECLAIM (aka GFP_ATOMIC) -
   non sleeping allocation with an expensive fallback so it can access
   some portion of memory reserves. Usually used from interrupt/bh
   context with an expensive slow path fallback.

 - GFP_KERNEL - both background and direct reclaim are allowed and the
   _default_ page allocator behavior is used. That means that !costly
   allocation requests are basically nofail but there is no guarantee of
   that behavior so failures have to be checked properly by callers
   (e.g. OOM killer victim is allowed to fail currently).

 - GFP_KERNEL | __GFP_NORETRY - overrides the default allocator behavior
   and all allocation requests fail early rather than cause disruptive
   reclaim (one round of reclaim in this implementation). The OOM killer
   is not invoked.

 - GFP_KERNEL | __GFP_RETRY_MAYFAIL - overrides the default allocator
   behavior and all allocation requests try really hard. The request
   will fail if the reclaim cannot make any progress. The OOM killer
   won't be triggered.

 - GFP_KERNEL | __GFP_NOFAIL - overrides the default allocator behavior
   and all allocation requests will loop endlessly until they succeed.
   This might be really dangerous especially for larger orders.

Existing users of __GFP_REPEAT are changed to __GFP_RETRY_MAYFAIL
because they already had their semantic.  No new users are added.
__alloc_pages_slowpath is changed to bail out for __GFP_RETRY_MAYFAIL if
there is no progress and we have already passed the OOM point.

This means that all the reclaim opportunities have been exhausted except
the most disruptive one (the OOM killer) and a user defined fallback
behavior is more sensible than keep retrying in the page allocator.

[akpm@linux-foundation.org: fix arch/sparc/kernel/mdesc.c]
[mhocko@suse.com: semantic fix]
  Link: http://lkml.kernel.org/r/20170626123847.GM11534@dhcp22.suse.cz
[mhocko@kernel.org: address other thing spotted by Vlastimil]
  Link: http://lkml.kernel.org/r/20170626124233.GN11534@dhcp22.suse.cz
Link: http://lkml.kernel.org/r/20170623085345.11304-3-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Alex Belits <alex.belits@cavium.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Cc: David Daney <david.daney@cavium.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: NeilBrown <neilb@suse.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-12 16:26:03 -07:00
..
con3215.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
con3270.c s390: use false/true when using bool 2017-01-16 07:27:54 +01:00
ctrlchar.c s390/ctrlchar: improve handling of magic sysrequests 2015-08-26 17:20:44 +02:00
ctrlchar.h s390/ctrlchar: improve handling of magic sysrequests 2015-08-26 17:20:44 +02:00
defkeymap.c
defkeymap.map
diag_ftp.c s390/diag: add a statistic for diagnose calls 2015-10-14 14:32:06 +02:00
diag_ftp.h s390/hmcdrv: HMC drive CD/DVD access 2014-09-25 10:52:02 +02:00
fs3270.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
hmcdrv_cache.c s390/hmcdrv: HMC drive CD/DVD access 2014-09-25 10:52:02 +02:00
hmcdrv_cache.h s390/hmcdrv: HMC drive CD/DVD access 2014-09-25 10:52:02 +02:00
hmcdrv_dev.c assorted conversions to %p[dD] 2014-11-19 13:01:20 -05:00
hmcdrv_dev.h s390/hmcdrv: HMC drive CD/DVD access 2014-09-25 10:52:02 +02:00
hmcdrv_ftp.c s390/hmcdrv: constify hmcdrv_ftp_ops structs 2015-12-30 10:34:25 +01:00
hmcdrv_ftp.h s390/hmcdrv: HMC drive CD/DVD access 2014-09-25 10:52:02 +02:00
hmcdrv_mod.c s390/hmcdrv: remove unnecessary version.h inclusion 2015-01-15 11:11:16 +01:00
Kconfig s390/sclp: add open for business support 2015-11-27 09:24:18 +01:00
keyboard.c s390 keyboard.c: don't open-code strndup_user() 2017-05-15 23:41:50 -04:00
keyboard.h
Makefile s390/sclp: move early printk code to drivers 2017-02-08 14:13:17 +01:00
monreader.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
monwriter.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
raw3270.c s390: use false/true when using bool 2017-01-16 07:27:54 +01:00
raw3270.h s390/3270: avoid endless I/O loop with disconnected 3270 terminals 2016-05-04 16:29:53 +02:00
sclp_async.c s390/sclp_async: add Kconfig option to specify the component id 2014-11-28 09:45:11 +01:00
sclp_cmd.c s390/smp: initialize cpu_present_mask in setup_arch 2016-12-07 07:23:07 +01:00
sclp_con.c s390/console: Make preferred console handling more consistent 2016-07-13 10:58:07 +02:00
sclp_config.c s390/cpuinfo: show dynamic and static cpu mhz 2016-06-13 15:58:17 +02:00
sclp_cpi_sys.c s390/sclp: event type macro cleanup 2016-04-15 18:16:39 +02:00
sclp_cpi_sys.h
sclp_ctl.c s390: char: make slp_ctl explicitly non-modular 2016-11-10 16:55:46 +01:00
sclp_diag.h s390/hmcdrv: HMC drive CD/DVD access 2014-09-25 10:52:02 +02:00
sclp_early_core.c s390/sclp: get rid of common response code handling 2017-02-08 14:13:21 +01:00
sclp_early.c s390/sclp: Detect KSS facility 2017-04-21 11:08:04 +02:00
sclp_ftp.c s390/hmcdrv: HMC drive CD/DVD access 2014-09-25 10:52:02 +02:00
sclp_ftp.h s390/hmcdrv: HMC drive CD/DVD access 2014-09-25 10:52:02 +02:00
sclp_ocf.c s390: Make cpc_name accessible 2016-06-10 12:07:10 +02:00
sclp_pci.c s390/sclp: avoid compile warning in sclp_pci_report 2016-04-21 09:51:17 +02:00
sclp_quiesce.c s390: char: make slcp_quiesce explicitly non-modular 2016-10-31 17:55:39 +01:00
sclp_rw.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
sclp_rw.h s390/sclp: avoid merged message output 2015-10-14 14:32:10 +02:00
sclp_sdias.c s390/sclp: pass timeout as HZ independent value 2015-06-15 10:50:57 +02:00
sclp_sdias.h s390/sclp: Move declarations for sclp_sdias into separate header file 2013-11-15 14:08:39 +01:00
sclp_tty.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
sclp_tty.h
sclp_vt220.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
sclp.c s390: drivers: convert to use DRIVER_ATTR_RO/WO 2017-06-12 16:14:31 +02:00
sclp.h s390/sclp: get rid of common response code handling 2017-02-08 14:13:21 +01:00
tape_34xx.c s390/tape: remove redundant if statement 2015-01-22 12:51:49 +01:00
tape_3590.c s390/tape: Use memdup_user() rather than duplicating its implementation 2016-08-24 09:23:57 +02:00
tape_3590.h
tape_char.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
tape_class.c
tape_class.h
tape_core.c s390: Use pr_warn instead of pr_warning 2016-03-07 13:12:04 +01:00
tape_proc.c
tape_std.c s390/tape: Add missing destroy_timer_on_stack() 2014-04-01 09:23:37 +02:00
tape_std.h
tape.h
tty3270.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
tty3270.h
vmcp.c mm, tree wide: replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic 2017-07-12 16:26:03 -07:00
vmcp.h
vmlogrdr.c s390: drivers: convert to use DRIVER_ATTR_RO/WO 2017-06-12 16:14:31 +02:00
vmur.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
vmur.h
zcore.c s390: proper type casts for csum_partial invocations 2017-01-16 07:27:53 +01:00