linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: paulus@samba.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/2] powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault
Date: Tue, 02 Dec 2014 12:25:02 +0530	[thread overview]
Message-ID: <87mw76h77d.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1417480795.31336.4.camel@concordia>

Michael Ellerman <mpe@ellerman.id.au> writes:

> On Mon, 2014-11-03 at 20:21 +0530, Aneesh Kumar K.V wrote:
>> upatepp get called for a nohpte fault, when we find from the linux
>> page table that the translation was hashed before. In that case
>> we are sure that there is no existing translation, hence we could
>> avoid doing tlbie.
>
> We are sure there *was* no existing translation. It's possible that since the
> nohpte fault occurred the translation has been loaded into the tlb.
>
> Ben says that's OK, because updatepp is only ever relaxing permissions. But
> please add some explanation of that to the changelog - it's not obvious.
>
>> @@ -322,8 +322,15 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
>>  		}
>>  		native_unlock_hpte(hptep);
>>  	}
>> -	/* Ensure it is out of the tlb too. */
>> -	tlbie(vpn, bpsize, apsize, ssize, local);
>> +
>> +	if (flags & HPTE_LOCAL_UPDATE)
>> +		local = 1;
>> +	/*
>> +	 * Ensure it is out of the tlb too if it is not a nohpte fault
>> +	 */
>> +	if (!(flags & HPTE_NOHPTE_UPDATE))
>> +		tlbie(vpn, bpsize, apsize, ssize, local);
>> +
>>  	return ret;
>>  }
>
> The context preceeding this hunk includes this comment:
>
> 	/*
> 	 * We need to invalidate the TLB always because hpte_remove doesn't do
> 	 * a tlb invalidate. If a hash bucket gets full, we "evict" a more/less
> 	 * random entry from it. When we do that we don't invalidate the TLB
> 	 * (hpte_remove) because we assume the old translation is still
> 	 * technically "valid".
> 	 */
>
> Which seems out of sync with the code now.

The comment is still valid. What it explain is the part that, even if we
didn't find hash pte matching we still need to do a tlbie. We don't look
at the nohpte fault details in the comment.

-aneesh

  reply	other threads:[~2014-12-02  6:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 14:51 [PATCH 1/2] powerpc/mm: Check for matching hpte without taking hpte lock Aneesh Kumar K.V
2014-11-03 14:51 ` [PATCH 2/2] powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault Aneesh Kumar K.V
2014-12-01 23:59   ` Benjamin Herrenschmidt
2014-12-02  6:51     ` Aneesh Kumar K.V
2014-12-02  0:39   ` Michael Ellerman
2014-12-02  6:55     ` Aneesh Kumar K.V [this message]
2014-12-02  3:09   ` Benjamin Herrenschmidt
2014-12-02  5:01     ` Aneesh Kumar K.V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mw76h77d.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).