* slub: Add statistics for this_cmpxchg_double failures
@ 2011-03-22 18:35 Christoph Lameter
2011-05-11 20:58 ` David Rientjes
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2011-03-22 18:35 UTC (permalink / raw)
To: Pekka Enberg; +Cc: linux-mm
Add some statistics for debugging.
Signed-off-by: Christoph Lameter <cl@linux.com>
---
include/linux/slub_def.h | 1 +
mm/slub.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
Index: linux-2.6/include/linux/slub_def.h
===================================================================
--- linux-2.6.orig/include/linux/slub_def.h 2011-03-11 10:34:26.000000000 -0600
+++ linux-2.6/include/linux/slub_def.h 2011-03-11 10:34:49.000000000 -0600
@@ -32,6 +32,7 @@ enum stat_item {
DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */
DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
ORDER_FALLBACK, /* Number of times fallback was necessary */
+ CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */
NR_SLUB_STAT_ITEMS };
struct kmem_cache_cpu {
Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2011-03-11 10:34:27.000000000 -0600
+++ linux-2.6/mm/slub.c 2011-03-11 10:34:49.000000000 -0600
@@ -217,7 +217,7 @@ static inline void sysfs_slab_remove(str
#endif
-static inline void stat(struct kmem_cache *s, enum stat_item si)
+static inline void stat(const struct kmem_cache *s, enum stat_item si)
{
#ifdef CONFIG_SLUB_STATS
__this_cpu_inc(s->cpu_slab->stat[si]);
@@ -1551,6 +1551,7 @@ static inline void note_cmpxchg_failure(
printk("for unknown reason: actual=%lx was=%lx target=%lx\n",
actual_tid, tid, next_tid(tid));
#endif
+ stat(s, CMPXCHG_DOUBLE_CPU_FAIL);
}
#endif
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: slub: Add statistics for this_cmpxchg_double failures 2011-03-22 18:35 slub: Add statistics for this_cmpxchg_double failures Christoph Lameter @ 2011-05-11 20:58 ` David Rientjes 2011-05-12 14:44 ` Christoph Lameter 0 siblings, 1 reply; 6+ messages in thread From: David Rientjes @ 2011-05-11 20:58 UTC (permalink / raw) To: Christoph Lameter; +Cc: Pekka Enberg, linux-mm On Tue, 22 Mar 2011, Christoph Lameter wrote: > Index: linux-2.6/include/linux/slub_def.h > =================================================================== > --- linux-2.6.orig/include/linux/slub_def.h 2011-03-11 10:34:26.000000000 -0600 > +++ linux-2.6/include/linux/slub_def.h 2011-03-11 10:34:49.000000000 -0600 > @@ -32,6 +32,7 @@ enum stat_item { > DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ > DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ > ORDER_FALLBACK, /* Number of times fallback was necessary */ > + CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */ > NR_SLUB_STAT_ITEMS }; > > struct kmem_cache_cpu { > Index: linux-2.6/mm/slub.c > =================================================================== > --- linux-2.6.orig/mm/slub.c 2011-03-11 10:34:27.000000000 -0600 > +++ linux-2.6/mm/slub.c 2011-03-11 10:34:49.000000000 -0600 > @@ -217,7 +217,7 @@ static inline void sysfs_slab_remove(str > > #endif > > -static inline void stat(struct kmem_cache *s, enum stat_item si) > +static inline void stat(const struct kmem_cache *s, enum stat_item si) > { > #ifdef CONFIG_SLUB_STATS > __this_cpu_inc(s->cpu_slab->stat[si]); > @@ -1551,6 +1551,7 @@ static inline void note_cmpxchg_failure( > printk("for unknown reason: actual=%lx was=%lx target=%lx\n", > actual_tid, tid, next_tid(tid)); > #endif > + stat(s, CMPXCHG_DOUBLE_CPU_FAIL); > } > > #endif I see this has been merged as 4fdccdfbb465, but it seems pretty pointless unless you export the data to userspace with the necessary STAT_ATTR() and addition in slab_attrs. slub: export CMPXCHG_DOUBLE_CPU_FAIL to userspace 4fdccdfbb465 ("slub: Add statistics for this_cmpxchg_double failures") added CMPXCHG_DOUBLE_CPU_FAIL to show how many times this_cpu_cmpxchg_double has failed, but it also needs to be exported to userspace for consumption. This will always be 0 if CONFIG_CMPXCHG_LOCAL is disabled. Signed-off-by: David Rientjes <rientjes@google.com> --- mm/slub.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mm/slub.c b/mm/slub.c --- a/mm/slub.c +++ b/mm/slub.c @@ -4525,6 +4525,7 @@ STAT_ATTR(DEACTIVATE_TO_HEAD, deactivate_to_head); STAT_ATTR(DEACTIVATE_TO_TAIL, deactivate_to_tail); STAT_ATTR(DEACTIVATE_REMOTE_FREES, deactivate_remote_frees); STAT_ATTR(ORDER_FALLBACK, order_fallback); +STAT_ATTR(CMPXCHG_DOUBLE_CPU_FAIL, cmpxchg_double_cpu_fail); #endif static struct attribute *slab_attrs[] = { @@ -4582,6 +4583,7 @@ static struct attribute *slab_attrs[] = { &deactivate_to_tail_attr.attr, &deactivate_remote_frees_attr.attr, &order_fallback_attr.attr, + &cmpxchg_double_cpu_fail_attr.attr, #endif #ifdef CONFIG_FAILSLAB &failslab_attr.attr, -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: slub: Add statistics for this_cmpxchg_double failures 2011-05-11 20:58 ` David Rientjes @ 2011-05-12 14:44 ` Christoph Lameter 2011-05-12 19:58 ` David Rientjes 0 siblings, 1 reply; 6+ messages in thread From: Christoph Lameter @ 2011-05-12 14:44 UTC (permalink / raw) To: David Rientjes; +Cc: Pekka Enberg, linux-mm On Wed, 11 May 2011, David Rientjes wrote: > I see this has been merged as 4fdccdfbb465, but it seems pretty pointless > unless you export the data to userspace with the necessary STAT_ATTR() and > addition in slab_attrs. Right that slipped into a later patch that only dealt with statistics. But I will fold that into the earlier patch. -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: slub: Add statistics for this_cmpxchg_double failures 2011-05-12 14:44 ` Christoph Lameter @ 2011-05-12 19:58 ` David Rientjes 2011-05-13 14:48 ` Christoph Lameter 0 siblings, 1 reply; 6+ messages in thread From: David Rientjes @ 2011-05-12 19:58 UTC (permalink / raw) To: Christoph Lameter; +Cc: Pekka Enberg, linux-mm On Thu, 12 May 2011, Christoph Lameter wrote: > > I see this has been merged as 4fdccdfbb465, but it seems pretty pointless > > unless you export the data to userspace with the necessary STAT_ATTR() and > > addition in slab_attrs. > > Right that slipped into a later patch that only dealt with statistics. But > I will fold that into the earlier patch. > I think since CMPXCHG_DOUBLE_CPU_FAIL is already merged as 4fdccdfbb465 that my patch should be merged to export it? Not sure what patch you intend to fold this into. -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: slub: Add statistics for this_cmpxchg_double failures 2011-05-12 19:58 ` David Rientjes @ 2011-05-13 14:48 ` Christoph Lameter 2011-05-24 9:40 ` [patch] slub: export CMPXCHG_DOUBLE_CPU_FAIL to userspace David Rientjes 0 siblings, 1 reply; 6+ messages in thread From: Christoph Lameter @ 2011-05-13 14:48 UTC (permalink / raw) To: David Rientjes; +Cc: Pekka Enberg, linux-mm On Thu, 12 May 2011, David Rientjes wrote: > On Thu, 12 May 2011, Christoph Lameter wrote: > > > > I see this has been merged as 4fdccdfbb465, but it seems pretty pointless > > > unless you export the data to userspace with the necessary STAT_ATTR() and > > > addition in slab_attrs. > > > > Right that slipped into a later patch that only dealt with statistics. But > > I will fold that into the earlier patch. > > > > I think since CMPXCHG_DOUBLE_CPU_FAIL is already merged as 4fdccdfbb465 > that my patch should be merged to export it? Sure. I have no objections. Acked-by: Christoph Lameter <cl@linux.com> > Not sure what patch you intend to fold this into. Into the statistics patch for the lockless slowpaths. -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch] slub: export CMPXCHG_DOUBLE_CPU_FAIL to userspace 2011-05-13 14:48 ` Christoph Lameter @ 2011-05-24 9:40 ` David Rientjes 0 siblings, 0 replies; 6+ messages in thread From: David Rientjes @ 2011-05-24 9:40 UTC (permalink / raw) To: Pekka Enberg; +Cc: Christoph Lameter, linux-mm 4fdccdfbb465 ("slub: Add statistics for this_cmpxchg_double failures") added CMPXCHG_DOUBLE_CPU_FAIL to show how many times this_cpu_cmpxchg_double has failed, but it also needs to be exported to userspace for consumption. This will always be 0 if CONFIG_CMPXCHG_LOCAL is disabled. Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: David Rientjes <rientjes@google.com> --- mm/slub.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mm/slub.c b/mm/slub.c --- a/mm/slub.c +++ b/mm/slub.c @@ -4525,6 +4525,7 @@ STAT_ATTR(DEACTIVATE_TO_HEAD, deactivate_to_head); STAT_ATTR(DEACTIVATE_TO_TAIL, deactivate_to_tail); STAT_ATTR(DEACTIVATE_REMOTE_FREES, deactivate_remote_frees); STAT_ATTR(ORDER_FALLBACK, order_fallback); +STAT_ATTR(CMPXCHG_DOUBLE_CPU_FAIL, cmpxchg_double_cpu_fail); #endif static struct attribute *slab_attrs[] = { @@ -4582,6 +4583,7 @@ static struct attribute *slab_attrs[] = { &deactivate_to_tail_attr.attr, &deactivate_remote_frees_attr.attr, &order_fallback_attr.attr, + &cmpxchg_double_cpu_fail_attr.attr, #endif #ifdef CONFIG_FAILSLAB &failslab_attr.attr, -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-05-24 9:40 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-03-22 18:35 slub: Add statistics for this_cmpxchg_double failures Christoph Lameter 2011-05-11 20:58 ` David Rientjes 2011-05-12 14:44 ` Christoph Lameter 2011-05-12 19:58 ` David Rientjes 2011-05-13 14:48 ` Christoph Lameter 2011-05-24 9:40 ` [patch] slub: export CMPXCHG_DOUBLE_CPU_FAIL to userspace David Rientjes
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox