[RFC][PATCH] remove section mappinng

Paul Mackerras paulus at samba.org
Sat Jan 26 12:24:59 EST 2008


Badari Pulavarty writes:

> Here is the code I cooked up, it seems to be working fine.
> But I have concerns where I need your help.
> 
> In order to invalidate htab entries, we need to find the "slot".
> But I can only find the hpte group. Is it okay to invalidate the
> first entry in the group ? Do I need to invalidate the entire group ?

You do need to find the correct slot.  (I suppose you could invalidate
the entire group, but that would be pretty gross.)

Note that in the CONFIG_DEBUG_PAGEALLOC case we use 4k pages and keep
a map of the slot numbers in linear_map_hash_slots[].  But in that
case I assume that the generic code would have already unmapped all
the pages of the LMB that you're trying to hot-unplug.

In the non-DEBUG_PAGEALLOC case on a System p machine, the hash table
will be big enough that the linear mapping entries should always be in
slot 0.  So just invalidating slot 0 would probably work in practice,
but it seems pretty fragile.  We might want to use your new
htab_remove_mapping() function on a bare-metal system with a smaller
hash table in future, for instance.

Have a look at pSeries_lpar_hpte_updateboltedpp.  It calls
pSeries_lpar_hpte_find to find the slot for a bolted HPTE.  You could
do something similar.  In fact maybe the best approach is to do a
pSeries_lpar_hpte_remove_bolted() and not try to solve the more
general problem.

Paul.



More information about the Linuxppc-dev mailing list