mm/vmscan.c: do not allocate duplicate stack variables in shrink_page_list()
authorKirill Tkhai <ktkhai@virtuozzo.com>
Tue, 5 Mar 2019 23:48:15 +0000 (15:48 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 6 Mar 2019 05:07:19 +0000 (21:07 -0800)
commit060f005f074791ec15e3ea111a0b0cac28abab06
tree8f68427c8d8d5c4b1da2159d6da6a7142ba03d35
parent2cee57d1b088778bb8cb35f36076cbe492984a09
mm/vmscan.c: do not allocate duplicate stack variables in shrink_page_list()

On path shrink_inactive_list() ---> shrink_page_list() we allocate stack
variables for the statistics twice.  This is completely useless, and
this just consumes stack much more, then we really need.

The patch kills duplicate stack variables from shrink_page_list(), and
this reduce stack usage and object file size significantly:

Stack usage:
  Before: vmscan.c:1122:22:shrink_page_list 648 static
  After:  vmscan.c:1122:22:shrink_page_list 616 static

Size of vmscan.o:
           text    data     bss     dec     hex filename
  Before: 56866    4720     128   61714    f112 mm/vmscan.o
  After:  56770    4720     128   61618    f0b2 mm/vmscan.o

Link: http://lkml.kernel.org/r/154894900030.5211.12104993874109647641.stgit@localhost.localdomain
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c