linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Michael Ellerman <mpe@ellerman.id.au>,
	Reza Arbab <arbab@linux.ibm.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: Charles Johns <crjohns@us.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] powerpc/mm: Add _PAGE_SAO to _PAGE_CACHE_CTL mask
Date: Fri, 1 Feb 2019 16:02:10 +1100	[thread overview]
Message-ID: <b25efaaa-a559-9223-a830-68b4f9a9ed3e@ozlabs.ru> (raw)
In-Reply-To: <87fttap8tc.fsf@concordia.ellerman.id.au>



On 31/01/2019 00:35, Michael Ellerman wrote:
> Reza Arbab <arbab@linux.ibm.com> writes:
> 
>> On Tue, Jan 29, 2019 at 08:37:28PM +0530, Aneesh Kumar K.V wrote:
>>> Not sure what the fix is about. We set the related hash pte flags via
>>>
>>> 	if ((pteflags & _PAGE_CACHE_CTL) == _PAGE_TOLERANT)
>>> 		rflags |= HPTE_R_I;
>>> 	else if ((pteflags & _PAGE_CACHE_CTL) == _PAGE_NON_IDEMPOTENT)
>>> 		rflags |= (HPTE_R_I | HPTE_R_G);
>>> 	else if ((pteflags & _PAGE_CACHE_CTL) == _PAGE_SAO)
>>> 		rflags |= (HPTE_R_W | HPTE_R_I | HPTE_R_M);
>>
>> Again, nothing broken here, just a code readability thing. As Alexey 
>> (and Charlie) noted, given the above it is a little confusing to define 
>> _PAGE_CACHE_CTL this way:
>>
>>   #define _PAGE_CACHE_CTL      (_PAGE_NON_IDEMPOTENT | _PAGE_TOLERANT)
> 
> Yeah that's confusing I agree.
> 
> It's not really a maintainability thing, because those bits are in the
> architecture, so they can't change.
> 
>> I like Alexey's idea, maybe just use a literal?
>>
>>   #define _PAGE_CACHE_CTL 0x30
> 
> I prefer your original patch. It serves as documentation on what values
> we expect to see in that field.


As documentation, it gives an idea that there can be both
_PAGE_NON_IDEMPOTENT and _PAGE_TOLERANT set which is not true. Putting
possible values in the comment next to "#define _PAGE_CACHE_CTL" will
document it properly imho.



-- 
Alexey

  reply	other threads:[~2019-02-01  5:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28 17:31 [PATCH] powerpc/mm: Add _PAGE_SAO to _PAGE_CACHE_CTL mask Reza Arbab
2019-01-29  1:39 ` Alexey Kardashevskiy
2019-01-29 15:07 ` Aneesh Kumar K.V
2019-01-29 17:03   ` Reza Arbab
2019-01-30 13:35     ` Michael Ellerman
2019-02-01  5:02       ` Alexey Kardashevskiy [this message]
2019-02-08 13:02 ` Michael Ellerman

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=b25efaaa-a559-9223-a830-68b4f9a9ed3e@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=arbab@linux.ibm.com \
    --cc=crjohns@us.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).