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

Re: [f-cpu] TLB design



> > > - 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 ?
> 
> Present bit is absolutely necessary for HW tlb, it is to say that entry
> is not a valid mapping and help us to raise an exception to fix it.

For my point of view you valid page or not, normally you only have entry
in the TLB that are corresponding to memory. So what is the difference
between this two bits ?

> We use it to implement virtual memory swapping from/to mass storage.

Ok, but that's not a clean method. The VM detect that's you need to swap,
so she select a page to swap and remove them from the virtual address space.
Then they are transfered to the disk. When the task wake up, and access
to this page you make a TLB miss, and you start to remove some other from
the virtual address space to the disk and then you put the other to the new
free space and set entry in the TLB.

For me, you don't have enough entry into the TLB to say that some of them
are mapped to disk, and on rescent computer the swap are not so much use
(database program prefer to have their own save polici).

> But I don't know if it is necessary for SW tlb, I thought SW tlb only
> contained valid page entries (since if not in TLB, it always raises an
> exception).

For me, it's a SW problem, that can take place in userspace, so really no
need in HW.

> > > - dirty bit (indicating that the page has been written to)
> > Same question.
> 
> This page was modified by someone so we could need to synchronise with
> external storage, it is absolutely necessary for virtual memory and
> file mapping.

You mean Copy On Write technique ?
 
> > > - 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.
 
> It is the only way to know if this page was accessed at least one time,
> absolutely necessary for virtual memory. Counter is interesting but
> still a luxe.
Ok, I understand.

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