linux/drivers/mmc/host
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
..
Kconfig mmc: renesas-sdhi: rename sh_mobile_sdhi.c => renesas_sdhi_core.c 2017-06-20 10:30:15 +02:00
Makefile mmc: renesas-sdhi: rename sh_mobile_sdhi.c => renesas_sdhi_core.c 2017-06-20 10:30:15 +02:00
android-goldfish.c mmc: use new core function mmc_get_dma_dir 2017-04-24 21:41:52 +02:00
atmel-mci.c mmc: atmel-mci: Delete an error message for a failed memory allocation 2017-06-20 10:30:20 +02:00
au1xmmc.c mmc: host: drop owner assignment from platform_drivers 2014-10-20 16:20:56 +02:00
bcm2835.c mmc: bcm2835: fix potential null pointer dereferences 2017-06-20 10:30:31 +02:00
bfin_sdh.c mmc: bfin_sdh: remove the MMC_DATA_STREAM flag 2016-02-29 11:02:59 +01:00
cavium-octeon.c mmc: cavium: Fix probing race with regulator 2017-05-22 18:01:46 +02:00
cavium-thunderx.c mmc: cavium: Fix probing race with regulator 2017-05-22 18:01:46 +02:00
cavium.c mmc: core: Delete bounce buffer Kconfig option 2017-06-20 10:30:17 +02:00
cavium.h mmc: cavium: Add scatter-gather DMA support 2017-04-24 21:42:10 +02:00
cb710-mmc.c mmc: cb710: Move away from using deprecated APIs 2013-10-30 20:26:37 -04:00
cb710-mmc.h mmc: cb710: use to_platform_device() 2016-01-05 18:04:57 +01:00
davinci_mmc.c mmc: use new core function mmc_get_dma_dir 2017-04-24 21:41:52 +02:00
dw_mmc-exynos.c mmc: dw_mmc: use the 'slot' instead of 'cur_slot' 2017-06-29 17:14:26 +02:00
dw_mmc-exynos.h mmc: dw_mmc: exynos: Support eMMC's HS400 mode 2015-03-23 14:13:28 +01:00
dw_mmc-k3.c mmc: dw_mmc: Remove the public dw_mmc header file 2017-02-13 13:19:59 +01:00
dw_mmc-pci.c mmc: dw_mmc: Remove the public dw_mmc header file 2017-02-13 13:19:59 +01:00
dw_mmc-pltfm.c mmc: dw_mmc: Remove the public dw_mmc header file 2017-02-13 13:19:59 +01:00
dw_mmc-pltfm.h mmc: remove use of __devexit 2012-11-28 12:28:18 -08:00
dw_mmc-rockchip.c mmc: dw_mmc-rockchip: parse rockchip, desired-num-phases from DT 2017-06-29 17:13:59 +02:00
dw_mmc-zx.c mmc: dw_mmc: zx: Initial support for ZX mmc controller 2017-02-13 13:20:03 +01:00
dw_mmc-zx.h mmc: dw_mmc: zx: Initial support for ZX mmc controller 2017-02-13 13:20:03 +01:00
dw_mmc.c mmc: dw_mmc: remove the unnecessary slot variable 2017-06-29 17:14:32 +02:00
dw_mmc.h mmc: dw_mmc: use the 'slot' instead of 'cur_slot' 2017-06-29 17:14:26 +02:00
jz4740_mmc.c mmc: jz4740: Let the pinctrl driver configure the pins 2017-05-22 17:20:02 +02:00
meson-gx-mmc.c mmc: meson-gx: work around broken SDIO with certain WiFi chips 2017-06-12 08:58:16 +02:00
mmc_spi.c mmc: use new core function mmc_get_dma_dir 2017-04-24 21:41:52 +02:00
mmci.c mmc: use new core function mmc_get_dma_dir 2017-04-24 21:41:52 +02:00
mmci.h mmc: core/mmci: restore pre/post_req behaviour 2017-02-13 13:20:52 +01:00
mmci_qcom_dml.c scripts/spelling.txt: add "intialization" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
mmci_qcom_dml.h mmc: mmci: Add qcom dml support to the driver. 2014-09-09 13:58:46 +02:00
moxart-mmc.c mmc: use new core function mmc_get_dma_dir 2017-04-24 21:41:52 +02:00
mtk-sd.c mmc: mediatek: Fixed size in dma_free_coherent 2017-06-20 10:30:31 +02:00
mvsdio.c mmc: use new core function mmc_get_dma_dir 2017-04-24 21:41:52 +02:00
mvsdio.h mmc: SDIO driver for Marvell SoCs 2009-03-24 21:30:03 +01:00
mxcmmc.c mmc: host: use the defined function to check whether card is removable 2016-07-25 10:34:21 +02:00
mxs-mmc.c mmc: mxs-mmc: Implement CMD23 support 2017-02-13 13:20:27 +01:00
of_mmc_spi.c mmc: of_mmc_spi: fix unused warning 2016-03-17 14:54:40 +01:00
omap.c mmc: omap: Don't use mmc_card_present() when validating for inserted card 2017-02-13 13:20:23 +01:00
omap_hsmmc.c mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get regulators 2017-06-20 10:30:41 +02:00
pxamci.c mmc: core: Delete bounce buffer Kconfig option 2017-06-20 10:30:17 +02:00
pxamci.h
renesas_sdhi.h mmc: renesas-sdhi: improve checkpatch cleanness 2017-06-20 10:30:50 +02:00
renesas_sdhi_core.c mmc: renesas-sdhi: improve checkpatch cleanness 2017-06-20 10:30:50 +02:00
renesas_sdhi_sys_dmac.c mmc: renesas-sdhi: improve checkpatch cleanness 2017-06-20 10:30:50 +02:00
rtsx_pci_sdmmc.c mmc: use empty initializer list to zero-clear structures 2017-02-13 13:19:54 +01:00
rtsx_usb_sdmmc.c mmc: use empty initializer list to zero-clear structures 2017-02-13 13:19:54 +01:00
s3cmci.c mmc: host: s3cmci: allow probing from device tree 2017-04-24 21:41:59 +02:00
s3cmci.h mmc: s3cmci: Register cpufreq notifier only on S3C24xx 2016-07-25 10:34:46 +02:00
sdhci-acpi.c mmc: core: Remove MMC_CAP2_HC_ERASE_SZ 2017-06-20 10:30:48 +02:00
sdhci-bcm-kona.c mmc: sdhci-bcm-kona: fix error return code in sdhci_bcm_kona_probe() 2016-09-26 21:31:08 +02:00
sdhci-brcmstb.c mmc: core: Remove MMC_CAP2_HC_ERASE_SZ 2017-06-20 10:30:48 +02:00
sdhci-cadence.c mmc: sdhci-cadence: add parsing sdhci properties 2017-04-24 21:42:19 +02:00
sdhci-cns3xxx.c mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS 2016-07-29 11:29:04 +02:00
sdhci-dove.c mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS 2016-07-29 11:29:04 +02:00
sdhci-esdhc-imx.c mmc: sdhci-esdhc-imx: Remove the ENGcm07207 workaround 2017-06-20 10:30:34 +02:00
sdhci-esdhc.h mmc: sdhci-esdhc: Add SDHCI_QUIRK_32BIT_DMA_ADDR 2017-06-20 10:30:32 +02:00
sdhci-iproc.c mmc: sdhci-iproc: suppress spurious interrupt with Multiblock read 2017-05-22 18:18:04 +02:00
sdhci-msm.c mmc: sdhci: Do not use spin lock in set_ios paths 2017-04-24 21:41:29 +02:00
sdhci-of-arasan.c mmc: sdhci-of-arasan: Trivial print fix 2017-06-20 10:30:07 +02:00
sdhci-of-at91.c mmc: sdhci: Do not use spin lock in set_ios paths 2017-04-24 21:41:29 +02:00
sdhci-of-esdhc.c mmc: sdhci-of-esdhc: limit SD clock for ls1012a/ls1046a 2017-04-28 14:53:13 +02:00
sdhci-of-hlwd.c mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS 2016-07-29 11:29:04 +02:00
sdhci-pci-core.c MMC core: 2017-07-04 11:11:56 -07:00
sdhci-pci-data.c mmc: sdhci-pci: Use ACPI DSM to get driver strength for some Intel devices 2017-04-24 21:41:28 +02:00
sdhci-pci-o2micro.c mmc: sdhci-pci: Let suspend/resume callbacks replace default callbacks 2017-04-24 21:41:38 +02:00
sdhci-pci-o2micro.h mmc: sdhci-pci: Make sdhci_pci_o2_fujin2_pci_init() static 2015-10-26 16:00:05 +01:00
sdhci-pci.h mmc: sdhci-pci: Add support for Intel CNP 2017-06-20 10:30:38 +02:00
sdhci-pic32.c mmc: sdhci-pic32: remove owner assignment 2016-05-02 10:33:25 +02:00
sdhci-pltfm.c mmc: sdhci: Let drivers decide whether to use mmc_retune_needed() with pm 2017-04-24 21:41:26 +02:00
sdhci-pltfm.h mmc: sdhci: remove unneeded (void *) casts in sdhci_(pltfm_)priv() 2016-11-29 09:01:00 +01:00
sdhci-pxav2.c mmc: sdhci-pxav2: remove unnecessary platform_set_drvdata() call 2017-04-24 21:41:20 +02:00
sdhci-pxav3.c mmc: sdhci: Do not use spin lock in set_ios paths 2017-04-24 21:41:29 +02:00
sdhci-s3c.c mmc: sdhci: Do not use spin lock in set_ios paths 2017-04-24 21:41:29 +02:00
sdhci-sirf.c mmc: sdhci: Let drivers decide whether to use mmc_retune_needed() with pm 2017-04-24 21:41:26 +02:00
sdhci-spear.c mmc: sdhci: Let drivers decide whether to use mmc_retune_needed() with pm 2017-04-24 21:41:26 +02:00
sdhci-st.c mmc: sdhci: Let drivers decide whether to use mmc_retune_needed() with pm 2017-04-24 21:41:26 +02:00
sdhci-tegra.c mmc: tegra: Add Tegra186 support 2017-04-24 21:41:18 +02:00
sdhci-xenon-phy.c mmc: sdhci-xenon: kill xenon_clean_phy() 2017-05-19 08:58:21 +02:00
sdhci-xenon.c mmc: sdhci-xenon: kill xenon_clean_phy() 2017-05-19 08:58:21 +02:00
sdhci-xenon.h mmc: sdhci-xenon: kill xenon_clean_phy() 2017-05-19 08:58:21 +02:00
sdhci.c mmc: sdhci: Control the delay between tuning commands 2017-04-24 21:42:27 +02:00
sdhci.h mmc: sdhci: Control the delay between tuning commands 2017-04-24 21:42:27 +02:00
sdhci_f_sdh30.c mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS 2016-07-29 11:29:04 +02:00
sdricoh_cs.c mmc: sdricoh_cs: remove redundant check if len is non-zero 2017-06-20 10:30:08 +02:00
sh_mmcif.c mmc: sh_mmcif: Remove unused clk_ctrl2_present from the platform data 2017-02-13 13:19:58 +01:00
sunxi-mmc.c mmc: use new core function mmc_get_dma_dir 2017-04-24 21:41:52 +02:00
tifm_sd.c mmc: Convert pr_warning to pr_warn 2014-09-24 10:13:09 +02:00
tmio_mmc.c mmc: tmio: improve checkpatch cleanness 2017-06-20 10:30:50 +02:00
tmio_mmc.h mmc: tmio: improve checkpatch cleanness 2017-06-20 10:30:50 +02:00
tmio_mmc_core.c mmc: tmio: improve checkpatch cleanness 2017-06-20 10:30:50 +02:00
toshsd.c PM / Runtime: Move ignore_children flag under CONFIG_PM 2016-04-22 01:32:37 +02:00
toshsd.h mmc: add Toshiba PCI SD controller driver 2014-11-26 14:30:58 +01:00
usdhi6rol0.c mmc: usdhi6rol0: add pinctrl to set pin drive strength 2016-05-02 10:36:06 +02:00
ushc.c mmc: ushc: fix NULL-deref at probe 2017-03-16 15:31:27 +01:00
via-sdmmc.c mmc: host: Include interrupt.h in mmc host drivers that depends on it 2017-02-13 13:20:01 +01:00
vub300.c mmc: vub3000: add missing USB-descriptor endianness conversions 2017-06-20 10:30:09 +02:00
wbsd.c mm, tree wide: replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic 2017-07-12 16:26:03 -07:00
wbsd.h
wmt-sdmmc.c mmc: host: Include interrupt.h in mmc host drivers that depends on it 2017-02-13 13:20:01 +01:00