]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/page_owner.c: reduce page_owner structure size
authorAyush Mittal <ayush.m@samsung.com>
Thu, 16 Nov 2017 01:34:30 +0000 (17:34 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Nov 2017 02:21:03 +0000 (18:21 -0800)
Maximum page order can be at max 10 which can be accomodated in short
data type(2 bytes).  last_migrate_reason is defined as enum type whose
values can be accomodated in short data type (2 bytes).

Total structure size is currently 16 bytes but after changing structure
size it goes to 12 bytes.

Vlastimil said:
 "Looks like it works, so why not.
  Before:
  [    0.001000] allocated 50331648 bytes of page_ext
  After:
  [    0.001000] allocated 41943040 bytes of page_ext"

Link: http://lkml.kernel.org/r/1507623917-37991-1-git-send-email-ayush.m@samsung.com
Signed-off-by: Ayush Mittal <ayush.m@samsung.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Vinayak Menon <vinmenon@codeaurora.org>
Cc: Amit Sahrawat <a.sahrawat@samsung.com>
Cc: Vaneet Narang <v.narang@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_owner.c

index 4f44b95b9d1e53cb7a8b294f339afea90b885e93..8592543a0f1599b1ab0c95620ae8ad45e67b7760 100644 (file)
@@ -20,9 +20,9 @@
 #define PAGE_OWNER_STACK_DEPTH (16)
 
 struct page_owner {
-       unsigned int order;
+       unsigned short order;
+       short last_migrate_reason;
        gfp_t gfp_mask;
-       int last_migrate_reason;
        depot_stack_handle_t handle;
 };