Re: [PATCH 1/2] Unpinned futexes v2 - part 1: indexing changes

From: Jamie Lokier
Date: Fri Sep 05 2003 - 12:56:04 EST


Linus Torvalds wrote:
> > (The next patch in this series fixes mremap()).
>
> I don't think this one is worth it. If the user unmaps or changes the
> mapping from under the futex, I just think that is "user error". And the
> same way it is totally undefined what happens if one thread re-organizes
> the VM space while another thread may be doing some other operation
> (read() or similar), we just don't care.

I agree for synchronous futexes, the inherent race conditions do
make it "user error".

For async futexes (FUTEX_FD), I think it has a well-defined and
potentially useful meaning to move futexes on remapping, if that's
what the program wants to do.

It's well-defined for shared mappings, and then it's even useful
(think database with locks distributed in an 8GB file). So it's a
little odd for it to fail for private mappings.

I'm not wedded to the idea. Just so long as it's mentioned in "man
futex" under "don't do this".

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/