From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Balbir Singh <bsingharora@gmail.com>,
benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/mm/hash: Clear the invalid slot information correctly
Date: Sat, 20 Feb 2016 20:04:27 +0530 [thread overview]
Message-ID: <8737sne9ho.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <56C6FCDD.8010302@gmail.com>
Balbir Singh <bsingharora@gmail.com> writes:
...........
............
>> diff --git a/arch/powerpc/mm/hugepage-hash64.c b/arch/powerpc/mm/hugepage-hash64.c
>> index 49b152b0f926..8424f46c2bf7 100644
>> --- a/arch/powerpc/mm/hugepage-hash64.c
>> +++ b/arch/powerpc/mm/hugepage-hash64.c
>> @@ -78,9 +78,14 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
>> * base page size. This is because demote_segment won't flush
>> * hash page table entries.
>> */
>> - if ((old_pmd & _PAGE_HASHPTE) && !(old_pmd & _PAGE_COMBO))
>> + if ((old_pmd & _PAGE_HASHPTE) && !(old_pmd & _PAGE_COMBO)) {
>> flush_hash_hugepage(vsid, ea, pmdp, MMU_PAGE_64K,
>> ssize, flags);
>> + /*
>> + * clear the old slot information
>> + */
> Redundant comment, something more useful? why clear it?
>> + memset(hpte_slot_array, 0, PTE_FRAG_SIZE);
>> + }
>> }
>>
explained in the commit message.
With THP, we also clear the slot information with respect to all
the 64K hash pte mapping that 16MB page. They are all invalid
now. This make sure we don't find the slot valid when we fault with
4k base page size. Finding the slot valid should not result in any wrong
behavior because we do check again in hash page table for the validity.
But we can avoid that check completely.
>> valid = hpte_valid(hpte_slot_array, index);
prev parent reply other threads:[~2016-02-20 14:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-18 16:44 [PATCH] powerpc/mm/hash: Clear the invalid slot information correctly Aneesh Kumar K.V
2016-02-19 5:53 ` Anshuman Khandual
2016-02-19 10:37 ` Michael Ellerman
2016-02-20 14:32 ` Aneesh Kumar K.V
2016-02-20 15:13 ` Aneesh Kumar K.V
2016-02-19 11:30 ` Balbir Singh
2016-02-20 14:34 ` Aneesh Kumar K.V [this message]
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=8737sne9ho.fsf@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=bsingharora@gmail.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).