Re: aio-core why not using SuS? [Re: [rfc] aio-core for 2.5.29 (Re:

Linus Torvalds (torvalds@transmeta.com)
Sat, 17 Aug 2002 10:02:23 -0700 (PDT)


On Fri, 16 Aug 2002, Martin J. Bligh wrote:
>
> I don't see why the area above PAGE_OFFSET has to be global, or per
> VM (by which I'm assuming you're meaning the set of pagetables per
> process, aka group of tasks sharing an mm).

Basic issue: if the VM's aren't _identical_ (in every way, including the
kernel one), they cannot share the page tables in an SMP environment with
two threads running on two CPU's at the same time.

And once you cannot share the page tables, you're screwed.

> Assume 3 level page tables and a 3/1 user/kernel split for the sake
> of argument.

No, no, that's the wrong way to go about it. You have to show a _portable_
way to do it, not a "if I assume this, I can do it".

For example, on x86 with the regular 2-level page tables, if you want to
have different kernel mappings, you have to copy the page directory
per-CPU, and then on task switch you have to change the PGD appropriately.

Which, btw, means that you have to invalidate the TLB for that CPU, even
if you would otherwise not have needed to. Look at how the lazy TLB
switching works, and realize that two threads can _switch_ CPU's as things
stand now, without ever a single TLB invalidate happening. They can take
over the TLB of the other thread when they move to another CPU. You'd
break that, horribly and fundamentally.

So to make this work, you'd have to have:
- architecture-specific hacks
- realize that not all architectures can do it at all, so the places that
depend on this would have to have some abstraction that makes it go
away when not needed.
- fix up lazy TLB switching (conditionally on the hack).

It just sounds really messy to me.

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/