remarkable-linux/arch/sparc/kernel
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
..
.gitignore
apc.c sparc: kernel: apc: make of_device_ids const 2017-06-25 13:39:02 -07:00
asm-offsets.c sched/headers: Prepare to remove the <linux/mm_types.h> dependency from <linux/sched.h> 2017-03-02 08:42:37 +01:00
audit.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
auxio_32.c sparc32: fix sparse warning in auxio_32.c 2014-05-18 19:01:27 -07:00
auxio_64.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
btext.c sparc64: fix sparse warning in btext.c 2014-05-18 19:01:30 -07:00
central.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
cherrs.S sparc64: Fix bootup regressions on some Kconfig combinations. 2016-04-27 17:27:37 -04:00
chmc.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
compat_audit.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
cpu.c sparc64: recognize and support Sonoma CPU type 2016-04-21 16:43:47 -04:00
cpumap.c sparc64: recognize and support Sonoma CPU type 2016-04-21 16:43:47 -04:00
cpumap.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
devices.c sparc32: drop tadpole specific code 2014-05-18 19:01:29 -07:00
dma.c
ds.c sparc64: Fix build warnings with gcc 7. 2017-06-01 09:42:46 -07:00
dtlb_miss.S
dtlb_prot.S sparc: Don't leak context bits into thread->fault_address 2016-07-27 17:50:26 -07:00
ebus.c
entry.h sparc: Resolve conflict between sparc v9 and M7 on usage of bit 9 of TTE 2015-05-31 22:15:01 -07:00
entry.S sparc: move exports to definitions 2016-08-07 23:55:43 -04:00
etrap_32.S
etrap_64.S
fpu_traps.S sparc64: Fix bootup regressions on some Kconfig combinations. 2016-04-27 17:27:37 -04:00
ftrace.c sparc/ftrace: Fix ftrace graph time measurement 2017-05-17 12:07:47 -07:00
getsetcc.S
head_32.S sparc32: kill __ret_efault() 2017-03-28 18:24:00 -04:00
head_64.S sparc64: fix fault handling in NGbzero.S and GENbzero.S 2017-05-09 12:16:25 -07:00
helpers.S sparc: move exports to definitions 2016-08-07 23:55:43 -04:00
hvapi.c sparc64: Add ATU (new IOMMU) support 2016-11-18 11:16:59 -08:00
hvcalls.S sparc: move exports to definitions 2016-08-07 23:55:43 -04:00
hvtramp.S sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
idprom.c net: Add eth_platform_get_mac_address() helper. 2016-01-06 16:31:56 -05:00
iommu.c sparc: remove arch specific dma_supported implementations 2017-06-28 06:54:39 -07:00
iommu_common.h sparc: implement ->mapping_error 2017-06-28 06:54:32 -07:00
ioport.c sparc: remove arch specific dma_supported implementations 2017-06-28 06:54:39 -07:00
irq.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
irq_32.c sparc32: off by ones in BUG_ON() 2016-07-27 22:53:17 -07:00
irq_64.c arch/sparc: support NR_CPUS = 4096 2017-06-06 16:41:47 -04:00
itlb_miss.S
ivec.S
jump_label.c jump_label: Reorder hotplug lock and jump_label_lock 2017-05-26 10:10:45 +02:00
kernel.h sparc64: initialize time early 2017-06-12 15:44:03 -07:00
kgdb_32.c sparc32: use proper prototype for trapbase 2016-05-20 17:55:41 -07:00
kgdb_64.c sparc64: fix sparse warning in kgdb_64.c 2014-05-18 19:01:34 -07:00
kprobes.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
kstack.h
ktlb.S sparc: Don't leak context bits into thread->fault_address 2016-07-27 17:50:26 -07:00
ldc.c sparc64: skip handshake for LDC channels in RAW mode 2017-06-25 13:43:12 -07:00
led.c sparc: use memdup_user_nul in sun4m LED driver 2017-05-09 12:16:25 -07:00
leon_kernel.c sparc: leon: Fix a retry loop in leon_init_timers() 2016-12-11 18:15:49 -08:00
leon_pci.c PCI: Cleanup control flow 2015-03-19 10:17:22 -05:00
leon_pci_grpci1.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
leon_pci_grpci2.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
leon_pmc.c
leon_smp.c sched/headers: Move task->mm handling methods to <linux/sched/mm.h> 2017-03-03 01:43:28 +01:00
Makefile sparc64:Support User Probes for sparc 2016-12-11 18:01:51 -08:00
mdesc.c mm, tree wide: replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic 2017-07-12 16:26:03 -07:00
misctrap.S arch/sparc: Avoid DCTI Couples 2017-03-27 21:51:40 -07:00
module.c mm: vmalloc: pass additional vm_flags to __vmalloc_node_range() 2015-02-13 21:21:42 -08:00
nmi.c kernel/watchdog: introduce arch_touch_nmi_watchdog() 2017-07-12 16:26:02 -07:00
of_device_32.c
of_device_64.c
of_device_common.c
of_device_common.h
pci.c PCI: Add BAR index argument to pci_mmap_page_range() 2017-04-20 08:47:47 -05:00
pci_common.c sparc/PCI: Add mem64 resource parsing for root bus 2015-10-29 17:35:46 -05:00
pci_fire.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
pci_impl.h sparc/PCI: Add mem64 resource parsing for root bus 2015-10-29 17:35:46 -05:00
pci_msi.c PCI/MSI: Rename mask/unmask_msi_irq treewide 2014-11-23 13:01:45 +01:00
pci_psycho.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
pci_sabre.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
pci_schizo.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
pci_sun4v.c sparc: remove arch specific dma_supported implementations 2017-06-28 06:54:39 -07:00
pci_sun4v.h sparc64: Enable sun4v dma ops to use IOMMU v2 APIs 2016-11-18 11:17:00 -08:00
pci_sun4v_asm.S sparc64: Enable sun4v dma ops to use IOMMU v2 APIs 2016-11-18 11:17:00 -08:00
pcic.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
pcr.c sparc: perf: Add support M7 processor 2015-03-19 18:54:49 -07:00
perf_event.c perf core: Add a 'nr' field to perf_event_callchain_context 2016-05-16 23:11:51 -03:00
pmc.c sparc: kernel: pmc: make of_device_ids const. 2017-07-03 02:53:07 -07:00
power.c sparc: kernel: use builtin_platform_driver 2016-12-11 18:15:48 -08:00
process_32.c arch: remove unused macro/function thread_saved_pc() 2017-06-28 16:13:57 -07:00
process_64.c arch: remove unused macro/function thread_saved_pc() 2017-06-28 16:13:57 -07:00
prom.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
prom_32.c
prom_64.c sparc64: fix typo in property 2017-06-25 22:01:11 -04:00
prom_common.c
prom_irqtrans.c
psycho_common.c
psycho_common.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
ptrace_32.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
ptrace_64.c sparc64: Fill in rest of HAVE_REGS_AND_STACK_ACCESS_API 2017-04-23 17:15:51 -07:00
reboot.c
rtrap_32.S
rtrap_64.S arch/sparc: Avoid DCTI Couples 2017-03-27 21:51:40 -07:00
sbus.c
setup_32.c sparc: Remove redundant tests in boot_flags_init(). 2017-05-03 08:28:48 -07:00
setup_64.c sparc64: initialize time early 2017-06-12 15:44:03 -07:00
signal32.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
signal_32.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
signal_64.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
sigutil.h
sigutil_32.c sparc: Harden signal return frame checks. 2016-05-29 11:24:05 -07:00
sigutil_64.c sparc: Harden signal return frame checks. 2016-05-29 11:24:05 -07:00
smp_32.c cpu/hotplug: Remove CPU_STARTING and CPU_DYING notifier 2016-09-06 18:30:19 +02:00
smp_64.c sparc64: delete old wrap code 2017-06-06 13:45:29 -07:00
sparc_ksyms.c sparc: move exports to definitions 2016-08-07 23:55:43 -04:00
spiterrs.S arch/sparc: Avoid DCTI Couples 2017-03-27 21:51:40 -07:00
sstate.c sparc: Fixed typo in sstate.c. Replaced panicing with panicking 2017-01-16 22:31:51 -05:00
stacktrace.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/debug.h> 2017-03-02 08:42:34 +01:00
starfire.c arch: sparc: kernel: starfire.c: Remove unused function 2015-03-01 21:33:58 -08:00
sun4d_irq.c sparc/irq: Use helper irq_data_get_irq_handler_data() 2015-07-31 22:20:05 +02:00
sun4d_smp.c sched/headers: Move task->mm handling methods to <linux/sched/mm.h> 2017-03-03 01:43:28 +01:00
sun4m_irq.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/debug.h> 2017-03-02 08:42:34 +01:00
sun4m_smp.c sched/headers: Move task->mm handling methods to <linux/sched/mm.h> 2017-03-03 01:43:28 +01:00
sun4v_ivec.S
sun4v_tlb_miss.S arch/sparc: Avoid DCTI Couples 2017-03-27 21:51:40 -07:00
sys32.S sparc: Hook up renameat2 syscall. 2014-07-21 22:27:56 -07:00
sys_sparc32.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
sys_sparc_32.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/debug.h> 2017-03-02 08:42:34 +01:00
sys_sparc_64.c mm: larger stack guard gap, between vmas 2017-06-19 21:50:20 +08:00
syscalls.S sparc: Fix system call tracing register handling. 2016-01-21 16:06:00 -08:00
sysfs.c sparc/sysfs: Replace racy task affinity logic 2017-04-15 12:20:54 +02:00
systbls.h sparc64: fix sparse warnings in sys_sparc32.c 2014-05-18 19:01:31 -07:00
systbls_32.S sparc: Update syscall tables. 2017-04-23 18:28:55 -07:00
systbls_64.S sparc: Update syscall tables. 2017-04-23 18:28:55 -07:00
time_32.c sparc/time: make of_device_ids const 2017-06-15 08:25:19 -07:00
time_64.c sparc64: fix typo in property 2017-06-25 22:01:11 -04:00
trampoline_32.S
trampoline_64.S sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
traps_32.c sched/headers: Move task->mm handling methods to <linux/sched/mm.h> 2017-03-03 01:43:28 +01:00
traps_64.c sched/headers: Move task->mm handling methods to <linux/sched/mm.h> 2017-03-03 01:43:28 +01:00
tsb.S sparc64: mm: fix copy_tsb to correctly copy huge page TSBs 2017-06-06 13:45:02 -07:00
ttable_32.S
ttable_64.S sparc64: delete old wrap code 2017-06-06 13:45:29 -07:00
una_asm_32.S
una_asm_64.S
unaligned_32.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
unaligned_64.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
uprobes.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
urtt_fill.S arch/sparc: Avoid DCTI Couples 2017-03-27 21:51:40 -07:00
utrap.S sparc64: Fix bootup regressions on some Kconfig combinations. 2016-04-27 17:27:37 -04:00
vio.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2017-07-08 12:14:14 -07:00
viohs.c sparc64: skip handshake for LDC channels in RAW mode 2017-06-25 13:43:12 -07:00
visemul.c scripts/spelling.txt: add "partiton" pattern and fix typo instances 2017-02-27 18:43:46 -08:00
vmlinux.lds.S sparc64: add hot-patched and inlined get_tick() 2017-06-12 15:44:03 -07:00
windows.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
winfixup.S arch/sparc: Avoid DCTI Couples 2017-03-27 21:51:40 -07:00
wof.S
wuf.S