mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 1/2] slub: rename cpuslab_flush to cpu_slab_flush
@ 2009-04-23 18:38 David Rientjes
  2009-04-23 18:38 ` [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab David Rientjes
  2009-04-23 19:39 ` [patch 1/2] slub: rename cpuslab_flush to cpu_slab_flush Pekka Enberg
  0 siblings, 2 replies; 12+ messages in thread
From: David Rientjes @ 2009-04-23 18:38 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Christoph Lameter, linux-kernel

There is already a `cpu_slabs' file to display the number of cpu slabs,
so cpuslab_flush should follow this pattern.

The first documentation of this file will be in a subsequent patch that
adds Documentation/ABI/testing/sysfs-kernel-slab, so no stable guarantee
has been made that the name of this file would not change.

Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 include/linux/slub_def.h |    2 +-
 mm/slub.c                |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -24,7 +24,7 @@ enum stat_item {
 	ALLOC_SLAB,		/* Cpu slab acquired from page allocator */
 	ALLOC_REFILL,		/* Refill cpu slab from slab freelist */
 	FREE_SLAB,		/* Slab freed to the page allocator */
-	CPUSLAB_FLUSH,		/* Abandoning of the cpu slab */
+	CPU_SLAB_FLUSH,		/* Abandoning of the cpu slab */
 	DEACTIVATE_FULL,	/* Cpu slab was full when deactivated */
 	DEACTIVATE_EMPTY,	/* Cpu slab was empty when deactivated */
 	DEACTIVATE_TO_HEAD,	/* Cpu slab was moved to the head of partials */
diff --git a/mm/slub.c b/mm/slub.c
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1438,7 +1438,7 @@ static void deactivate_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
 
 static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
 {
-	stat(c, CPUSLAB_FLUSH);
+	stat(c, CPU_SLAB_FLUSH);
 	slab_lock(c->page);
 	deactivate_slab(s, c);
 }
@@ -4220,7 +4220,7 @@ STAT_ATTR(ALLOC_FROM_PARTIAL, alloc_from_partial);
 STAT_ATTR(ALLOC_SLAB, alloc_slab);
 STAT_ATTR(ALLOC_REFILL, alloc_refill);
 STAT_ATTR(FREE_SLAB, free_slab);
-STAT_ATTR(CPUSLAB_FLUSH, cpuslab_flush);
+STAT_ATTR(CPU_SLAB_FLUSH, cpu_slab_flush);
 STAT_ATTR(DEACTIVATE_FULL, deactivate_full);
 STAT_ATTR(DEACTIVATE_EMPTY, deactivate_empty);
 STAT_ATTR(DEACTIVATE_TO_HEAD, deactivate_to_head);
@@ -4274,7 +4274,7 @@ static struct attribute *slab_attrs[] = {
 	&alloc_slab_attr.attr,
 	&alloc_refill_attr.attr,
 	&free_slab_attr.attr,
-	&cpuslab_flush_attr.attr,
+	&cpu_slab_flush_attr.attr,
 	&deactivate_full_attr.attr,
 	&deactivate_empty_attr.attr,
 	&deactivate_to_head_attr.attr,

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-23 18:38 [patch 1/2] slub: rename cpuslab_flush to cpu_slab_flush David Rientjes
@ 2009-04-23 18:38 ` David Rientjes
  2009-04-23 18:52   ` Christoph Lameter
  2009-04-23 22:26   ` [patch 2/2] " David Rientjes
  2009-04-23 19:39 ` [patch 1/2] slub: rename cpuslab_flush to cpu_slab_flush Pekka Enberg
  1 sibling, 2 replies; 12+ messages in thread
From: David Rientjes @ 2009-04-23 18:38 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Christoph Lameter, Randy Dunlap, linux-kernel

Adds documentation for the slub ABI.

This is placed in the `testing' directory since the meanings of these
files are still subject to change as slub is developed.

Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 Documentation/ABI/testing/sysfs-kernel-slab |  475 +++++++++++++++++++++++++++
 1 files changed, 475 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-slab

