Re: spinlocking between user context / tasklet / tophalf question

Daniel Phillips (phillips@bonn-fries.net)
Sun, 28 Apr 2002 00:52:08 +0200


Hi Robert,

On Friday 26 April 2002 21:19, Robert Love wrote:
> On Fri, 2002-04-26 at 04:52, Emmanuel Michon wrote:
> > 2. What is the reality behind: ``things which sleep'', is it really a problem
> > to use copy_from_user/copy_to_user holding a spinlock?
>
> Yes, they sleep.

Well, I think he really wanted to know why it's bad. Emmanuel, suppose process A
takes spinlock S then sleeps. Process B is then scheduled and tries to acquire
S - bang, deadlock: Process A can't release the spinlock because it's sleeping.

Let alone the fact that another CPU trying to acquire S is going to end up
stalled potentially many milliseconds before process A wakes up again and
releases the spinlock.

-- 
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/