1
0
Fork 0
alistair23-linux/arch/arm
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
..
boot Fixes for omaps for v4.7-rc cycle: 2016-06-18 22:57:48 -07:00
common Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2016-03-19 16:31:54 -07:00
configs Two fixes for v4.7 cycle for build issues: 2016-06-03 12:15:00 -07:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-03-17 11:22:54 -07:00
firmware
include tree wide: get rid of __GFP_REPEAT for order-0 allocations part I 2016-06-24 17:23:52 -07:00
kernel Fixes for omaps for v4.7-rc cycle: 2016-06-18 22:57:48 -07:00
kvm - move kvm_stat tool from QEMU repo into tools/kvm/kvm_stat 2016-05-27 13:41:54 -07:00
lib
mach-alpine ARM: alpine: select the Alpine MSI controller driver 2016-02-26 22:57:22 +01:00
mach-artpec arm: initial machine port for artpec-6 SoC 2016-02-24 13:55:47 -08:00
mach-asm9260
mach-aspeed arm: Add Aspeed machine 2016-05-09 17:41:14 +09:30
mach-at91 ARM: at91/soc: reference the whole sama5d2 family 2016-03-29 16:34:31 +02:00
mach-axxia
mach-bcm bus: brcmstb_gisb: Rework dependencies 2016-04-18 14:20:30 -07:00
mach-berlin cpufreq: berlin: Use generic platdev driver 2016-04-25 16:18:23 +02:00
mach-clps711x
mach-cns3xxx ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-davinci ARM: DT updates for v4.7 2016-05-18 12:48:46 -07:00
mach-digicolor
mach-dove ARM: dove: Remove CLK_IS_ROOT 2016-04-27 13:55:52 +02:00
mach-ebsa110
mach-efm32
mach-ep93xx
mach-exynos Two fixes for v4.7 cycle for build issues: 2016-06-03 12:15:00 -07:00
mach-footbridge ARM: 8530/1: remove VIRT_TO_BUS 2016-02-22 16:55:42 +00:00
mach-gemini ARM: gemini: switch to gpiochip_add_data() 2016-02-19 09:51:41 +01:00
mach-highbank
mach-hisi
mach-imx ARM: imx6ul: Fix Micrel PHY mask 2016-06-09 20:49:29 +08:00
mach-integrator ARM: integrator: move flash registration to device tree 2016-04-04 10:33:16 +02:00
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx This is the bulk of GPIO changes for kernel v4.6: 2016-03-17 21:05:32 -07:00
mach-keystone ARM: provide improved virt_to_idmap() functionality 2016-05-03 11:13:54 +01:00
mach-ks8695 ARM: SoC non-urgent fixes for v4.6 2016-03-20 14:26:57 -07:00
mach-lpc18xx
mach-lpc32xx ARM: lpc32xx: fix NR_IRQS confict 2016-05-24 19:32:46 +00:00
mach-mediatek ARM: SoC driver updates for v4.7 2016-05-18 13:14:02 -07:00
mach-meson
mach-mmp
mach-moxart
mach-mv78xx0 ARM: mv78xx0: Remove CLK_IS_ROOT 2016-04-27 12:42:55 +02:00
mach-mvebu cpufreq: mvebu: Move cpufreq code into drivers/cpufreq/ 2016-04-28 15:22:43 +02:00
mach-mxs
mach-netx ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-nomadik
mach-nspire ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-omap1 ARM: OMAP1: fix ams-delta FIQ handler to work with sparse IRQ 2016-06-17 02:37:36 -07:00
mach-omap2 Fixes for omaps for v4.7-rc cycle: 2016-06-18 22:57:48 -07:00
mach-orion5x ARM: orion5x: Remove CLK_IS_ROOT 2016-04-27 13:11:42 +02:00
mach-oxnas ARM: Add new mach-oxnas 2016-04-26 09:50:52 +02:00
mach-picoxcell
mach-prima2 ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-pxa ARM: SoC fixes for 4.7 2016-05-24 15:50:58 -07:00
mach-qcom
mach-realview ARM: realview: hide unused 'pmu_device' object 2016-04-04 10:58:47 +02:00
mach-rockchip ARM: SoC cleanups and fixes for v4.7 2016-05-18 12:28:29 -07:00
mach-rpc ARM: 8532/1: uncompress: mark putc as inline 2016-02-22 16:55:42 +00:00
mach-s3c24xx ARM: Explicitly apply PWM config extracted from pwm_args 2016-05-17 14:45:08 +02:00
mach-s3c64xx ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
mach-s5pv210
mach-sa1100 ARM: sa1100: remove references to the defunct handhelds.org 2016-04-12 12:34:15 -07:00
mach-shmobile ARM: SoC driver updates for v4.7 2016-05-18 13:14:02 -07:00
mach-socfpga * Altera Arria10 L2 cache and On-Chip RAM ECC handling. (Thor Thayer) 2016-05-16 18:44:39 -07:00
mach-spear
mach-sti ARM: STi: Update platform level menuconfig 'help' 2016-04-07 16:32:14 +02:00
mach-stm32
mach-sunxi cpufreq: sunxi: Use generic platdev driver 2016-04-25 16:18:24 +02:00
mach-tango
mach-tegra ARM: SoC driver updates for v4.7 2016-05-18 13:14:02 -07:00
mach-u300
mach-uniphier ARM: SoC platform updates for v4.7 2016-05-18 12:35:46 -07:00
mach-ux500 ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-versatile ARM: versatile: move flash registration to the device tree 2016-04-04 10:33:16 +02:00
mach-vexpress vexpress/spc: Remove CLK_IS_ROOT 2016-06-01 14:48:01 -07:00
mach-vt8500
mach-w90x900 Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2016-03-19 16:31:54 -07:00
mach-zx
mach-zynq cpufreq: zynq: Use generic platdev driver 2016-04-25 16:18:24 +02:00
mm lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
net
nwfpe
oprofile
plat-iop
plat-omap
plat-orion Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2016-03-19 16:31:54 -07:00
plat-pxa ARM: pxa: add the number of DMA requestor lines 2016-02-26 22:57:05 +01:00
plat-samsung Two fixes for v4.7 cycle for build issues: 2016-06-03 12:15:00 -07:00
plat-versatile
probes
tools ARM: 8562/1: suppress "include/generated/mach-types.h is up to date." 2016-04-19 19:42:47 +01:00
vdso kbuild: drop FORCE from PHONY targets 2016-04-20 10:27:20 +02:00
vfp exit_thread: accept a task parameter to be exited 2016-05-20 17:58:30 -07:00
xen
Kconfig printk/nmi: generic solution for safe printk in NMI 2016-05-20 17:58:30 -07:00
Kconfig-nommu
Kconfig.debug ARM: debug: remove extraneous DEBUG_HI3716_UART option 2016-04-26 13:00:11 +02:00
Makefile ARM: vexpress/mps2: introduce MPS2 platform 2016-04-26 12:50:01 +02:00