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
Alan Cox wrote:

> A down_trylock() is quite legitimate so the code shouldnt corrupt the
> irq state for that one - I agree. That assumes down_trylock is irq safe
> [ie semops are irq safe] which is another matter altogether.

By semops I assume you mean up(), down(), down_interruptible() etc..
If so, they have to irq safe. My reasoning is as follows: up()
can be called by an interrupt routine; in my mind this seems
to be a fairly common capability of up, where the interrupt
signals a waiting thread that its "event" has arrived.
So, up() has to be irq safe.

down()/down_interruptible() don't matter for irq level,
since they can't/shouldn't be called with interrupts off,
or in an interrupt handler. They are interrupt safe,
however, since up() is interrupt safe, and so
that means the sleeping down's have to be interrupt safe
to work correctly. By "interrupt safe" I mean that the
code will work correctly in the presense of interrupts.

regards,

ananth.

-
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.047 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site