lkml.org 
[lkml]   [2008]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] debugobjects: fix lockdep warning #2
On Thu, 28 Aug 2008, Vegard Nossum wrote:
> On Thu, Aug 28, 2008 at 3:56 PM, Ingo Molnar <mingo@elte.hu> wrote:
> > could you resend the final patch please? It's a candidate for .27, if it
> > works out fine.
>
> Here is the combined patch. I've tested it only briefly, and I am
> unsure of whether it still produces lockdep warnings for Daniel or
> not. I wish it would not be applied anywhere unless it was
> officially Reviewed-by: someone. In particular, I'm not quite
> steady with the irq-safe locking (Thomas might want to have a look).

The irq safe locking is the easy part :) Calling free_object w/o the
hash bucket lock held is fine as we removed it already from the bucket
and there is no other reference than the pointer we hold at that point.

>
> printk(KERN_WARNING "ODEBUG: Out of memory. ODEBUG disabled\n");
>
> + /* XXX: Could probably be optimized by transplantation of more than
> + * one entry at a time. */
> for (i = 0; i < ODEBUG_HASH_SIZE; i++, db++) {
> spin_lock_irqsave(&db->lock, flags);
> hlist_for_each_entry_safe(obj, node, tmp, &db->list, node) {
> hlist_del(&obj->node);
> - free_object(obj);
> + hlist_add_head(&obj->node, &freelist);
> }
> spin_unlock_irqrestore(&db->lock, flags);
> +
> + /* Now free them */
> + hlist_for_each_entry_safe(obj, node, tmp, &freelist, node) {
> + hlist_del(&obj->node);
> + free_object(obj);
> + }
> }
> }

What you want is a helper function which moves the complete list from
one head to the other. I'll whip one up.

I'll push it through the tip tree.

Thanks,

tglx


\
 
 \ /
  Last update: 2008-08-29 12:47    [W:0.059 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site