Re: [patch] 'sticky pages' support in the VM, futex-2.5.38-C5

Linus Torvalds (torvalds@transmeta.com)
Fri, 4 Oct 2002 16:20:01 -0700 (PDT)


On Fri, 4 Oct 2002, Jamie Lokier wrote:
>
> I thought that futex-based locks were only reliable with PROT_SEM
> memory, for architectures that define PROT_SEM (e.g. PPC) -- because of
> the need for locking primitives to work in a cache coherent manner.

That was my initial thought, to make it portable.

It turns out that all the real uses of it want to just be able to use it
in a less portable manner, and put futexes anywhere, and in particular in
perfectly regular anonymous memory.

And since that works fine on all sane hardware, the point of PROT_SEM and
special casing just wasn't really there.

Does that mean that such common futex usage won't be portable to broken
hardware? Yup. The alternative was to make things cumbersome for
_everybody_, and since 99.9% of all existing hardware is sane (and the
remaining insane hw base tends to be going away anyway), it looks like it
was the right decision.

So now glibc can (and does) put semaphores on the stack etc random places,
without having to worry about it.

Linus

-
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/