[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080603215155.GA9712@electric-eye.fr.zoreil.com>
Date: Tue, 3 Jun 2008 23:51:55 +0200
From: Francois Romieu <romieu@...zoreil.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Arjan van de Ven <arjan@...radead.org>, alan@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: via-velocity.c fix sleep-with-spinlock bug during
MTU change
Andrew Morton <akpm@...ux-foundation.org> :
[...]
> So hrm. It could all be a lot better. Just looking quickly at the
> code I _think_ we might be able to do all the needed allocations
> outside the lock and then swizzle them into place after taking the
> lock. ie, something as simple as:
[...]
> velocity_init_rd_ring(temp_vptr); /* Can use GFP_KERNEL! */
>
> spin_lock_irqsave(&vptr->lock, flags);
>
> velocity_free_td_ring(vptr);
> velocity_free_rd_ring(vptr);
>
> vptr->foo = temp_vptr->foo;
> vptr->bar = temp_vptr->bar;
> ...
>
> spin_unlock_irqrestore(&vptr->lock, flags);
>
> ?
Almost.
I'll wrap it in the next 24 hours.
--
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists