OpenCloudOS-Kernel/drivers/gpu/drm/etnaviv
Michal Hocko 0ee931c4e3 mm: treewide: remove GFP_TEMPORARY allocation flag
GFP_TEMPORARY was introduced by commit e12ba74d8f ("Group short-lived
and reclaimable kernel allocations") along with __GFP_RECLAIMABLE.  It's
primary motivation was to allow users to tell that an allocation is
short lived and so the allocator can try to place such allocations close
together and prevent long term fragmentation.  As much as this sounds
like a reasonable semantic it becomes much less clear when to use the
highlevel GFP_TEMPORARY allocation flag.  How long is temporary? Can the
context holding that memory sleep? Can it take locks? It seems there is
no good answer for those questions.

The current implementation of GFP_TEMPORARY is basically GFP_KERNEL |
__GFP_RECLAIMABLE which in itself is tricky because basically none of
the existing caller provide a way to reclaim the allocated memory.  So
this is rather misleading and hard to evaluate for any benefits.

I have checked some random users and none of them has added the flag
with a specific justification.  I suspect most of them just copied from
other existing users and others just thought it might be a good idea to
use without any measuring.  This suggests that GFP_TEMPORARY just
motivates for cargo cult usage without any reasoning.

I believe that our gfp flags are quite complex already and especially
those with highlevel semantic should be clearly defined to prevent from
confusion and abuse.  Therefore I propose dropping GFP_TEMPORARY and
replace all existing users to simply use GFP_KERNEL.  Please note that
SLAB users with shrinkers will still get __GFP_RECLAIMABLE heuristic and
so they will be placed properly for memory fragmentation prevention.

I can see reasons we might want some gfp flag to reflect shorterm
allocations but I propose starting from a clear semantic definition and
only then add users with proper justification.

This was been brought up before LSF this year by Matthew [1] and it
turned out that GFP_TEMPORARY really doesn't have a clear semantic.  It
seems to be a heuristic without any measured advantage for most (if not
all) its current users.  The follow up discussion has revealed that
opinions on what might be temporary allocation differ a lot between
developers.  So rather than trying to tweak existing users into a
semantic which they haven't expected I propose to simply remove the flag
and start from scratch if we really need a semantic for short term
allocations.

[1] http://lkml.kernel.org/r/20170118054945.GD18349@bombadil.infradead.org

[akpm@linux-foundation.org: fix typo]
[akpm@linux-foundation.org: coding-style fixes]
[sfr@canb.auug.org.au: drm/i915: fix up]
  Link: http://lkml.kernel.org/r/20170816144703.378d4f4d@canb.auug.org.au
Link: http://lkml.kernel.org/r/20170728091904.14627-1-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Mel Gorman <mgorman@suse.de>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Neil Brown <neilb@suse.de>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-09-13 18:53:16 -07:00
..
Kconfig drm/etnaviv: select CMA and DMA_CMA if available 2017-08-08 15:47:24 +02:00
Makefile drm/etnaviv: move cmdbuf de-/allocation into own file 2017-02-02 10:30:15 +01:00
cmdstream.xml.h drm/etnaviv: Allow DRAW_INSTANCED commands 2016-12-02 19:30:22 +01:00
common.xml.h drm/etnaviv: update common.xml.h 2017-05-05 17:14:41 +02:00
etnaviv_buffer.c drm/etnaviv: wire up iova handling in new cmdbuf abstraction 2017-02-02 10:30:20 +01:00
etnaviv_cmd_parser.c drm/etnaviv: add new GC3000 sensitive states 2017-01-30 12:43:54 +01:00
etnaviv_cmdbuf.c drm/etnaviv: add cmdbuf suballocator 2017-02-02 10:30:37 +01:00
etnaviv_cmdbuf.h drm/etnaviv: add cmdbuf suballocator 2017-02-02 10:30:37 +01:00
etnaviv_drv.c drm/etnaviv: switch to drm_*{get,put} helpers 2017-08-08 15:47:32 +02:00
etnaviv_drv.h drm/etnaviv: Expose our reservation object when exporting a dmabuf. 2017-05-05 17:14:27 +02:00
etnaviv_dump.c mm, vmalloc: use __GFP_HIGHMEM implicitly 2017-05-08 17:15:13 -07:00
etnaviv_dump.h
etnaviv_gem.c drm/etnaviv: switch GEM allocations to __GFP_RETRY_MAYFAIL 2017-08-15 15:28:22 +02:00
etnaviv_gem.h drm/etnaviv: fix submit flags getting overwritten by BO content 2017-06-28 10:35:46 +02:00
etnaviv_gem_prime.c drm/etnaviv: switch to drm_*{get,put} helpers 2017-08-08 15:47:32 +02:00
etnaviv_gem_submit.c mm: treewide: remove GFP_TEMPORARY allocation flag 2017-09-13 18:53:16 -07:00
etnaviv_gpu.c drm/etnaviv: don't fail GPU bind when CONFIG_THERMAL isn't enabled 2017-08-15 15:28:15 +02:00
etnaviv_gpu.h drm/etnaviv: implement cooling support for new GPU cores 2017-05-05 17:14:51 +02:00
etnaviv_iommu.c drm/etnaviv: constify etnaviv_iommu_ops structures 2017-02-02 10:29:52 +01:00
etnaviv_iommu.h drm/etnaviv: implement IOMMUv2 translation 2016-09-15 15:29:43 +02:00
etnaviv_iommu_v2.c drm/etnaviv: get cmdbuf physical address through the cmdbuf abstraction 2017-02-02 10:30:27 +01:00
etnaviv_mmu.c drm: Improve drm_mm search (and fix topdown allocation) with rbtrees 2017-02-03 11:10:32 +01:00
etnaviv_mmu.h drm/etnaviv: add cmdbuf suballocator 2017-02-02 10:30:37 +01:00
state.xml.h
state_3d.xml.h drm: etnaviv: flush all GPU caches when stopping GPU 2016-03-07 15:36:56 +01:00
state_hi.xml.h drm/etnaviv: handle MMU exception in IRQ handler 2016-09-15 15:29:42 +02:00