linux/arch/xtensa/include/asm
Michal Hocko 32d6bd9059 tree wide: get rid of __GFP_REPEAT for order-0 allocations part I
This is the third version of the patchset previously sent [1].  I have
basically only rebased it on top of 4.7-rc1 tree and dropped "dm: get
rid of superfluous gfp flags" which went through dm tree.  I am sending
it now because it is tree wide and chances for conflicts are reduced
considerably when we want to target rc2.  I plan to send the next step
and rename the flag and move to a better semantic later during this
release cycle so we will have a new semantic ready for 4.8 merge window
hopefully.

Motivation:

While working on something unrelated I've checked the current usage of
__GFP_REPEAT in the tree.  It seems that a majority of the usage is and
always has been bogus because __GFP_REPEAT has always been about costly
high order allocations while we are using it for order-0 or very small
orders very often.  It seems that a big pile of them is just a
copy&paste when a code has been adopted from one arch to another.

I think it makes some sense to get rid of them because they are just
making the semantic more unclear.  Please note that GFP_REPEAT is
documented as

* __GFP_REPEAT: Try hard to allocate the memory, but the allocation attempt

* _might_ fail.  This depends upon the particular VM implementation.
  while !costly requests have basically nofail semantic.  So one could
  reasonably expect that order-0 request with __GFP_REPEAT will not loop
  for ever.  This is not implemented right now though.

I would like to move on with __GFP_REPEAT and define a better semantic
for it.

  $ git grep __GFP_REPEAT origin/master | wc -l
  111
  $ git grep __GFP_REPEAT | wc -l
  36

So we are down to the third after this patch series.  The remaining
places really seem to be relying on __GFP_REPEAT due to large allocation
requests.  This still needs some double checking which I will do later
after all the simple ones are sorted out.

I am touching a lot of arch specific code here and I hope I got it right
but as a matter of fact I even didn't compile test for some archs as I
do not have cross compiler for them.  Patches should be quite trivial to
review for stupid compile mistakes though.  The tricky parts are usually
hidden by macro definitions and thats where I would appreciate help from
arch maintainers.

[1] http://lkml.kernel.org/r/1461849846-27209-1-git-send-email-mhocko@kernel.org

This patch (of 19):

__GFP_REPEAT has a rather weak semantic but since it has been introduced
around 2.6.12 it has been ignored for low order allocations.  Yet we
have the full kernel tree with its usage for apparently order-0
allocations.  This is really confusing because __GFP_REPEAT is
explicitly documented to allow allocation failures which is a weaker
semantic than the current order-0 has (basically nofail).

Let's simply drop __GFP_REPEAT from those places.  This would allow to
identify place which really need allocator to retry harder and formulate
a more specific semantic for what the flag is supposed to do actually.

