lkml.org 
[lkml]   [2000]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: down_trylock doesn't preserve irqstate
   Date:   Fri, 25 Feb 2000 14:37:13 -0800
From: Rajagopal Ananthanarayanan <ananth@sgi.com>

One problem we encountered in using down_trylock is that
__down_trylock() uses spin_lock_irq() and spin_unlock_irq(), which
does not preserve the interrupt state of the caller.

You should not acquire a semaphore with interrupts disabled.

And if the semaphore sleeps, you'll end up with IRQs enabled when it
wakes up.

A few months ago we went scattering around fixing up places
which assumed IRQ state was preserved across sleep points,
let's not add new ones (and thus new bugs).

Later,
David S. Miller
davem@redhat.com

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

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.067 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site