[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [f-cpu] TLB design
> > > I've been thinking about the TLB before; IMHO, we need at least the
> > > following (assuming <n> bits for the page offset):
> > >
> > > - virtual address (64-<n> bits)
> > > - physical address (64-<n> bits)
> > > - address space identifier (ASI; 8 bits was suggested)
> > > - supervisor access rights (RWX, 3 bits)
> > > - user access rights (RWX, 3 bits)
> > > - valid bit (indicating that the entry is valid)
> > > - present bit (indicating that the page is in memory)
> > What did you mean whith this bit ?
> If the bit is set, the page is mapped to physical ram. If it is
> cleared, a page fault occurs.
So what is the difference with valid bit. I think you have the same
idea as cristophe for this two bits. From my point of view only one
is useful, because when you don't map to physical ram you will always
trap and look where to put you new entry, same as with the valid bit.
> > > - dirty bit (indicating that the page has been written to)
> > Same question.
> It's used for memory management inside the OS. If a page is dirty, it
> must be written back to permanent storage; if it's not, it can be
> simply discarded to make room for something else.
Ok, I now see how to use it.
> > > - 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 decision
> > 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.
In fact, it was only a dream ;-) Previously I wanted a lot of TLB page size
and you give an answer to me, so I ask more ;-)
> > > The latter can be used to implement an LRU algorithm.
> > > That is, we need 128+2*<n>-18 bits. If an entry shall fit into 128 bits,
> > > <n> must be at least 9 (i.e. a page must have at least 512 bytes).
> > > With 4K pages, we will have 6 bits left. Some (or all) of them may be
> > > used to indicate the page size.
> > That's a really nice idea in fact. But what did this bit mean, are they
> > number of Ko for a page, or predefined size page ?
> Anything you like. I'd say: pagesize = 4K << sizebits; but that is my
> personal opinion.
You mean that I can do a page of : (4 << 64) K ? I think that with your system
we can be ready for the future ;-)
To unsubscribe, send an e-mail to firstname.lastname@example.org with
unsubscribe f-cpu in the body. http://f-cpu.seul.org/