linux/include
Shakeel Butt f745c6f5fe fs, mm: account buffer_head to kmemcg
The buffer_head can consume a significant amount of system memory and is
directly related to the amount of page cache.  In our production
environment we have observed that a lot of machines are spending a
significant amount of memory as buffer_head and can not be left as
system memory overhead.

Charging buffer_head is not as simple as adding __GFP_ACCOUNT to the
allocation.  The buffer_heads can be allocated in a memcg different from
the memcg of the page for which buffer_heads are being allocated.  One
concrete example is memory reclaim.  The reclaim can trigger I/O of
pages of any memcg on the system.  So, the right way to charge
buffer_head is to extract the memcg from the page for which buffer_heads
are being allocated and then use targeted memcg charging API.

[shakeelb@google.com: use __GFP_ACCOUNT for directed memcg charging]
  Link: http://lkml.kernel.org/r/20180702220208.213380-1-shakeelb@google.com
Link: http://lkml.kernel.org/r/20180627191250.209150-3-shakeelb@google.com
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-08-17 16:20:30 -07:00
..
acpi Merge branches 'acpi-x86', 'acpi-bus', 'acpi-ec' and 'acpi-apei' 2018-08-14 10:06:45 +02:00
asm-generic mm: provide a fallback for PAGE_KERNEL_EXEC for architectures 2018-08-17 16:20:29 -07:00
clocksource
crypto crypto: scatterwalk - remove scatterwalk_samebuf() 2018-08-03 18:06:04 +08:00
drm drm pull for 4.19-rc1 2018-08-15 17:39:07 -07:00
dt-bindings - xgene : potential null pointer fix 2018-08-16 10:16:08 -07:00
keys
kvm
linux fs, mm: account buffer_head to kmemcg 2018-08-17 16:20:30 -07:00
math-emu
media media: vsp1: Support Interlaced display pipelines 2018-08-03 16:02:27 -04:00
memory
misc
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-08-15 15:04:25 -07:00
pcmcia
ras
rdma
scsi SCSI misc on 20180815 2018-08-15 22:06:26 -07:00
soc
sound ASoC: Updates for v4.19 2018-08-13 12:12:31 +02:00
target scsi: target: add session removal function 2018-08-02 15:29:31 -04:00
trace Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-08-15 15:04:25 -07:00
uapi pci-v4.19-changes 2018-08-16 09:21:54 -07:00
video
xen