linux/include
Johannes Weiner 55779ec759 mm: fix vm-scalability regression in cgroup-aware workingset code
Commit 23047a96d7 ("mm: workingset: per-cgroup cache thrash
detection") added a page->mem_cgroup lookup to the cache eviction,
refault, and activation paths, as well as locking to the activation
path, and the vm-scalability tests showed a regression of -23%.

While the test in question is an artificial worst-case scenario that
doesn't occur in real workloads - reading two sparse files in parallel
at full CPU speed just to hammer the LRU paths - there is still some
optimizations that can be done in those paths.

Inline the lookup functions to eliminate calls.  Also, page->mem_cgroup
doesn't need to be stabilized when counting an activation; we merely
need to hold the RCU lock to prevent the memcg from being freed.

This cuts down on overhead quite a bit:

23047a96d7 063f6715e77a7be5770d6081fe
---------------- --------------------------
         %stddev     %change         %stddev
             \          |                \
  21621405 +- 0%     +11.3%   24069657 +- 2%  vm-scalability.throughput

[linux@roeck-us.net: drop unnecessary include file]
[hannes@cmpxchg.org: add WARN_ON_ONCE()s]
  Link: http://lkml.kernel.org/r/20160707194024.GA26580@cmpxchg.org
Link: http://lkml.kernel.org/r/20160624175101.GA3024@cmpxchg.org
Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-07-28 16:07:41 -07:00
..
acpi Merge branches 'acpi-processor', 'acpi-cppc', 'acpi-apei' and 'acpi-sleep' 2016-07-25 13:42:25 +02:00
asm-generic Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
clocksource
crypto A number of improvements for the /dev/random driver; the most 2016-07-27 15:11:55 -07:00
drm Merge branch 'drm-vmwgfx-fixes' of git://people.freedesktop.org/~syeh/repos_linux into drm-fixes 2016-07-15 13:51:55 +10:00
dt-bindings
keys
kvm
linux mm: fix vm-scalability regression in cgroup-aware workingset code 2016-07-28 16:07:41 -07:00
math-emu
media [media] doc-rst: add some needed escape codes 2016-07-23 08:05:02 -03:00
memory
misc
net net_sched: get rid of struct tcf_common 2016-07-25 21:49:20 -07:00
pcmcia
ras
rdma
rxrpc
scsi fcoe: implement FIP VLAN responder 2016-07-20 19:49:41 -04:00
soc
sound
target
trace Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
uapi media updates for v4.8-rc1 2016-07-27 14:58:31 -07:00
video
xen xen: add static initialization of steal_clock op to xen_time_ops 2016-07-26 14:07:06 +01:00
Kbuild