mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hongchen Zhang <zhanghongchen@loongson.cn>
To: David Hildenbrand <david@redhat.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Mike Rapoport IBM)" <rppt@kernel.org>,
	Feiyang Chen <chenfeiyang@loongson.cn>,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	"Matthew Wilcox Oracle)" <willy@infradead.org>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
	loongson-kernel@lists.loongnix.cn
Subject: Re: [PATCH] LoongArch: add p?d_leaf() definitions
Date: Wed, 6 Sep 2023 16:06:39 +0800	[thread overview]
Message-ID: <4a06f415-281f-b76f-ed03-211b07ccd6a4@loongson.cn> (raw)
In-Reply-To: <d6012fe0-9d06-f5ac-857c-c38034bf0758@redhat.com>

Hi David,

On 2023/9/6 pm 3:42, David Hildenbrand wrote:
> On 05.09.23 08:49, Hongchen Zhang wrote:
>> When I do LTP test, LTP test case ksm06 caused panic at
>>     break_ksm_pmd_entry
>>       -> pmd_leaf (Huge page table but False)
>>       -> pte_present (panic)
>>
> 
> Probably there are other problematic bits without that can trigger that? 
> I suspect walk_page_range*() callers might be affected,
I rechecked the code and found that other architectures that support
THP have defined pmd_leaf.
So there is not problem on other architectures.
> 
>> The reason is pmd_leaf is not defined, So like
>> commit 501b81046701 ("mips: mm: add p?d_leaf() definitions")
>> add p?d_leaf() definition for LoongArch.
>>
> 
> We most certainly want to cc stable, no?
OK, let me cc stable in V2.
> 
> Can we come up with a Fixes: tag? Probably when we added THP support to 
> loongarch.
OK, let me add Fixes: in commit message in V2.
> 
>> Signed-off-by: Hongchen Zhang <zhanghongchen@loongson.cn>
>> ---
>>   arch/loongarch/include/asm/pgtable.h | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/loongarch/include/asm/pgtable.h 
>> b/arch/loongarch/include/asm/pgtable.h
>> index 370c6568ceb8..ea54653b7aab 100644
>> --- a/arch/loongarch/include/asm/pgtable.h
>> +++ b/arch/loongarch/include/asm/pgtable.h
>> @@ -243,6 +243,9 @@ static inline void pmd_clear(pmd_t *pmdp)
>>   #define pmd_phys(pmd)        PHYSADDR(pmd_val(pmd))
>> +#define pmd_leaf(pmd)        ((pmd_val(pmd) & _PAGE_HUGE) != 0)
>> +#define pud_leaf(pud)        ((pud_val(pud) & _PAGE_HUGE) != 0)
>> +
>>   #ifndef CONFIG_TRANSPARENT_HUGEPAGE
>>   #define pmd_page(pmd)        (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
>>   #endif /* CONFIG_TRANSPARENT_HUGEPAGE  */
> 
> Acked-by: David Hildenbrand <david@redhat.com>
> 


-- 
Best Regards
Hongchen Zhang


  reply	other threads:[~2023-09-06  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05  6:49 Hongchen Zhang
2023-09-06  7:42 ` David Hildenbrand
2023-09-06  8:06   ` Hongchen Zhang [this message]
2023-09-06  8:08     ` David Hildenbrand
2023-09-06  8:22       ` Hongchen Zhang

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=4a06f415-281f-b76f-ed03-211b07ccd6a4@loongson.cn \
    --to=zhanghongchen@loongson.cn \
    --cc=akpm@linux-foundation.org \
    --cc=chenfeiyang@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=david@redhat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=rppt@kernel.org \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    --cc=zhengqi.arch@bytedance.com \
    /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

all inboxes | Powered by JetHome®