* sem_is_locked()
@ 2004-09-22 11:11 William Lee Irwin III
2004-09-22 11:14 ` sem_is_locked() Matthew Wilcox
2004-09-22 11:26 ` sem_is_locked() Andi Kleen
0 siblings, 2 replies; 6+ messages in thread
From: William Lee Irwin III @ 2004-09-22 11:11 UTC (permalink / raw)
To: linux-arch
hch and some others (e.g. moi) trying to do vfs sweeps would very much
like to have a sem_is_locked() to assist them; by any chance could arch
maintainers help out with implementing this for various arches?
Thanks.
-- wli
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sem_is_locked()
2004-09-22 11:11 sem_is_locked() William Lee Irwin III
@ 2004-09-22 11:14 ` Matthew Wilcox
2004-09-22 11:26 ` sem_is_locked() Andi Kleen
1 sibling, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2004-09-22 11:14 UTC (permalink / raw)
To: William Lee Irwin III; +Cc: linux-arch
On Wed, Sep 22, 2004 at 04:11:39AM -0700, William Lee Irwin III wrote:
> hch and some others (e.g. moi) trying to do vfs sweeps would very much
> like to have a sem_is_locked() to assist them; by any chance could arch
> maintainers help out with implementing this for various arches?
asm-parisc/semaphore.h already has a sem_getcount(). If you choose a
different name for it, please just rename it.
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sem_is_locked()
2004-09-22 11:11 sem_is_locked() William Lee Irwin III
2004-09-22 11:14 ` sem_is_locked() Matthew Wilcox
@ 2004-09-22 11:26 ` Andi Kleen
2004-09-22 11:35 ` sem_is_locked() Russell King
1 sibling, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2004-09-22 11:26 UTC (permalink / raw)
To: William Lee Irwin III; +Cc: linux-arch
On Wed, Sep 22, 2004 at 04:11:39AM -0700, William Lee Irwin III wrote:
> hch and some others (e.g. moi) trying to do vfs sweeps would very much
> like to have a sem_is_locked() to assist them; by any chance could arch
> maintainers help out with implementing this for various arches?
On x86-64/i386 and probably most other architectures it is just
atomic_read(&sem->count) <= 0
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sem_is_locked()
2004-09-22 11:26 ` sem_is_locked() Andi Kleen
@ 2004-09-22 11:35 ` Russell King
2004-09-22 11:51 ` sem_is_locked() Andi Kleen
0 siblings, 1 reply; 6+ messages in thread
From: Russell King @ 2004-09-22 11:35 UTC (permalink / raw)
To: Andi Kleen; +Cc: William Lee Irwin III, linux-arch
On Wed, Sep 22, 2004 at 01:26:53PM +0200, Andi Kleen wrote:
> On Wed, Sep 22, 2004 at 04:11:39AM -0700, William Lee Irwin III wrote:
> > hch and some others (e.g. moi) trying to do vfs sweeps would very much
> > like to have a sem_is_locked() to assist them; by any chance could arch
> > maintainers help out with implementing this for various arches?
>
> On x86-64/i386 and probably most other architectures it is just
> atomic_read(&sem->count) <= 0
Obviously, generic code should not assume that a semaphore is
implemented using atomic_t.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: sem_is_locked()
2004-09-22 11:35 ` sem_is_locked() Russell King
@ 2004-09-22 11:51 ` Andi Kleen
2004-09-22 11:58 ` sem_is_locked() William Lee Irwin III
0 siblings, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2004-09-22 11:51 UTC (permalink / raw)
To: Andi Kleen, William Lee Irwin III, linux-arch
On Wed, Sep 22, 2004 at 12:35:52PM +0100, Russell King wrote:
> On Wed, Sep 22, 2004 at 01:26:53PM +0200, Andi Kleen wrote:
> > On Wed, Sep 22, 2004 at 04:11:39AM -0700, William Lee Irwin III wrote:
> > > hch and some others (e.g. moi) trying to do vfs sweeps would very much
> > > like to have a sem_is_locked() to assist them; by any chance could arch
> > > maintainers help out with implementing this for various arches?
> >
> > On x86-64/i386 and probably most other architectures it is just
> > atomic_read(&sem->count) <= 0
>
> Obviously, generic code should not assume that a semaphore is
> implemented using atomic_t.
Sure, but with that fact it's pretty easy to implement the macro
wli wants for most architectures.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sem_is_locked()
2004-09-22 11:51 ` sem_is_locked() Andi Kleen
@ 2004-09-22 11:58 ` William Lee Irwin III
0 siblings, 0 replies; 6+ messages in thread
From: William Lee Irwin III @ 2004-09-22 11:58 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-arch
On Wed, Sep 22, 2004 at 12:35:52PM +0100, Russell King wrote:
>> Obviously, generic code should not assume that a semaphore is
>> implemented using atomic_t.
On Wed, Sep 22, 2004 at 01:51:03PM +0200, Andi Kleen wrote:
> Sure, but with that fact it's pretty easy to implement the macro
> wli wants for most architectures.
This sounds like I should just sweep them all and drop it in, as no
one is concerned much about the details. All's well, it seems.
-- wli
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-09-22 11:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-22 11:11 sem_is_locked() William Lee Irwin III
2004-09-22 11:14 ` sem_is_locked() Matthew Wilcox
2004-09-22 11:26 ` sem_is_locked() Andi Kleen
2004-09-22 11:35 ` sem_is_locked() Russell King
2004-09-22 11:51 ` sem_is_locked() Andi Kleen
2004-09-22 11:58 ` sem_is_locked() William Lee Irwin III
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox