Subject: Re: LKM support
To: Curt Sampson <email@example.com>
From: Bill Sommerfeld <firstname.lastname@example.org>
Date: 11/12/1996 08:48:23
> > On some systems (typically those using inverted page tables or
> > virtually-addressed caches; I'm thinking in particular of the IBM RT
> > and the HP PA...), random page-flipping like this can be more
> > expensive than copying, because you can't have a page mapped at
> > "random" virtual addresses at the same time in different processes, so
> > you have to flush one mapping, flush/purge any references in the cache
> > to that page, and take a sharing fault when you need the original
> > mapping again.
> This is curious. How do these systems deal with two processes doing
> an mmap() on the same file starting at different addresses?
As I understand it (this is based on what other people have told me,
and not based on direct experimentation with HP-UX):
If the two VA's you map it in at are equal modulo the cache size, you
win. This doesn't, in general, happen by chance, but will happen if
both requestors let the system choose the VA at which to map the file.
Otherwise, the VM system only lets one process have a "live" mapping
at a time.. when one process faults the page in, the system has to
purge all other mappings, flush any data cache entries for the old
page, and (possibly -- I'm not certain of this) purge any cache
entries for the new page before installing the new TLB entry mapping
the page at the new VA. This is a lot of work..