Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01ba8251 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  slub: Add statistics for this_cmpxchg_double failures
  slub: Add missing irq restore for the OOM path
parents ab70a1d7 4fdccdfb
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@ enum stat_item {
	DEACTIVATE_TO_TAIL,	/* Cpu slab was moved to the tail of partials */
	DEACTIVATE_TO_TAIL,	/* Cpu slab was moved to the tail of partials */
	DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
	DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
	ORDER_FALLBACK,		/* Number of times fallback was necessary */
	ORDER_FALLBACK,		/* Number of times fallback was necessary */
	CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */
	NR_SLUB_STAT_ITEMS };
	NR_SLUB_STAT_ITEMS };


struct kmem_cache_cpu {
struct kmem_cache_cpu {
+5 −1
Original line number Original line Diff line number Diff line
@@ -217,7 +217,7 @@ static inline void sysfs_slab_remove(struct kmem_cache *s)


#endif
#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
#ifdef CONFIG_SLUB_STATS
	__this_cpu_inc(s->cpu_slab->stat[si]);
	__this_cpu_inc(s->cpu_slab->stat[si]);
@@ -1597,6 +1597,7 @@ static inline void note_cmpxchg_failure(const char *n,
		printk("for unknown reason: actual=%lx was=%lx target=%lx\n",
		printk("for unknown reason: actual=%lx was=%lx target=%lx\n",
			actual_tid, tid, next_tid(tid));
			actual_tid, tid, next_tid(tid));
#endif
#endif
	stat(s, CMPXCHG_DOUBLE_CPU_FAIL);
}
}


#endif
#endif
@@ -1857,6 +1858,9 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
	}
	}
	if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
	if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
		slab_out_of_memory(s, gfpflags, node);
		slab_out_of_memory(s, gfpflags, node);
#ifdef CONFIG_CMPXCHG_LOCAL
	local_irq_restore(flags);
#endif
	return NULL;
	return NULL;
debug:
debug:
	if (!alloc_debug_processing(s, c->page, object, addr))
	if (!alloc_debug_processing(s, c->page, object, addr))