Revision fcf8a1e483490cd249df4e02d5425636c3f43c86 authored by Waiman Long on 12 July 2019, 03:56:38 UTC, committed by Linus Torvalds on 12 July 2019, 18:05:44 UTC
There are concerns about memory leaks from extensive use of memory cgroups
as each memory cgroup creates its own set of kmem caches.  There is a
possiblity that the memcg kmem caches may remain even after the memory
cgroups have been offlined.  Therefore, it will be useful to show the
status of each of memcg kmem caches.

This patch introduces a new <debugfs>/memcg_slabinfo file which is
somewhat similar to /proc/slabinfo in format, but lists only information
about kmem caches that have child memcg kmem caches.  Information
available in /proc/slabinfo are not repeated in memcg_slabinfo.

A portion of a sample output of the file was:

  # <name> <css_id[:dead]> <active_objs> <num_objs> <active_slabs> <num_slabs>
  rpc_inode_cache   root          13     51      1      1
  rpc_inode_cache     48           0      0      0      0
  fat_inode_cache   root           1     45      1      1
  fat_inode_cache     41           2     45      1      1
  xfs_inode         root         770    816     24     24
  xfs_inode           92          22     34      1      1
  xfs_inode           88:dead      1     34      1      1
  xfs_inode           89:dead     23     34      1      1
  xfs_inode           85           4     34      1      1
  xfs_inode           84           9     34      1      1

The css id of the memcg is also listed. If a memcg is not online,
the tag ":dead" will be attached as shown above.

[longman@redhat.com: memcg: add ":deact" tag for reparented kmem caches in memcg_slabinfo]
  Link: http://lkml.kernel.org/r/20190621173005.31514-1-longman@redhat.com
[longman@redhat.com: set the flag in the common code as suggested by Roman]
  Link: http://lkml.kernel.org/r/20190627184324.5875-1-longman@redhat.com
Link: http://lkml.kernel.org/r/20190619171621.26209-1-longman@redhat.com
Signed-off-by: Waiman Long <longman@redhat.com>
Suggested-by: Shakeel Butt <shakeelb@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Roman Gushchin <guro@fb.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent fb2f2b0
Raw File
Kconfig
# SPDX-License-Identifier: GPL-2.0-only
config ADFS_FS
	tristate "ADFS file system support"
	depends on BLOCK
	help
	  The Acorn Disc Filing System is the standard file system of the
	  RiscOS operating system which runs on Acorn's ARM-based Risc PC
	  systems and the Acorn Archimedes range of machines. If you say Y
	  here, Linux will be able to read from ADFS partitions on hard drives
	  and from ADFS-formatted floppy discs. If you also want to be able to
	  write to those devices, say Y to "ADFS write support" below.

	  The ADFS partition should be the first partition (i.e.,
	  /dev/[hs]d?1) on each of your drives. Please read the file
	  <file:Documentation/filesystems/adfs.txt> for further details.

	  To compile this code as a module, choose M here: the module will be
	  called adfs.

	  If unsure, say N.

config ADFS_FS_RW
	bool "ADFS write support (DANGEROUS)"
	depends on ADFS_FS
	help
	  If you say Y here, you will be able to write to ADFS partitions on
	  hard drives and ADFS-formatted floppy disks. This is experimental
	  codes, so if you're unsure, say N.
back to top