Skip to content

Commit d71e53c

Browse files
Alexey Dobriyantorvalds
Alexey Dobriyan
authored andcommitted
mm: shuffle GFP_* flags
GFP_KERNEL is one of the most used constant but on archs like arm with fixed length instruction some constants are more equal than the others. Constants with tightly packed bits can be injected directly into instruction stream: 0: e3a00d33 mov r0, #3264 ; 0xcc0 Others require multiple instructions or even loading out of instruction stream: 0: e3a000c0 mov r0, #192 ; 0xc0 4: e3400060 movt r0, #96 ; 0x60 Shuffle GFP_* flags so that GFP_KERNEL/GFP_ATOMIC + __GFP_ZERO bits are close to each other. Savings on arm configs are ~0.1%. Link: http://lkml.kernel.org/r/20190109201838.GA9140@avx2 Signed-off-by: Alexey Dobriyan <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e9f5987 commit d71e53c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

include/linux/gfp.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ struct vm_area_struct;
2424
#define ___GFP_HIGH 0x20u
2525
#define ___GFP_IO 0x40u
2626
#define ___GFP_FS 0x80u
27-
#define ___GFP_WRITE 0x100u
28-
#define ___GFP_NOWARN 0x200u
29-
#define ___GFP_RETRY_MAYFAIL 0x400u
30-
#define ___GFP_NOFAIL 0x800u
31-
#define ___GFP_NORETRY 0x1000u
32-
#define ___GFP_MEMALLOC 0x2000u
33-
#define ___GFP_COMP 0x4000u
34-
#define ___GFP_ZERO 0x8000u
35-
#define ___GFP_NOMEMALLOC 0x10000u
36-
#define ___GFP_HARDWALL 0x20000u
37-
#define ___GFP_THISNODE 0x40000u
38-
#define ___GFP_ATOMIC 0x80000u
39-
#define ___GFP_ACCOUNT 0x100000u
40-
#define ___GFP_DIRECT_RECLAIM 0x200000u
41-
#define ___GFP_KSWAPD_RECLAIM 0x400000u
27+
#define ___GFP_ZERO 0x100u
28+
#define ___GFP_ATOMIC 0x200u
29+
#define ___GFP_DIRECT_RECLAIM 0x400u
30+
#define ___GFP_KSWAPD_RECLAIM 0x800u
31+
#define ___GFP_WRITE 0x1000u
32+
#define ___GFP_NOWARN 0x2000u
33+
#define ___GFP_RETRY_MAYFAIL 0x4000u
34+
#define ___GFP_NOFAIL 0x8000u
35+
#define ___GFP_NORETRY 0x10000u
36+
#define ___GFP_MEMALLOC 0x20000u
37+
#define ___GFP_COMP 0x40000u
38+
#define ___GFP_NOMEMALLOC 0x80000u
39+
#define ___GFP_HARDWALL 0x100000u
40+
#define ___GFP_THISNODE 0x200000u
41+
#define ___GFP_ACCOUNT 0x400000u
4242
#ifdef CONFIG_LOCKDEP
4343
#define ___GFP_NOLOCKDEP 0x800000u
4444
#else

0 commit comments

Comments
 (0)