diff --git a/Documentation/ABI/testing/sysfs-kernel-slab b/Documentation/ABI/testing/sysfs-kernel-slab
new file mode 100644
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-slab
@@ -0,0 +1,475 @@
+What:		/sys/kernel/slab
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The /sys/kernel/slab directory contains a snapshot of the
+		internal state of the SLUB allocator for each cache.  Certain
+		files may be modified to change the behavior of the cache (and
+		any cache it aliases, if any).
+Users:		kernel memory tuning tools
+
+What:		/sys/kernel/slab/cache/aliases
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The aliases file is read-only and specifies how many caches
+		have merged into this cache.
+
+What:		/sys/kernel/slab/cache/align
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The align file is read-only and specifies the cache's object
+		alignment in bytes.
+
+What:		/sys/kernel/slab/cache/alloc_calls
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_calls file is read-only and lists the locations of
+		object allocs for SLAB_STORE_USER caches as specified on the
+		kernel command line (see Documentation/vm/slub.txt).
+
+What:		/sys/kernel/slab/cache/alloc_fastpath
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_fastpath file is read-only and specifies how many
+		objects have been allocated utilizing the cache's fastpath
+		(i.e. from the cpu slab).
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/alloc_from_partial
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_from_partial file is read-only and specifies how
+		many times a cpu slab has been full and it has been refilled
+		by a partial slab.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/alloc_refill
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_refill file is read-only and specifies how many
+		times a cpu slab needed to be refilled because it was full.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/alloc_slab
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_slab file is read-only and specifies how many times
+		a new slab had to be allocated from the page allocator.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/alloc_slowpath
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_slowpath file is read-only and specifies how many
+		objects have been allocated utilizing the cache's slowpath
+		(i.e. from a partial or new slab).
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/cache_dma
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The cache_dma file is read-only and specifies whether objects
+		are from ZONE_DMA.
+		Available when CONFIG_ZONE_DMA is enabled.
+
+What:		/sys/kernel/slab/cache/cpu_slabs
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The cpu_slabs file is read-only and displays how many cpu slabs
+		are active and from which nodes they are from.
+
+What:		/sys/kernel/slab/cache/cpu_slab_flush
+Date:		April 2009
+KernelVersion:	2.6.31
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file cpu_slab_flush is read-only and specifies how many
+		times a cache's cpu slabs have been flushed as the result of
+		destroying or shrinking a cache and when a cpu goes offline.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/ctor
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The ctor file is read-only and specifies the cache's object
+		constructor function, which is invoked for each object when a
+		new slab is allocated.
+
+What:		/sys/kernel/slab/cache/deactivate_empty
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_empty is read-only and specifies how many
+		times an empty cpu slab was deactivated.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/deactivate_full
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_full is read-only and specifies how many
+		times a full cpu slab was deactivated.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/deactivate_remote_frees
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_remote_frees is read-only and specifies how
+		many times a cpu slab has been deactivated and contained free
+		objects that were freed remotely.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/deactivate_to_head
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_to_head is read-only and specifies how
+		many times a partial cpu slab was deactivated and added to the
+		head of its node's partial list.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/deactivate_to_tail
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_to_tail is read-only and specifies how
+		many times a partial cpu slab was deactivated and added to the
+		tail of its node's partial list.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/destroy_by_rcu
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The destroy_by_rcu file is read-only and specifies whether
+		slabs (not objects) are freed by rcu.
+
+What:		/sys/kernel/slab/cache/free_add_partial
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file free_add_partial is read-only and specifies how many
+		times an object has been freed to a full slab so that it had to
+		added to its node's partial list.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_calls
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_calls file is read-only and lists the locations of
+		object frees for SLAB_STORE_USER caches as specified on the
+		kernel command line (see Documentation/vm/slub.txt).
+
+What:		/sys/kernel/slab/cache/free_fastpath
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_fastpath file is read-only and specifies how many
+		objects have been freed utilizing the cache's fastpath (i.e.
+		to the cpu slab).
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_frozen
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_frozen file is read-only and specifies how many
+		objects have been freed to a frozen slab (i.e. a remote cpu
+		slab).
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_remove_partial
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file free_remove_partial is read-only and specifies how
+		many times an object has been freed to a now-empty slab so
+		that it had to be removed from its node's partial list.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_slab
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_slab file is read-only and specifies how many times an
+		empty slab has been freed back to the page allocator.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_slowpath
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_slowpath file is read-only and specifies how many
+		objects have been freed utilizing the cache's slowpath (i.e.
+		to a full or partial slab).
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/hwcache_align
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The hwcache_align file is read-only and specifies whether
+		objects are aligned on cachelines.
+
+What:		/sys/kernel/slab/cache/min_partial
+Date:		February 2009
+KernelVersion:	2.6.30
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		David Rientjes <rientjes@google.com>
+Description:
+		The min_partial file specifies how many empty slabs shall
+		remain on a node's partial list to avoid the overhead of
+		allocating new slabs.  Such slabs may be reclaimed by utilizing
+		the shrink file.
+
+What:		/sys/kernel/slab/cache/object_size
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The object_size file is read-only and specifies the cache's
+		object size.
+
+What:		/sys/kernel/slab/cache/objects
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The objects file is read-only and displays how many objects are
+		active and from which nodes they are from.
+
+What:		/sys/kernel/slab/cache/objects_partial
+Date:		April 2008
+KernelVersion:	2.6.26
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The objects_partial file is read-only and displays how many
+		objects are on partial slabs and from which nodes they are
+		from.
+
+What:		/sys/kernel/slab/cache/objs_per_slab
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file objs_per_slab is read-only and specifies how many
+		objects may be allocated from a single slab of the order
+		specified in /sys/kernel/slab/cache/order.
+
+What:		/sys/kernel/slab/cache/order
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The order file specifies the page order at which new slabs are
+		allocated.  If a slab cannot be allocated because of
+		fragmentation, SLUB will retry with the minimum order possible
+		depending on its characteristics.
+
+What:		/sys/kernel/slab/cache/order_fallback
+Date:		April 2008
+KernelVersion:	2.6.26
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file order_fallback is read-only and specifies how many
+		times an allocation of a new slab has not been possible at the
+		cache's order and instead fallen back to its minimum possible
+		order.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/partial
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The partial file is read-only and displays how long many
+		partial slabs there are and how long each node's list is.
+
+What:		/sys/kernel/slab/cache/poison
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The poison file specifies whether objects should be poisoned
+		when a new slab is allocated.
+
+What:		/sys/kernel/slab/cache/reclaim_account
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The reclaim_account file specifies whether the cache's objects
+		are reclaimable (and grouped by their mobility).
+
+What:		/sys/kernel/slab/cache/red_zone
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The red_zone file specifies whether the cache's objects are red
+		zoned.
+
+What:		/sys/kernel/slab/cache/remote_node_defrag_ratio
+Date:		January 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file remote_node_defrag_ratio specifies the percentage of
+		times SLUB will attempt to refill the cpu slab with a partial
+		slab from a remote node as opposed to allocating a new slab on
+		the local node.  This reduces the amount of wasted memory over
+		the entire system but can be expensive.
+		Available when CONFIG_NUMA is enabled.
+
+What:		/sys/kernel/slab/cache/sanity_checks
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The sanity_checks file specifies whether expensive checks
+		should be performed on free.  This is actually a no-op for SLUB
+		so it only acts to prevent slab merging.
+
+What:		/sys/kernel/slab/cache/shrink
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The shrink file is written when memory should be reclaimed from
+		a cache.  Empty partial slabs are freed and the partial list is
+		sorted so the slabs with the fewest available objects are used
+		first.
+
+What:		/sys/kernel/slab/cache/slab_size
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The slab_size file is read-only and specifies the object size
+		with metadata (debugging information and alignment) in bytes.
+
+What:		/sys/kernel/slab/cache/slabs
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The slabs file is read-only and displays how long many slabs
+		there are (both cpu and partial) and from which nodes they are
+		from.
+
+What:		/sys/kernel/slab/cache/store_user
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The store_user file specifies whether the location of
+		allocation or free should be tracked for a cache.
+
+What:		/sys/kernel/slab/cache/total_objects
+Date:		April 2008
+KernelVersion:	2.6.26
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The total_objects file is read-only and displays how many total
+		objects a cache has and from which nodes they are from.
+
+What:		/sys/kernel/slab/cache/trace
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The trace file specifies whether object allocations and frees
+		should be traced.
+
+What:		/sys/kernel/slab/cache/validate
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The validate file is written whenever a cache should be
+		validated for correctness.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-23 18:38 ` [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab David Rientjes
@ 2009-04-23 18:52   ` Christoph Lameter
  2009-04-24 23:26     ` [patch] " David Rientjes
  2009-04-23 22:26   ` [patch 2/2] " David Rientjes
  1 sibling, 1 reply; 12+ messages in thread
