Skip to content

get rid of superfluous __GFP_REPORT

Michal Hocko dm-devel git linux-arch linux-crypto linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest19 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19tree wide: get rid of __GFP_REPEAT for order-0 allocations part Iarch/alpha/include/asm/pgalloc.h arch/arm/include/asm/pgalloc.h arch/avr32/include/asm/pgalloc.h +23 more+46 -512 replies
2/19x86: get rid of superfluous __GFP_REPEATarch/x86/kernel/espfix_64.c arch/x86/mm/pgtable.c+2 -20 replies
3/19x86/efi: get rid of superfluous __GFP_REPEATarch/x86/platform/efi/efi_64.c+1 -11 reply
4/19arm: get rid of superfluous __GFP_REPEATarch/arm/include/asm/pgalloc.h arch/arm/mm/pgd.c+2 -20 replies
5/19arm64: get rid of superfluous __GFP_REPEATarch/arm64/include/asm/pgalloc.h+1 -11 reply
6/19arc: get rid of superfluous __GFP_REPEATarch/arc/include/asm/pgalloc.h+2 -21 reply
7/19mips: get rid of superfluous __GFP_REPEATarch/mips/include/asm/pgalloc.h+3 -30 replies
8/19nios2: get rid of superfluous __GFP_REPEATarch/nios2/include/asm/pgalloc.h+2 -30 replies
9/19parisc: get rid of superfluous __GFP_REPEATarch/parisc/include/asm/pgalloc.h+1 -20 replies
10/19score: get rid of superfluous __GFP_REPEATarch/score/include/asm/pgalloc.h+2 -30 replies
11/19powerpc: get rid of superfluous __GFP_REPEATarch/powerpc/include/asm/pgalloc-64.h arch/powerpc/mm/hugetlbpage.c+4 -40 replies
12/19sparc: get rid of superfluous __GFP_REPEATarch/sparc/include/asm/pgalloc_64.h+2 -40 replies
13/19s390: get rid of superfluous __GFP_REPEATarch/s390/kernel/process.c arch/s390/mm/pgalloc.c+2 -22 replies
14/19sh: get rid of superfluous __GFP_REPEATarch/sh/mm/pgtable.c+1 -10 replies
15/19tile: get rid of superfluous __GFP_REPEATarch/tile/mm/pgtable.c+1 -10 replies
16/19unicore32: get rid of superfluous __GFP_REPEATarch/unicore32/include/asm/pgalloc.h+1 -10 replies
17/19dm: get rid of superfluous gfp flagsdrivers/md/dm-ioctl.c+1 -17 replies
18/19crypto: get rid of superfluous __GFP_REPEATcrypto/lzo.c+1 -15 replies
19/19jbd2: get rid of superfluous __GFP_REPEATfs/jbd2/journal.c+7 -250 replies

Reviews trailers per patch

4 of 19 patches have a Reviewed-by or Acked-by.

PatchHeiko CarstensVineet GuptaWill DeaconMatt Fleming
1/19
2/19
3/19R-b
4/19
5/19A-b
6/19A-b
7/19
8/19
9/19
10/19
11/19
12/19
13/19A-b
14/19
15/19
16/19
17/19
18/19
19/19

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/19] get rid of superfluous __GFP_REPORT

Hi,
this is the second version of the patchset previously sent [1]

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. One thought was to rename it to __GFP_BEST_EFFORT which would behave consistently for all orders and guarantee that the allocation would try as long as it seem feasible or fail eventually. !costly request would then finally get a request context which neiter fails too early (GFP_NORETRY) nor endlessly loops in the allocator for ever (default behavior). Costly high order requests would keep the current semantic.

$ git grep __GFP_REPEAT next/master | wc -l
111
$ git grep __GFP_REPEAT | wc -l
35

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.

I am also interested whether this makes sense in general.

[1] http://lkml.kernel.org/r/[email protected]

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>