Link: http://lkml.kernel.org/r/1464599699-30131-2-git-send-email-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chen Liqin <liqin.linux@gmail.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com> [for tile]
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: John Crispin <blogic@openwrt.org>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-06-24 17:23:52 -07:00
..
Kbuild locking/rwsem, xtensa: Drop superfluous arch specific implementation 2016-04-13 10:42:18 +02:00
asm-offsets.h kbuild: move asm-offsets.h to include/generated 2009-12-12 13:08:14 +01:00
asmmacro.h xtensa: fixes for configs without loop option 2015-11-02 18:02:47 +03:00
atomic.h atomic, arch: Audit atomic_{read,set}() 2015-09-23 09:54:28 +02:00
barrier.h xtensa: define __smp_xxx 2016-01-12 20:46:58 +02:00
bitops.h arch,xtensa: Convert smp_mb__*() 2014-04-18 14:20:47 +02:00
bootparam.h xtensa: split bootparam and kernel meminfo 2014-04-02 01:35:51 +04:00
bugs.h
cache.h dma-mapping: rename ARCH_KMALLOC_MINALIGN to ARCH_DMA_MINALIGN 2010-08-11 08:59:21 -07:00
cacheasm.h xtensa: fix build for configs without cache options 2015-11-02 18:02:51 +03:00
cacheflush.h xtensa: support DMA to high memory 2015-11-09 01:25:37 +03:00
checksum.h ipv6: Pass proto to csum_ipv6_magic as __u8 instead of unsigned short 2016-03-13 23:55:13 -04:00
cmpxchg.h xtensa: implement fake NMI 2015-08-17 07:33:39 +03:00
coprocessor.h xtensa: reorganize SR referencing 2012-10-15 21:48:08 -07:00
current.h xtensa: clean up files to make them code-style compliant 2012-12-18 21:10:25 -08:00
delay.h xtensa: implement ndelay 2014-01-15 00:28:11 +04:00
device.h xtensa: reimplement DMA API using common helpers 2015-08-17 07:31:00 +03:00
dma-mapping.h dma-mapping: remove <asm-generic/dma-coherent.h> 2016-01-20 17:09:18 -08:00
dma.h Fix common misspellings 2011-03-31 11:26:23 -03:00
elf.h xtensa: add support for TLS 2013-02-23 19:35:57 -08:00
fb.h
fixmap.h xtensa: support aliasing cache in k[un]map_atomic 2014-08-14 11:59:21 +04:00
flat.h xtensa: add flat support 2009-04-02 23:41:29 -07:00
ftrace.h ftrace: Make CALLER_ADDRx macros more generic 2014-05-21 03:10:32 -04:00
futex.h xtensa: implement robust futex atomic uaccess ops 2014-01-14 10:19:51 -08:00
highmem.h xtensa: fix kmap_prot definition 2014-12-09 03:22:57 +03:00
hw_breakpoint.h xtensa: support hardware breakpoints/watchpoints 2016-03-11 08:53:32 +00:00
hw_irq.h
initialize_mmu.h xtensa: fix build for configs without cache options 2015-11-02 18:02:51 +03:00
io.h xtensa: support ioremap for memory outside KIO region 2016-01-11 17:37:36 +03:00
irq.h xtensa: implement CPU hotplug 2014-01-14 10:19:59 -08:00
irqflags.h xtensa: support hardware breakpoints/watchpoints 2016-03-11 08:53:32 +00:00
mmu.h xtensa: add SMP support 2014-01-14 10:19:58 -08:00
mmu_context.h xtensa: nommu: move init_mmu stub to nommu_context.h 2014-10-21 13:28:44 +04:00
module.h Make most arch asm/module.h files use asm-generic/module.h 2012-09-28 14:31:03 +09:30
mutex.h
mxregs.h xtensa: add MX irqchip 2014-01-14 10:19:58 -08:00
nommu_context.h xtensa: nommu: move init_mmu stub to nommu_context.h 2014-10-21 13:28:44 +04:00
page.h xtensa: nommu: clean up memory map dump 2014-10-21 13:28:58 +04:00
param.h UAPI: (Scripted) Disintegrate arch/xtensa/include/asm 2012-10-15 21:48:53 -07:00
pci-bridge.h xtensa: clean up files to make them code-style compliant 2012-12-18 21:10:25 -08:00
pci.h PCI: Move pci_dma_* helpers to common code 2016-03-07 10:40:02 -06:00
perf_event.h xtensa: enable HAVE_PERF_EVENTS 2014-01-15 00:27:03 +04:00
pgalloc.h tree wide: get rid of __GFP_REPEAT for order-0 allocations part I 2016-06-24 17:23:52 -07:00
pgtable.h xtensa: nommu: fix USER_RING definition 2015-11-02 18:02:58 +03:00
platform.h xtensa: remove unused platform_init_irq() 2013-06-05 10:14:20 -07:00
processor.h xtensa: support hardware breakpoints/watchpoints 2016-03-11 08:53:32 +00:00
ptrace.h xtensa: add SMP support 2014-01-14 10:19:58 -08:00
regs.h xtensa: support hardware breakpoints/watchpoints 2016-03-11 08:53:32 +00:00
segment.h
serial.h
shmparam.h
signal.h consolidate kernel-side struct sigaction declarations 2013-02-03 15:09:22 -05:00
smp.h xtensa: implement CPU hotplug 2014-01-14 10:19:59 -08:00
spinlock.h xtensa: fix arch spinlock function names 2014-01-14 10:19:53 -08:00
spinlock_types.h xtensa: fix arch spinlock function names 2014-01-14 10:19:53 -08:00
stacktrace.h xtensa: move oprofile stack tracing to stacktrace.c 2015-08-17 07:32:49 +03:00
string.h xtensa: fix str[n]cmp return value 2013-02-23 19:22:31 -08:00
switch_to.h Disintegrate asm/system.h for Xtensa 2012-03-28 18:30:03 +01:00
syscall.h xtensa: switch to generic sigaltstack 2013-02-03 18:16:27 -05:00
sysmem.h xtensa: keep sysmem banks ordered in add_sysmem_bank 2014-04-02 01:35:52 +04:00
thread_info.h xtensa: support hardware breakpoints/watchpoints 2016-03-11 08:53:32 +00:00
timex.h xtensa: use XTENSA_INT_LEVEL macro in asm/timex.h 2016-01-11 17:32:40 +03:00
tlb.h mm: Pass virtual address to [__]p{te,ud,md}_free_tlb() 2009-07-27 12:10:38 -07:00
tlbflush.h xtensa: optimize local_flush_tlb_kernel_range 2014-04-06 21:29:17 +04:00
traps.h xtensa: support hardware breakpoints/watchpoints 2016-03-11 08:53:32 +00:00
types.h UAPI: (Scripted) Disintegrate arch/xtensa/include/asm 2012-10-15 21:48:53 -07:00
uaccess.h xtensa: macro whitespace fixes 2015-01-13 15:24:10 +02:00
ucontext.h
unaligned.h
unistd.h consolidate cond_syscall and SYSCALL_ALIAS declarations 2013-03-03 22:55:19 -05:00
user.h
vectors.h xtensa: drop unused sections and remapped reset handlers 2015-11-03 17:19:39 +03:00
vga.h