Fortuntely, it doesn't need to be atomic. This got me too, but Paul
Mackerras convinced me.
We don't care if someone decrements it between us checking < 0 and
doing the atomic_dec_and_test. So the only thing we worry about is
the "up" case. A userspace "up" will go into the kernel (since count
< 0), and the kernel "up" will wake us since we are on the queue
before we do this test.
> > PS. Will Alpha have to do any special magic with the mmap PROT_SEM flag?
>
> No.
Damn, I was hoping to find out which arch actually is going to use
this. I hate untested code.
Thanks!
Rusty.
-- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - 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/