Thread (18 messages) flat view 18 messages, 4 authors, 2008-06-23

Re: [PATCH] net: via-velocity.c fix sleep-with-spinlock bug during MTU change

From: Francois Romieu <romieu@fr.zoreil.com>
Date: 2008-06-03 22:19:22
Also in: lkml

Andrew Morton [off-list ref] :
[...]
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help