Re: L1/L2 Cache Coloring from Userland ?

Alan Cox (alan@lxorguk.ukuu.org.uk)
Thu, 18 Sep 1997 19:13:00 +0100 (BST)


> Am I correct in assuming that a block that starts out as physically
> contiguous may be fragmented when it is swapped out and in again ? Is there
> another way in which this fragmentation can happpen ? I'm not too well
> versed in the mm aspects of the kernel.

Yes. However if you wanted to stop that for specific cases and then measure
the mapping and work it out an mlock will do the right thing.

> If blocks only fragment on swap, it should be enough to disable swap on the
> machine in question (a calculation server which should *never* be swapping
> anyway), and to determine if a block is physically contiguous to start
> with. Is there such a thing as a VirtualToPhysical syscall, a call that can
> be misused to do this, or should I take the Source and start hacking ?

A virt_to_phys syscall for userspace ought to be doable.

Alan