[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] TLB design

----- Original Message -----
From: "Martin Devera" <devik@cdi.cz>
To: <f-cpu@seul.org>
Sent: Monday, July 15, 2002 10:54 AM
Subject: Re: [f-cpu] TLB design

> > > > - used bit (indicating that the page has been accessed)
> > > Why not a counter ? I currently don't see how the OS can make it's
> > > about how to remove a TLB entry if TLB is full.
> >
> > A counter would be more expensive (and would take more bits).
> >
> > The OS will have to scan (and reset) the `used' bits on a regular basis
> > (e.g. inside a (slow) timer interrupt) and record the entries that have
> > been used. The entry that has been used least recently can be replaced.
> Counter is not useable. It is because you often got multiple accesses
> in burst and this would make it overflow quicly. Rather you need to
> count these burst to get LFU replacement strategy which is emulated
> in 2.4.10 and latest BSDs.
> What would help and what is pain in current linux mm is timestamp of
> last access. But yes - it is unfortunately space expensive.
> devik

Oh well i supose we can have a saturate counter ? no, i'm joking :)

Usually a SW TLB raises an exception when a miss cache occurs, so we can
timestamped the page discarded (linux for example have a info block per
physical page) and use it when a slow timer is walking the info blocks to
lookup for a ideal candidate (timestamp least recent I think). I suppose of
course that there is much more physical pages than entries in TLB.

To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/