linux_dsm_epyc7002/drivers/media/pci
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
..
b2c2 [media] pci: flexcop: Remove redundant pci_set_drvdata 2013-10-17 05:56:55 -03:00
bt8xx [media] use v4l2_get_timestamp where possible 2015-10-01 08:29:23 -03:00
cobalt [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
cx18 [media] use v4l2_get_timestamp where possible 2015-10-01 08:29:23 -03:00
cx88 [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
cx23885 [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
cx25821 [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
ddbridge [media] ddbridge: Do not free_irq() if request_irq() failed 2015-06-09 19:40:33 -03:00
dm1105 [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
dt3155 [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
ivtv [media] ivtv: Convert to get_user_pages_unlocked() 2015-10-20 15:59:01 -02:00
mantis [media] mantis: Fix error handling in mantis_dma_init() 2015-08-19 07:04:55 -03:00
meye [media] meye: embed video_device 2015-04-02 23:35:01 -03:00
netup_unidvb media updates for v4.4-rc1 2015-11-05 12:05:15 -08:00
ngene [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
pluto2 [media] media_tree: Fix spelling errors 2013-12-09 14:50:50 -02:00
pt1 [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
pt3 [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
saa7134 [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
saa7146 [media] saa7146: embed video_device 2015-04-02 23:29:01 -03:00
saa7164 [media] saa7164: video and vbi ports share the same input/tuner/std 2015-10-01 08:26:53 -03:00
smipcie [media] SMI PCIe IR driver for DVBSky cards 2015-07-06 08:26:16 -03:00
solo6x10 mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd 2015-11-06 17:50:42 -08:00
sta2x11 [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
ttpci [media] dvb: get rid of enum dmx_success 2015-10-06 19:53:02 -03:00
tw68 mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd 2015-11-06 17:50:42 -08:00
zoran [media] zoran: Use monotonic time 2015-08-16 13:29:31 -03:00
Kconfig [media] netup_unidvb: NetUP Universal DVB-S/S2/T/T2/C PCI-E card driver 2015-08-11 15:16:40 -03:00
Makefile [media] netup_unidvb: NetUP Universal DVB-S/S2/T/T2/C PCI-E card driver 2015-08-11 15:16:40 -03:00