lkml.org 
[lkml]   [2008]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: via-velocity.c fix sleep-with-spinlock bug during MTU change
Andrew Morton <akpm@linux-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


\
 
 \ /
  Last update: 2008-06-04 00:21    [W:0.072 / U:0.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site