Messages in this thread | | | Date | Tue, 3 Jun 2008 23:51:55 +0200 | From | Francois Romieu <> | Subject | Re: [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
| |