Re: [rfc] no ZERO_PAGE?

Linus Torvalds
2007-04-04T16:14:14Z

On Wed, 4 Apr 2007, Hugh Dickins wrote:

> On Wed, 4 Apr 2007, Andrea Arcangeli wrote:
> > On Wed, Apr 04, 2007 at 04:03:15PM +0100, Hugh Dickins wrote:
> > > Maybe Nick will decide to not to mark the readfaults as dirty.
> >
> > I don't like to mark the pte readonly and clean,
>
> Nor I: I meant that anonymous readfault should
> (perhaps) mark the pte writable but clean.

Maybe. On the other hand, marking it dirty is going to be almost as
expensive as taking the whole page fault again. The dirty bit is in
software on a lot of architectures, and even on x86 where it's in hw, all
microarchitectures basically consider it a micro-trap, and some of them
(*cough*P4*cough*) are really bad at it.

So I'd actually rather just mark it dirty too, because that way there is a
real potential performance upside to go with the real potential
performance downside, and we can hope that it all comes out even in the
end ;)

Linus

PS. Yes, I wrote the benchmark. On at least some versions of the P4, just
setting the dirty bit took 1500 cycles.. No sw-visible traps, just a *lot*
of cycles to clean out the pipeline entirely, do a micro-trap, and
continue. Of course, the P4 sucks at these things, but the point is that
it can be as expensive to do it "in hardware" as doing it in software if
the hardware is mis-designed..