Skip to content

Commit

Permalink
Merge branch 'core-debugobjects-for-linus' of git://git.kernel.org/pu…
Browse files Browse the repository at this point in the history
…b/scm/linux/kernel/git/tip/tip

Pull core/debugobjects changes from Ingo Molnar:
 "Not much happened: it includes a cleanup and an irq latency reduction
  fixlet."

* 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  debugobjects: Fill_pool() returns void now
  debugobjects: printk with irqs enabled
  debugobjects: Remove unused return value from fill_pool()
  • Loading branch information
Linus Torvalds committed May 22, 2012
2 parents 62c8d92 + 3340808 commit 513de47
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/debugobjects.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,29 @@ static const char *obj_states[ODEBUG_STATE_MAX] = {
[ODEBUG_STATE_NOTAVAILABLE] = "not available",
};

static int fill_pool(void)
static void fill_pool(void)
{
gfp_t gfp = GFP_ATOMIC | __GFP_NORETRY | __GFP_NOWARN;
struct debug_obj *new;
unsigned long flags;

if (likely(obj_pool_free >= ODEBUG_POOL_MIN_LEVEL))
return obj_pool_free;
return;

if (unlikely(!obj_cache))
return obj_pool_free;
return;

while (obj_pool_free < ODEBUG_POOL_MIN_LEVEL) {

new = kmem_cache_zalloc(obj_cache, gfp);
if (!new)
return obj_pool_free;
return;

raw_spin_lock_irqsave(&pool_lock, flags);
hlist_add_head(&new->node, &obj_pool);
obj_pool_free++;
raw_spin_unlock_irqrestore(&pool_lock, flags);
}
return obj_pool_free;
}

/*
Expand Down Expand Up @@ -1052,10 +1051,10 @@ static int __init debug_objects_replace_static_objects(void)
cnt++;
}
}
local_irq_enable();

printk(KERN_DEBUG "ODEBUG: %d of %d active objects replaced\n", cnt,
obj_pool_used);
local_irq_enable();
return 0;
free:
hlist_for_each_entry_safe(obj, node, tmp, &objects, node) {
Expand Down

0 comments on commit 513de47

Please sign in to comment.