From: Christoph Lameter @ 2009-04-23 18:52 UTC (permalink / raw)
  To: David Rientjes; +Cc: Pekka Enberg, Randy Dunlap, linux-kernel

On Thu, 23 Apr 2009, David Rientjes wrote:

> +What:		/sys/kernel/slab/cache/alloc_calls
> +Date:		May 2007
> +KernelVersion:	2.6.22
> +Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
> +		Christoph Lameter <cl@linux-foundation.org>
> +Description:
> +		The alloc_calls file is read-only and lists the locations of
> +		object allocs for SLAB_STORE_USER caches as specified on the
> +		kernel command line (see Documentation/vm/slub.txt).

Thats a bit ambiguous:

Alloc_calls list the kernel code locations from which allocations for this
cache were performed. The alloc_calls file only contains information if
debugging was enabled for the cache (f.e. via the kernel command line
parameter)

> +What:		/sys/kernel/slab/cache/alloc_fastpath
> +Date:		February 2008
> +KernelVersion:	2.6.25
> +Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
> +		Christoph Lameter <cl@linux-foundation.org>
> +Description:
> +		The alloc_fastpath file is read-only and specifies how many
> +		objects have been allocated utilizing the cache's fastpath

objects have been allocating using the fast path

> +What:		/sys/kernel/slab/cache/alloc_from_partial
> +Date:		February 2008
> +KernelVersion:	2.6.25
> +Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
> +		Christoph Lameter <cl@linux-foundation.org>
> +Description:
> +		The alloc_from_partial file is read-only and specifies how
> +		many times a cpu slab has been full and it has been refilled
> +		by a partial slab.

by using a slab from the list of partially used slabs.

?

