linux-stable/include
Johannes Weiner e27be240df mm: memcg: make sure memory.events is uptodate when waking pollers
Commit a983b5ebee ("mm: memcontrol: fix excessive complexity in
memory.stat reporting") added per-cpu drift to all memory cgroup stats
and events shown in memory.stat and memory.events.

For memory.stat this is acceptable.  But memory.events issues file
notifications, and somebody polling the file for changes will be
confused when the counters in it are unchanged after a wakeup.

Luckily, the events in memory.events - MEMCG_LOW, MEMCG_HIGH, MEMCG_MAX,
MEMCG_OOM - are sufficiently rare and high-level that we don't need
per-cpu buffering for them: MEMCG_HIGH and MEMCG_MAX would be the most
frequent, but they're counting invocations of reclaim, which is a
complex operation that touches many shared cachelines.

This splits memory.events from the generic VM events and tracks them in
their own, unbuffered atomic counters.  That's also cleaner, as it
eliminates the ugly enum nesting of VM and cgroup events.

[hannes@cmpxchg.org: "array subscript is above array bounds"]
  Link: http://lkml.kernel.org/r/20180406155441.GA20806@cmpxchg.org
Link: http://lkml.kernel.org/r/20180405175507.GA24817@cmpxchg.org
Fixes: a983b5ebee ("mm: memcontrol: fix excessive complexity in memory.stat reporting")
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: Tejun Heo <tj@kernel.org>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-11 10:28:31 -07:00
..
acpi pci-v4.17-changes 2018-04-06 18:31:06 -07:00
asm-generic ARM: 2018-04-09 11:42:31 -07:00
clocksource ARM: SoC platform updates for 4.17 2018-04-05 21:21:08 -07:00
crypto
drm
dt-bindings ARM: SoC driver updates for 4.17 2018-04-05 21:29:35 -07:00
keys
kvm
linux mm: memcg: make sure memory.events is uptodate when waking pollers 2018-04-11 10:28:31 -07:00
math-emu
media media updates for v4.17-rc1 2018-04-10 10:10:30 -07:00
memory
misc
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-04-09 17:04:10 -07:00
pcmcia
ras
rdma Merge candidates for 4.17 merge window 2018-04-06 17:35:43 -07:00
scsi SCSI for-linus on 20180404 2018-04-05 15:05:53 -07:00
soc ARM: SoC driver updates for 4.17 2018-04-05 21:29:35 -07:00
sound sound updates for 4.17-rc1 2018-04-05 10:42:07 -07:00
target
trace mm, vmscan, tracing: use pointer to reclaim_stat struct in trace event 2018-04-11 10:28:30 -07:00
uapi ARM: 2018-04-09 11:42:31 -07:00
video
xen