linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slab: fix the alias count(via sysfs) of slab cache
@ 2014-07-23  3:49 Gu Zheng
  2014-07-23 23:13 ` David Rientjes
  0 siblings, 1 reply; 2+ messages in thread
From: Gu Zheng @ 2014-07-23  3:49 UTC (permalink / raw)
  To: cl; +Cc: akpm, linux-mm, linux-kernel, Gu Zheng

We mark some slabs(e.g. kmem_cache_node) as unmergeable via setting
refcount to -1, and their alias should be 0, not refcount-1, so correct
it here.

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
---
 mm/slub.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 7300480..ac1a20a 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4509,7 +4509,7 @@ SLAB_ATTR_RO(ctor);
 
 static ssize_t aliases_show(struct kmem_cache *s, char *buf)
 {
-	return sprintf(buf, "%d\n", s->refcount - 1);
+	return sprintf(buf, "%d\n", s->refcount < 0 ? 0 : s->refcount - 1);
 }
 SLAB_ATTR_RO(aliases);
 
-- 
1.7.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] slab: fix the alias count(via sysfs) of slab cache
  2014-07-23  3:49 [PATCH] slab: fix the alias count(via sysfs) of slab cache Gu Zheng
@ 2014-07-23 23:13 ` David Rientjes
  0 siblings, 0 replies; 2+ messages in thread
From: David Rientjes @ 2014-07-23 23:13 UTC (permalink / raw)
  To: Gu Zheng; +Cc: Christoph Lameter, Andrew Morton, linux-mm, linux-kernel

On Wed, 23 Jul 2014, Gu Zheng wrote:

> We mark some slabs(e.g. kmem_cache_node) as unmergeable via setting
> refcount to -1, and their alias should be 0, not refcount-1, so correct
> it here.
> 
> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>

Acked-by: David Rientjes <rientjes@google.com>

s/slabs/slab caches/

The two slab caches of interest are kmem_cache and kmem_cache_node.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2014-07-23 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23  3:49 [PATCH] slab: fix the alias count(via sysfs) of slab cache Gu Zheng
2014-07-23 23:13 ` David Rientjes

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