> +What:		/sys/kernel/slab/cache/alloc_refill
> +Date:		February 2008
> +KernelVersion:	2.6.25
> +Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
> +		Christoph Lameter <cl@linux-foundation.org>
> +Description:
> +		The alloc_refill file is read-only and specifies how many
> +		times a cpu slab needed to be refilled because it was full.
> +		Available when CONFIG_SLUB_STATS is enabled.

Nope. A refill is when the per cpu list became empty but there are objects
on the list of free objects in the page struct associated with the slab
page (occurs when other cpus free objects allocated from the per cpu
slab).

> +Description:
> +		The alloc_slowpath file is read-only and specifies how many
> +		objects have been allocated utilizing the cache's slowpath
> +		(i.e. from a partial or new slab).
> +		Available when CONFIG_SLUB_STATS is enabled.

Slowpath can do a refill. In that case no partial or new slab is needed.

> +Description:
> +		The cpu_slabs file is read-only and displays how many cpu slabs
> +		are active and from which nodes they are from.

are active and their NUMA locality

?

> +Description:
> +		The file cpu_slab_flush is read-only and specifies how many
> +		times a cache's cpu slabs have been flushed as the result of
> +		destroying or shrinking a cache and when a cpu goes offline.
> +		Available when CONFIG_SLUB_STATS is enabled.

A flush also may occur as a result of forcing an allocation from a certain
NUMA node.

> +Description:
> +		The file free_add_partial is read-only and specifies how many
> +		times an object has been freed to a full slab so that it had to

been freed in a full slab so that it had to

> +Description:
> +		The free_calls file is read-only and lists the locations of
> +		object frees for SLAB_STORE_USER caches as specified on the

object frees if slab debugging is enabled (see Documentation/vm/slub.txt)

> +Description:
> +		The free_fastpath file is read-only and specifies how many
> +		objects have been freed utilizing the cache's fastpath (i.e.

objects have been free using the fastpath because it was an object from
the cpu_slab.

> +What:		/sys/kernel/slab/cache/order
> +Date:		May 2007
> +KernelVersion:	2.6.22
> +Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
> +		Christoph Lameter <cl@linux-foundation.org>
> +Description:
> +		The order file specifies the page order at which new slabs are
> +		allocated.  If a slab cannot be allocated because of
> +		fragmentation, SLUB will retry with the minimum order possible
> +		depending on its characteristics.

The order is writable and can be changed to increase objects per slab.

> +What:		/sys/kernel/slab/cache/sanity_checks
> +Date:		May 2007
> +KernelVersion:	2.6.22
> +Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
> +		Christoph Lameter <cl@linux-foundation.org>
> +Description:
> +		The sanity_checks file specifies whether expensive checks
> +		should be performed on free.  This is actually a no-op for SLUB
> +		so it only acts to prevent slab merging.

It enables at mininum the double free checks.

> +What:		/sys/kernel/slab/cache/slab_size
> +Date:		May 2007
> +KernelVersion:	2.6.22
> +Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
> +		Christoph Lameter <cl@linux-foundation.org>
> +Description:
> +		The slab_size file is read-only and specifies the object size
> +		with metadata (debugging information and alignment) in bytes.

Also includes alignment.

> +
> +What:		/sys/kernel/slab/cache/validate
> +Date:		May 2007
> +KernelVersion:	2.6.22
> +Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
> +		Christoph Lameter <cl@linux-foundation.org>
> +Description:
> +		The validate file is written whenever a cache should be
> +		validated for correctness.

Writing to the validate files makes SLUB traverse all its objects and
check the validity of metadata.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch 1/2] slub: rename cpuslab_flush to cpu_slab_flush
  2009-04-23 18:38 [patch 1/2] slub: rename cpuslab_flush to cpu_slab_flush David Rientjes
  2009-04-23 18:38 ` [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab David Rientjes
@ 2009-04-23 19:39 ` Pekka Enberg
  1 sibling, 0 replies; 12+ messages in thread
From: Pekka Enberg @ 2009-04-23 19:39 UTC (permalink / raw)
  To: David Rientjes
  Cc: Christoph Lameter, linux-kernel, Linus Torvalds, Andrew Morton

Hi David,

