Re: process creation time increases linearly with shmem

From: Hugh Dickins
Date: Fri Aug 26 2005 - 13:55:27 EST


On Fri, 26 Aug 2005, Ross Biro wrote:
> On 8/26/05, Rik van Riel <riel@xxxxxxxxxx> wrote:
> >
> > Filling in all the page table entries at the first fault to
> > a VMA doesn't make much sense, IMHO.
> >
> > I suspect we would be better off without that extra complexity,
> > unless there is a demonstrated benefit to it.
>
> You are probably right, but do you want to put in a patch that might
> have a big performance impact in either direction with out verifying
> it?
>
> My suggestion is safe, but most likely sub-optimal. What everyone
> else is suggesting may be far better, but needs to be verified first.

It all has to be verified, and the problem will be that some things
fare well and others badly: how to reach a balanced decision?
Following your suggestion is no more safe than not following it.

> I'm suggesting that we change the code to do the same work fork would
> have done on the first page fault immediately, since it's easy to
> argue that it's not much worse than we have now and much better in
> many cases, and then try to experiment and figure out what the
> correct solution is.

We don't know what work fork would have done, that information was in
the ptes we decided not to bother to copy. Perhaps every pte of the
vma was set, perhaps none, perhaps only one.

Also, doing it at fault time has significantly more work to do than
just zipping along the ptes incrementing page counts and clearing bits.
I think; but probably much less extra work than I originally imagined,
since Andrew gave us the gang lookup of the page cache.

All the same, I'm with Rik: one of the great virtues of the original
idea was its simplicity; I'd prefer not to add complexity.

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