Revision 4df910620bebb5cfe234af16ac8f6474b60215fd authored by Feng Tang on 25 November 2020, 05:22:21 UTC, committed by Linus Torvalds on 26 November 2020, 17:35:49 UTC
0day reported one -22.7% regression for will-it-scale page_fault2
case [1] on a 4 sockets 144 CPU platform, and bisected to it to be
caused by Waiman's optimization (commit bd0b230fe1) of saving one
'struct page_counter' space for 'struct mem_cgroup'.

Initially we thought it was due to the cache alignment change introduced
by the patch, but further debug shows that it is due to some hot data
members ('vmstats_local', 'vmstats_percpu', 'vmstats') sit in 2 adjacent
cacheline (2N and 2N+1 cacheline), and when adjacent cache line prefetch
is enabled, it triggers an "extended level" of cache false sharing for
2 adjacent cache lines.

So exchange the 2 member blocks, while keeping mostly the original
cache alignment, which can restore and even enhance the performance,
and save 64 bytes of space for 'struct mem_cgroup' (from 2880 to 2816,
with 0day's default RHEL-8.3 kernel config)

[1]. https://lore.kernel.org/lkml/20201102091543.GM31092@shao2-debian/

Fixes: bd0b230fe145 ("mm/memcg: unify swap and memsw page counters")
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent fa02fcd
History
File Mode Size
6lowpan_i.h -rw-r--r-- 989 bytes
Kconfig -rw-r--r-- 2.6 KB
Makefile -rw-r--r-- 866 bytes
core.c -rw-r--r-- 4.0 KB
debugfs.c -rw-r--r-- 6.7 KB
iphc.c -rw-r--r-- 36.7 KB
ndisc.c -rw-r--r-- 6.3 KB
nhc.c -rw-r--r-- 5.1 KB
nhc.h -rw-r--r-- 4.3 KB
nhc_dest.c -rw-r--r-- 650 bytes
nhc_fragment.c -rw-r--r-- 658 bytes
nhc_ghc_ext_dest.c -rw-r--r-- 670 bytes
nhc_ghc_ext_frag.c -rw-r--r-- 682 bytes
nhc_ghc_ext_hop.c -rw-r--r-- 658 bytes
nhc_ghc_ext_route.c -rw-r--r-- 675 bytes
nhc_ghc_icmpv6.c -rw-r--r-- 613 bytes
nhc_ghc_udp.c -rw-r--r-- 571 bytes
nhc_hop.c -rw-r--r-- 633 bytes
nhc_ipv6.c -rw-r--r-- 597 bytes
nhc_mobility.c -rw-r--r-- 658 bytes
nhc_routing.c -rw-r--r-- 645 bytes
nhc_udp.c -rw-r--r-- 5.5 KB

back to top