603 support

Benjamin Herrenschmidt mol-devel@lists.maconlinux.org
Thu, 2 May 2002 21:04:22 +0200


>It all depends on who you're talking to.  If you design PPCs for a
>living, linux doesn't use the PPC page tables, but instead uses
>something else entirely, call it a linux page table.  At any rate, I
>accept that the convention in linux mailing lists is that the PPC page
>table is called a hash table, and will try and remember to use that
>terminology.

Well, sorry for the confusion ;) Since it is actually a hash table,
and since linux used to call it's own page tables "page tables", it's
indeed a convention in the linux kernel to call the PPC HW table the
"hash" table, and the linux ones the "page tables", thougt I always
try to write "Linux page tables". In the same idea, we use PTE for
a linux page table entry, and HPTE for a HW hash table entry.

>I think this is being a little harsh.  It doesn't emulate the hash
>table, it emulates the hardware to search the hash table.  In other
>words, old kernel 2.2 does what the 603 was designed to do until we
>figured out how to be sneaky and do something that provides better
>performance.

Right.

>> The performance of the whole kernel is much better when loading the
>> TLBs directly from the linux page tables, so it would be better
>> to make MOL work with it instead of relying on the old behaviour.
>
>I agree.  But it currently fails to work, doesn't it?  :)
>
>I realize that forcing the kernel to use hash tables on the 603 is a
>hack, as they were removed for a reason.  This would be a quick fix
>until the real code was fixed.

Well, it isn't a quick fix to bring back the 603 hash table reload
code to 2.4, and I won't let that happen ;)

>Yes, but it's a matter of a few simple exception handlers.  If you put
>the code in for those and do them right, the kernel doesn't have to be
>any the wiser about the fact that it's software doing the lookups.  It
>just gets told "put this memory here and keep it there," and that's all
>it needs to know about the hardware not really supporting hash table
>lookups.  That was the whole point of the 603 design.  Why spend the
>area on something easily done in software?  If my understanding of the
>performance difference of hash table lookups between the 603 and 604 is
>correct, this was a good call, as the performance difference isn't that
>big.

The fact is that linux MM usage seems to be more efficient with
the 603 way, at least according to that old paper Paulus and Cort
wrote, though the PPC MM have changed quite a bit in the meantime,
maybe it's worth benching again.

>The trick that linux does happens to improve performance, but it wasn't
>the original intention of the design.
>
>At any rate, I'll see what I can do to improve things.

Sure, I (fortunately ? :) don't own a 603 machine either, so...

Ben