tlb flushing on Power

Seth Jennings sjenning at linux.vnet.ibm.com
Thu Feb 9 04:39:32 EST 2012


Hey Ben,

Thanks for responding.

On 01/26/2012 03:39 PM, Benjamin Herrenschmidt wrote:
> On Thu, 2012-01-26 at 08:41 -0600, Brian King wrote:
>> CC'ing linuxppc-dev...
>>
>>
>> On 01/26/2012 08:18 AM, Seth Jennings wrote:
>>> Hey Dave,
>>>
>>> So I submitted the zsmalloc patches to lkml at the beginning
>>> of the year
>>>
>>> https://lkml.org/lkml/2012/1/9/389
>>>
>>> I found there are two functions Nitin used in the mapping
>>> functions that are not supported in the powerpc arch:
>>> set_pte() and __flush_tlb_one().
> 
>  .../...
> 
> The arch management of page tables can be tricky indeed :-) I need to
> have a better understanding of what you are doing to see how I can try
> to adapt it to power.

You can look at https://lkml.org/lkml/2012/1/9/389 in zsmalloc-main.c,
zs_[un]map_object() functions for the currently uses of set_pte() and
__flush_tlb_one().

> set_pte() is long gone on all archs really (or if it's still there it's
> not meant to be used as is), use set_pte_at().

Problem with set_pte_at() for us is that we don't have an mm_struct to pass
because the mapping is not for a userspace process but for the kernel itself.

However, I do think this is the portable function we need to be using. Just
need to figure out what to pass in for the mm_struct param.

> __flush_tlb_one() doesn't mean anything as an arch independent
> functionality. We have a local_flush_tlb_page() that -might- do what you
> want but why in hell is that patch not using proper existing
> interfaces ?

flush_tlb_page() is the portable function we should be using.  However,
again, it requires a vma_area_struct.  I'm not sure what we should be
passing there.

--
Seth



More information about the Linuxppc-dev mailing list