On Thu, Apr 23, 2009 at 9:38 PM, David Rientjes <rientjes@google.com> wrote:
> There is already a `cpu_slabs' file to display the number of cpu slabs,
> so cpuslab_flush should follow this pattern.
>
> The first documentation of this file will be in a subsequent patch that
> adds Documentation/ABI/testing/sysfs-kernel-slab, so no stable guarantee
> has been made that the name of this file would not change.

I'm afraid I don't have enough asbestos in my underwear to try to
sneak this one past Linus.

A kernel ABI is an ABI even if it's not documented. Now, I wouldn't
mind getting flamed if we actually gained something from the change.
But just fixing a simple typo in sysfs files is not big enough a
reason for me to merge the patch.

That said, I love the second patch though and am more than happy to take it.

                                          Pekka

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-23 18:38 ` [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab David Rientjes
  2009-04-23 18:52   ` Christoph Lameter
@ 2009-04-23 22:26   ` David Rientjes
  2009-04-23 22:31     ` Christoph Lameter
  1 sibling, 1 reply; 12+ messages in thread
From: David Rientjes @ 2009-04-23 22:26 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Christoph Lameter, Randy Dunlap, Nick Piggin, linux-kernel

On Thu, 23 Apr 2009, David Rientjes wrote:

> Adds documentation for the slub ABI.
> 
> This is placed in the `testing' directory since the meanings of these
> files are still subject to change as slub is developed.
> 

I just noticed that slqb also uses /sys/kernel/slab for its sysfs API, so 
this isn't going to work unless

 - slqb uses /sys/kernel/slab as well and we simply add its files in
   sysfs-kernel-slab and leave it to userspace to test for which allocator
   is actually being used.  Both allocators share many of the same
   fundamental attributes but some are only applicable to one,

 - slqb moves to /sys/kernel/slqb since slub is already resident in
   /sys/kernel/slab and the mm/slab.c allocator actually has no sysfs
   interface, or

 - this file is renamed to sysfs-kernel-slub and a sysfs-kernel-slab file
   is created that simply points users to the correct ABI file depending
   on their configuration.

I'd be included to suggest that slqb moves to /sys/kernel/slqb despite the 
naming disparity between slub and its ABI in /sys/kernel/slab.

Opinions?


slqb: move sysfs API into slqb directory

SLUB already has a sysfs API in the `slab' directory, so SLQB must use 
`slqb'.

Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: David Rientjes <rientjes@google.com>
---
diff --git a/mm/slqb.c b/mm/slqb.c
--- a/mm/slqb.c
+++ b/mm/slqb.c
@@ -3536,7 +3536,7 @@ static int __init slab_sysfs_init(void)
 	struct kmem_cache *s;
 	int err;
 
-	slab_kset = kset_create_and_add("slab", &slab_uevent_ops, kernel_kobj);
+	slab_kset = kset_create_and_add("slqb", &slab_uevent_ops, kernel_kobj);
 	if (!slab_kset) {
 		printk(KERN_ERR "Cannot register slab subsystem.\n");
 		return -ENOSYS;

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-23 22:26   ` [patch 2/2] " David Rientjes
@ 2009-04-23 22:31     ` Christoph Lameter
  2009-04-23 22:52       ` David Rientjes
  0 siblings, 1 reply; 12+ messages in thread
From: Christoph Lameter @ 2009-04-23 22:31 UTC (permalink / raw)
  To: David Rientjes; +Cc: Pekka Enberg, Randy Dunlap, Nick Piggin, linux-kernel

On Thu, 23 Apr 2009, David Rientjes wrote:

>  - slqb uses /sys/kernel/slab as well and we simply add its files in
>    sysfs-kernel-slab and leave it to userspace to test for which allocator
>    is actually being used.  Both allocators share many of the same
>    fundamental attributes but some are only applicable to one,
>
>  - slqb moves to /sys/kernel/slqb since slub is already resident in
>    /sys/kernel/slab and the mm/slab.c allocator actually has no sysfs
>    interface, or

slqb cannot be concurrently used with slub. So slqb can use
/sys/kernel/slab as well. So could the original slab allocator.
Dont change this.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-23 22:31     ` Christoph Lameter
@ 2009-04-23 22:52       ` David Rientjes
  2009-04-23 22:55         ` Christoph Lameter
  0 siblings, 1 reply; 12+ messages in thread
From: David Rientjes @ 2009-04-23 22:52 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: Pekka Enberg, Randy Dunlap, Nick Piggin, linux-kernel

On Thu, 23 Apr 2009, Christoph Lameter wrote:

> >  - slqb uses /sys/kernel/slab as well and we simply add its files in
> >    sysfs-kernel-slab and leave it to userspace to test for which allocator
> >    is actually being used.  Both allocators share many of the same
> >    fundamental attributes but some are only applicable to one,
> >
> >  - slqb moves to /sys/kernel/slqb since slub is already resident in
> >    /sys/kernel/slab and the mm/slab.c allocator actually has no sysfs
> >    interface, or
> 
> slqb cannot be concurrently used with slub. So slqb can use
> /sys/kernel/slab as well. So could the original slab allocator.
> Dont change this.
> 

I'm more concerned with the userspace API.  You're comfortable with 
letting userspace determine what allocator the kernel is using either by 
testing for the presence of certain slub or slqb-specific files or 
checking the config?

That should be fine since there's parity among the files that both 
allocators share, but seems fragile if an allocator adds a file that was 
previously only applicable to the other or the API happens to change.

My thinking was that /sys/kernel/slqb would be a permanent reference point 
that userspace could easily test to determine what API is available.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-23 22:52       ` David Rientjes
@ 2009-04-23 22:55         ` Christoph Lameter
  2009-04-24 23:35           ` David Rientjes
  0 siblings, 1 reply; 12+ messages in thread
From: Christoph Lameter @ 2009-04-23 22:55 UTC (permalink / raw)
  To: David Rientjes; +Cc: Pekka Enberg, Randy Dunlap, Nick Piggin, linux-kernel

On Thu, 23 Apr 2009, David Rientjes wrote:

> I'm more concerned with the userspace API.  You're comfortable with
> letting userspace determine what allocator the kernel is using either by
> testing for the presence of certain slub or slqb-specific files or
> checking the config?

Why would userspace have to test? If the fields have the same semantics
then we are fine.

> That should be fine since there's parity among the files that both
> allocators share, but seems fragile if an allocator adds a file that was
> previously only applicable to the other or the API happens to change.

Right. The newly added file must not be in use by another allocator.

> My thinking was that /sys/kernel/slqb would be a permanent reference point
> that userspace could easily test to determine what API is available.

The API is hopefully generic enought to accomodate all allocators.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [patch] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-23 18:52   ` Christoph Lameter
@ 2009-04-24 23:26     ` David Rientjes
  2009-04-27 14:09       ` Christoph Lameter
  2009-04-28 11:32       ` Pekka Enberg
  0 siblings, 2 replies; 12+ messages in thread
From: David Rientjes @ 2009-04-24 23:26 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Christoph Lameter, Randy Dunlap, linux-kernel

Adds documentation for the slub ABI.

This is placed in the `testing' directory since the meanings of these
files are still subject to change as slub is developed.

Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 Documentation/ABI/testing/sysfs-kernel-slab |  479 +++++++++++++++++++++++++++
 1 files changed, 479 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-slab

diff --git a/Documentation/ABI/testing/sysfs-kernel-slab b/Documentation/ABI/testing/sysfs-kernel-slab
new file mode 100644
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-slab
@@ -0,0 +1,479 @@
+What:		/sys/kernel/slab
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The /sys/kernel/slab directory contains a snapshot of the
+		internal state of the SLUB allocator for each cache.  Certain
+		files may be modified to change the behavior of the cache (and
+		any cache it aliases, if any).
+Users:		kernel memory tuning tools
+
+What:		/sys/kernel/slab/cache/aliases
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The aliases file is read-only and specifies how many caches
+		have merged into this cache.
+
+What:		/sys/kernel/slab/cache/align
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The align file is read-only and specifies the cache's object
+		alignment in bytes.
+
+What:		/sys/kernel/slab/cache/alloc_calls
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_calls file is read-only and lists the kernel code
+		locations from which allocations for this cache were performed.
+		The alloc_calls file only contains information if debugging is
+		enabled for that cache (see Documentation/vm/slub.txt).
+
+What:		/sys/kernel/slab/cache/alloc_fastpath
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_fastpath file is read-only and specifies how many
+		objects have been allocated using the fast path.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/alloc_from_partial
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_from_partial file is read-only and specifies how
+		many times a cpu slab has been full and it has been refilled
+		by using a slab from the list of partially used slabs.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/alloc_refill
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_refill file is read-only and specifies how many
+		times the per-cpu freelist was empty but there were objects
+		available as the result of remote cpu frees.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/alloc_slab
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_slab file is read-only and specifies how many times
+		a new slab had to be allocated from the page allocator.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/alloc_slowpath
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The alloc_slowpath file is read-only and specifies how many
+		objects have been allocated using the slow path because of a
+		refill or allocation from a partial or new slab.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/cache_dma
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The cache_dma file is read-only and specifies whether objects
+		are from ZONE_DMA.
+		Available when CONFIG_ZONE_DMA is enabled.
+
+What:		/sys/kernel/slab/cache/cpu_slabs
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The cpu_slabs file is read-only and displays how many cpu slabs
+		are active and their NUMA locality.
+
+What:		/sys/kernel/slab/cache/cpuslab_flush
+Date:		April 2009
+KernelVersion:	2.6.31
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file cpuslab_flush is read-only and specifies how many
+		times a cache's cpu slabs have been flushed as the result of
+		destroying or shrinking a cache, a cpu going offline, or as
+		the result of forcing an allocation from a certain node.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/ctor
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The ctor file is read-only and specifies the cache's object
+		constructor function, which is invoked for each object when a
+		new slab is allocated.
+
+What:		/sys/kernel/slab/cache/deactivate_empty
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_empty is read-only and specifies how many
+		times an empty cpu slab was deactivated.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/deactivate_full
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_full is read-only and specifies how many
+		times a full cpu slab was deactivated.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/deactivate_remote_frees
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_remote_frees is read-only and specifies how
+		many times a cpu slab has been deactivated and contained free
+		objects that were freed remotely.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/deactivate_to_head
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_to_head is read-only and specifies how
+		many times a partial cpu slab was deactivated and added to the
+		head of its node's partial list.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/deactivate_to_tail
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file deactivate_to_tail is read-only and specifies how
+		many times a partial cpu slab was deactivated and added to the
+		tail of its node's partial list.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/destroy_by_rcu
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The destroy_by_rcu file is read-only and specifies whether
+		slabs (not objects) are freed by rcu.
+
+What:		/sys/kernel/slab/cache/free_add_partial
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file free_add_partial is read-only and specifies how many
+		times an object has been freed in a full slab so that it had to
+		added to its node's partial list.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_calls
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_calls file is read-only and lists the locations of
+		object frees if slab debugging is enabled (see
+		Documentation/vm/slub.txt).
+
+What:		/sys/kernel/slab/cache/free_fastpath
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_fastpath file is read-only and specifies how many
+		objects have been freed using the fast path because it was an
+		object from the cpu slab.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_frozen
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_frozen file is read-only and specifies how many
+		objects have been freed to a frozen slab (i.e. a remote cpu
+		slab).
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_remove_partial
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file free_remove_partial is read-only and specifies how
+		many times an object has been freed to a now-empty slab so
+		that it had to be removed from its node's partial list.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_slab
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_slab file is read-only and specifies how many times an
+		empty slab has been freed back to the page allocator.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/free_slowpath
+Date:		February 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The free_slowpath file is read-only and specifies how many
+		objects have been freed using the slow path (i.e. to a full or
+		partial slab).
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/hwcache_align
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The hwcache_align file is read-only and specifies whether
+		objects are aligned on cachelines.
+
+What:		/sys/kernel/slab/cache/min_partial
+Date:		February 2009
+KernelVersion:	2.6.30
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		David Rientjes <rientjes@google.com>
+Description:
+		The min_partial file specifies how many empty slabs shall
+		remain on a node's partial list to avoid the overhead of
+		allocating new slabs.  Such slabs may be reclaimed by utilizing
+		the shrink file.
+
+What:		/sys/kernel/slab/cache/object_size
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The object_size file is read-only and specifies the cache's
+		object size.
+
+What:		/sys/kernel/slab/cache/objects
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The objects file is read-only and displays how many objects are
+		active and from which nodes they are from.
+
+What:		/sys/kernel/slab/cache/objects_partial
+Date:		April 2008
+KernelVersion:	2.6.26
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The objects_partial file is read-only and displays how many
+		objects are on partial slabs and from which nodes they are
+		from.
+
+What:		/sys/kernel/slab/cache/objs_per_slab
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file objs_per_slab is read-only and specifies how many
+		objects may be allocated from a single slab of the order
+		specified in /sys/kernel/slab/cache/order.
+
+What:		/sys/kernel/slab/cache/order
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The order file specifies the page order at which new slabs are
+		allocated.  It is writable and can be changed to increase the
+		number of objects per slab.  If a slab cannot be allocated
+		because of fragmentation, SLUB will retry with the minimum order
+		possible depending on its characteristics.
+
+What:		/sys/kernel/slab/cache/order_fallback
+Date:		April 2008
+KernelVersion:	2.6.26
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file order_fallback is read-only and specifies how many
+		times an allocation of a new slab has not been possible at the
+		cache's order and instead fallen back to its minimum possible
+		order.
+		Available when CONFIG_SLUB_STATS is enabled.
+
+What:		/sys/kernel/slab/cache/partial
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The partial file is read-only and displays how long many
+		partial slabs there are and how long each node's list is.
+
+What:		/sys/kernel/slab/cache/poison
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The poison file specifies whether objects should be poisoned
+		when a new slab is allocated.
+
+What:		/sys/kernel/slab/cache/reclaim_account
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The reclaim_account file specifies whether the cache's objects
+		are reclaimable (and grouped by their mobility).
+
+What:		/sys/kernel/slab/cache/red_zone
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The red_zone file specifies whether the cache's objects are red
+		zoned.
+
+What:		/sys/kernel/slab/cache/remote_node_defrag_ratio
+Date:		January 2008
+KernelVersion:	2.6.25
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The file remote_node_defrag_ratio specifies the percentage of
+		times SLUB will attempt to refill the cpu slab with a partial
+		slab from a remote node as opposed to allocating a new slab on
+		the local node.  This reduces the amount of wasted memory over
+		the entire system but can be expensive.
+		Available when CONFIG_NUMA is enabled.
+
+What:		/sys/kernel/slab/cache/sanity_checks
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The sanity_checks file specifies whether expensive checks
+		should be performed on free and, at minimum, enables double free
+		checks.  Caches that enable sanity_checks cannot be merged with
+		caches that do not.
+
+What:		/sys/kernel/slab/cache/shrink
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The shrink file is written when memory should be reclaimed from
+		a cache.  Empty partial slabs are freed and the partial list is
+		sorted so the slabs with the fewest available objects are used
+		first.
+
+What:		/sys/kernel/slab/cache/slab_size
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The slab_size file is read-only and specifies the object size
+		with metadata (debugging information and alignment) in bytes.
+
+What:		/sys/kernel/slab/cache/slabs
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The slabs file is read-only and displays how long many slabs
+		there are (both cpu and partial) and from which nodes they are
+		from.
+
+What:		/sys/kernel/slab/cache/store_user
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The store_user file specifies whether the location of
+		allocation or free should be tracked for a cache.
+
+What:		/sys/kernel/slab/cache/total_objects
+Date:		April 2008
+KernelVersion:	2.6.26
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The total_objects file is read-only and displays how many total
+		objects a cache has and from which nodes they are from.
+
+What:		/sys/kernel/slab/cache/trace
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		The trace file specifies whether object allocations and frees
+		should be traced.
+
+What:		/sys/kernel/slab/cache/validate
+Date:		May 2007
+KernelVersion:	2.6.22
+Contact:	Pekka Enberg <penberg@cs.helsinki.fi>,
+		Christoph Lameter <cl@linux-foundation.org>
+Description:
+		Writing to the validate file causes SLUB to traverse all of its
+		cache's objects and check the validity of metadata.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-23 22:55         ` Christoph Lameter
@ 2009-04-24 23:35           ` David Rientjes
  0 siblings, 0 replies; 12+ messages in thread
From: David Rientjes @ 2009-04-24 23:35 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: Pekka Enberg, Randy Dunlap, Nick Piggin, linux-kernel

On Thu, 23 Apr 2009, Christoph Lameter wrote:

> > I'm more concerned with the userspace API.  You're comfortable with
> > letting userspace determine what allocator the kernel is using either by
> > testing for the presence of certain slub or slqb-specific files or
> > checking the config?
> 
> Why would userspace have to test? If the fields have the same semantics
> then we are fine.
> 

For a robust init script to determine which allocator the kernel is using, 
it must either do `zgrep CONFIG_SLQB=y /proc/config.gz` or 
if [ -e /sys/kernel/slab/cache/hiwater ], for example.  The latter is more 
delicate because the API could change or (even worse) another allocator, 
present or future, could include a `hiwater' attribute.

> > That should be fine since there's parity among the files that both
> > allocators share, but seems fragile if an allocator adds a file that was
> > previously only applicable to the other or the API happens to change.
> 
> Right. The newly added file must not be in use by another allocator.
> 

Yeah, at least with different semantics or side effects.

> > My thinking was that /sys/kernel/slqb would be a permanent reference point
> > that userspace could easily test to determine what API is available.
> 
> The API is hopefully generic enought to accomodate all allocators.
> 

Ok, fair enough.

SLQB will need to update this file and hopefully it doesn't become too 
terribly complex.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-24 23:26     ` [patch] " David Rientjes
@ 2009-04-27 14:09       ` Christoph Lameter
  2009-04-28 11:32       ` Pekka Enberg
  1 sibling, 0 replies; 12+ messages in thread
From: Christoph Lameter @ 2009-04-27 14:09 UTC (permalink / raw)
  To: David Rientjes; +Cc: Pekka Enberg, Randy Dunlap, linux-kernel





Acked-by: Christoph Lameter <cl@linux-foundation.org>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [patch] slub: add Documentation/ABI/testing/sysfs-kernel-slab
  2009-04-24 23:26     ` [patch] " David Rientjes
  2009-04-27 14:09       ` Christoph Lameter
@ 2009-04-28 11:32       ` Pekka Enberg
  1 sibling, 0 replies; 12+ messages in thread
From: Pekka Enberg @ 2009-04-28 11:32 UTC (permalink / raw)
  To: David Rientjes; +Cc: Christoph Lameter, Randy Dunlap, linux-kernel

On Fri, 2009-04-24 at 16:26 -0700, David Rientjes wrote:
> Adds documentation for the slub ABI.
> 
> This is placed in the `testing' directory since the meanings of these
> files are still subject to change as slub is developed.
> 
> Cc: Christoph Lameter <cl@linux-foundation.org>
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: David Rientjes <rientjes@google.com>

Applied, thanks!


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-04-28 11:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-23 18:38 [patch 1/2] slub: rename cpuslab_flush to cpu_slab_flush David Rientjes
2009-04-23 18:38 ` [patch 2/2] slub: add Documentation/ABI/testing/sysfs-kernel-slab David Rientjes
2009-04-23 18:52   ` Christoph Lameter
2009-04-24 23:26     ` [patch] " David Rientjes
2009-04-27 14:09       ` Christoph Lameter
2009-04-28 11:32       ` Pekka Enberg
2009-04-23 22:26   ` [patch 2/2] " David Rientjes
2009-04-23 22:31     ` Christoph Lameter
2009-04-23 22:52       ` David Rientjes
2009-04-23 22:55         ` Christoph Lameter
2009-04-24 23:35           ` David Rientjes
2009-04-23 19:39 ` [patch 1/2] slub: rename cpuslab_flush to cpu_slab_flush Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®