It's a judgement call: how simple it is to change vs. the amount of
damage done by not changing it.
I don't think it's worth changing, but I don't think we're going to
convince each other.
> > Comment says: /* Must be "naturally" aligned */. This used to be true
> > in a much earlier version of the code, now AFAICT the requirement test
> > should be:
> >
> > /* Handling futexes on multiple pages? -ETOOHARD */
> > if (pos_in_page + sizeof(u32) > PAGE_SIZE)
> > return -EINVAL;
>
> yes - but i'd rather enforce this for every futex, than to hit it in every
> 1000th app that manages to misalign a futex _and_ lay it across two pages.
Good point. I'd prefer to fix the comment though, since it's not
true. How about changing it to something like:
/* We can't handle futexes across multiple pages: best to reject
any crazy alignment to save the users from themselves. */
> Also, it's only x86 that guarantees atomic instructions on misaligned
> futexes (even then it comes with a cycle penalty), are you sure this also
> works on other architectures? So i'd rather be a bit more strict with this
> requirement.
Sure. My point was that this comment is actually from a v. early futex
version where the kernel actually did the atomic ops itself.
Hope that clarifies!
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/