Re: Syslets, Threadlets, generic AIO support, v6

From: Linus Torvalds
Date: Wed May 30 2007 - 17:29:25 EST




On Wed, 30 May 2007, Ulrich Drepper wrote:
>
> I don't like special cases. For me things better come in quantities 0,
> 1, and unlimited (well, reasonable high limit). Otherwise, who gets to
> use that special namespace? The C library is not the only body of code
> which would want to use descriptors.

Well, don't think of it as a special case at all: think of bit 30 as a
"the user asked for a non-linear fd".

In fact, to make it effective, I'd suggest literally scrambling the low
bits (using, for example, some silly per-boot xor value to to actually
generate the "true" index - the equivalent of a really stupid randomizer).

That way you'd have the legacy "linear" space, and a separate "non-linear
space" where people simply *cannot* make assumptions about contiguous fd
allocations. There's no special case there - it's just an extension which
explicitly allows us to say "if you do that, your fd's won't be allocated
the traditional way any more, but you *can* mix the traditional and the
non-linear allocation".

> And then the semantics: do these descriptors should show up in
> /proc/self/fd? Are there separate directories for each namespace? Do
> they count against the rlimit?

Oh, absolutely. The'd be real fd's in every way. People could use them
100% equivalently (and concurrently) with the traditional ones. The whole,
and the _only_ point, would be that it breaks the legacy guarantees of a
dense fd space.

Most apps don't actually *need* that dense fd space in any case. But by
defaulting to it, we wouldn't break those (few) apps that actually depend
on it.

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