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

"David S. Miller" wrote:
>
> Date: Fri, 25 Feb 2000 15:11:38 -0800
> From: Rajagopal Ananthanarayanan <ananth@sgi.com>
>
> Right, if it were a sleep point, I agree.
> But my understanding is that down_trylock()
> is not one of those: isn't it used for conditionally
> acquiring the semaphore?
>
> True, sorry, thinko.
>
> But still, my other point holds, you should not IRQ disable
> when performing semaphore operations.
>

Sorry for being thick-headed about this; its been a while
since my OS 101 ;-).

You only said, to quote your first message:

You should not acquire a semaphore with interrupts disabled.

Why not?

As far as I can see, the only problem is if the interrupt
is "locked" out trying to acquire the semaphore. This can't
happen since interrupts are disabled. But this line of
thought is probably not what you had in mind, since no
matter what code has the semaphore (interrupts disabled or
not), an interrupt should not be locked out trying to
acquire a semaphore unconditionally.

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