Subject: Re: [PATCH] powerpc: thp: Use tlbiel wherever possible

From: "Aneesh Kumar K.V" <[email-masked]>
Date: Thu, 07 Aug 2014 11:34:45 +0530

Benjamin Herrenschmidt <[email-masked]> writes:

> On Wed, 2014-08-06 at 20:16 +0530, Aneesh Kumar K.V wrote:
>> "Aneesh Kumar K.V" <[email-masked]> writes:
>> 
>> > If we know that user address space has never executed on other cpus
>> > we could use tlbiel.
>> >
>> > Signed-off-by: Aneesh Kumar K.V <[email-masked]>
>> 
>> Now checking against flush_hash_page, I am wondering whether I need to handle
>> transcational memory in case of tlbiel ? Michael, can you let me know if
>> this is needed ?
>
> Also, beware that we have code that sets "tlbiel" in the page definition
> array to 0 on all but 4k and 64k pages...
>

Ok we use base page size to determine whether we can use tlbiel or not. 

static inline void tlbie(unsigned long vpn, int psize, int apsize,
			 int ssize, int local)
{
....
	if (use_local)
		use_local = mmu_psize_defs[psize].tlbiel;

With that we should be ok, because we are using 4k and 64k base page
size and we have

/*
 * We don't know for sure what's up with tlbiel, so
 * for now we only set it for 4K and 64K pages
 */
if (base_idx == MMU_PAGE_4K || base_idx == MMU_PAGE_64K)
	def->tlbiel = 1;
else
	def->tlbiel = 0;

-aneesh