linux/drivers/net/ethernet
Mel Gorman d0164adc89 mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd
__GFP_WAIT has been used to identify atomic context in callers that hold
spinlocks or are in interrupts.  They are expected to be high priority and
have access one of two watermarks lower than "min" which can be referred
to as the "atomic reserve".  __GFP_HIGH users get access to the first
lower watermark and can be called the "high priority reserve".

Over time, callers had a requirement to not block when fallback options
were available.  Some have abused __GFP_WAIT leading to a situation where
an optimisitic allocation with a fallback option can access atomic
reserves.

This patch uses __GFP_ATOMIC to identify callers that are truely atomic,
cannot sleep and have no alternative.  High priority users continue to use
__GFP_HIGH.  __GFP_DIRECT_RECLAIM identifies callers that can sleep and
are willing to enter direct reclaim.  __GFP_KSWAPD_RECLAIM to identify
callers that want to wake kswapd for background reclaim.  __GFP_WAIT is
redefined as a caller that is willing to enter direct reclaim and wake
kswapd for background reclaim.

This patch then converts a number of sites

o __GFP_ATOMIC is used by callers that are high priority and have memory
  pools for those requests. GFP_ATOMIC uses this flag.

o Callers that have a limited mempool to guarantee forward progress clear
  __GFP_DIRECT_RECLAIM but keep __GFP_KSWAPD_RECLAIM. bio allocations fall
  into this category where kswapd will still be woken but atomic reserves
  are not used as there is a one-entry mempool to guarantee progress.

o Callers that are checking if they are non-blocking should use the
  helper gfpflags_allow_blocking() where possible. This is because
  checking for __GFP_WAIT as was done historically now can trigger false
  positives. Some exceptions like dm-crypt.c exist where the code intent
  is clearer if __GFP_DIRECT_RECLAIM is used instead of the helper due to
  flag manipulations.

o Callers that built their own GFP flags instead of starting with GFP_KERNEL
  and friends now also need to specify __GFP_KSWAPD_RECLAIM.

The first key hazard to watch out for is callers that removed __GFP_WAIT
and was depending on access to atomic reserves for inconspicuous reasons.
In some cases it may be appropriate for them to use __GFP_HIGH.

The second key hazard is callers that assembled their own combination of
GFP flags instead of starting with something like GFP_KERNEL.  They may
now wish to specify __GFP_KSWAPD_RECLAIM.  It's almost certainly harmless
if it's missed in most cases as other activity will wake kswapd.

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Vitaly Wool <vitalywool@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-06 17:50:42 -08:00
..
3com
8390 net: mac8390: Allow modular build 2015-09-29 21:11:12 -07:00
adaptec
adi
aeroflex drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
agere
allwinner net: sun4i-emac: Properly free resources on probe failure and remove 2015-10-21 19:47:45 -07:00
alteon
altera
amd Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-11-01 00:15:30 -04:00
apm drivers: net: xgene: Add support RGMII TX/RX delay configuration 2015-10-30 12:21:51 +09:00
apple net: macmace: Allow modular build 2015-09-29 21:11:13 -07:00
arc
atheros drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
broadcom mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd 2015-11-06 17:50:42 -08:00
brocade bna: fix error handling 2015-09-29 13:49:53 -07:00
cadence
calxeda
cavium Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-11-01 00:15:30 -04:00
chelsio driver core update for 4.4-rc1 2015-11-04 21:50:37 -08:00
cirrus
cisco enic: assign affinity hint to interrupts 2015-11-02 15:08:00 -05:00
davicom
dec drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
dlink
emulex Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-10-20 06:08:27 -07:00
ezchip
faraday
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-11-03 13:41:45 -05:00
fujitsu
hisilicon net: hisilicon: Remove .owner assignment from platform_driver 2015-11-01 16:03:41 -05:00
hp
i825xx
ibm drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
icplus
intel Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-10-24 06:54:12 -07:00
marvell Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-11-01 00:15:30 -04:00
mellanox net/mlx5e: Fix LSO vlan insertion 2015-11-03 10:41:51 -05:00
micrel Merge remote-tracking branches 'spi/topic/omap-100k', 'spi/topic/omap-uwire', 'spi/topic/owner', 'spi/topic/pxa' and 'spi/topic/pxa2xx' into spi-next 2015-11-04 11:02:12 +00:00
microchip spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
moxa
myricom
natsemi
neterion drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
nuvoton
nvidia forcedeth: fix unilateral interrupt disabling in netpoll path 2015-10-27 19:45:23 -07:00
nxp net: lpc_eth: fix warnings caused by enabling unprepared clock 2015-10-05 03:41:12 -07:00
octeon drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
oki-semi drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
packetengines
pasemi
qlogic qede: Add basic ethtool support 2015-10-27 19:34:54 -07:00
qualcomm spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
rdc
realtek drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
renesas sh_eth: use DMA barriers 2015-11-03 15:02:26 -05:00
rocker rocker: remove nowait from switchdev callbacks. 2015-10-15 06:09:51 -07:00
samsung
seeq
sfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-11-04 09:41:05 -08:00
sgi
silan
sis
smsc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-11-03 13:41:45 -05:00
stmicro Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-11-03 13:41:45 -05:00
sun drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
synopsys
tehuti drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-11-01 00:15:30 -04:00
tile
toshiba
tundra
via via-rhine: fix VLAN receive handling regression. 2015-10-16 00:55:30 -07:00
wiznet
xilinx drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c net/ethoc: support big-endian register layout 2015-09-23 15:33:15 -07:00
fealnx.c
jme.c
jme.h
Kconfig
korina.c
lantiq_etop.c
Makefile
netx-eth.c