From: "Zhaolong Zhang" <zhangzl2013@126.com>
To: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>
Cc: "Alexander Lobakin" <alobakin@pm.me>,
"Yanteng Si" <siyanteng@loongson.cn>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mips: fix HUGETLB function without THP enabled
Date: Tue, 2 Nov 2021 20:17:52 +0800 (CST) [thread overview]
Message-ID: <181761.42aa.17ce0959595.Coremail.zhangzl2013@126.com> (raw)
In-Reply-To: <20211102102051.GA7512@alpha.franken.de>
At 2021-11-02 18:20:51, "Thomas Bogendoerfer" <tsbogend@alpha.franken.de> wrote:
>On Tue, Nov 02, 2021 at 04:24:37PM +0800, Zhaolong Zhang wrote:
>> ltp test futex_wake04 without THP enabled leads to below bt:
>> [<ffffffff80a03728>] BUG+0x0/0x8
>> [<ffffffff80a0624c>] internal_get_user_pages_fast+0x81c/0x820
>> [<ffffffff8093ac18>] get_futex_key+0xa0/0x480
>> [<ffffffff8093b074>] futex_wait_setup+0x7c/0x1a8
>> [<ffffffff8093b2c0>] futex_wait+0x120/0x228
>> [<ffffffff8093dbe8>] do_futex+0x140/0xbd8
>> [<ffffffff8093e78c>] sys_futex+0x10c/0x1c0
>> [<ffffffff808703d0>] syscall_common+0x34/0x58
>>
>> Move pmd_write() and pmd_page() from TRANSPARENT_HUGEPAGE scope to
>> MIPS_HUGE_TLB_SUPPORT scope, because both THP and HUGETLB will need
>> them.
>>
>> Signed-off-by: Zhaolong Zhang <zhangzl2013@126.com>
>> ---
>> arch/mips/include/asm/pgtable.h | 40 +++++++++++++++++----------------
>> 1 file changed, 21 insertions(+), 19 deletions(-)
>
>applied to mips-next.
>
>>
>> diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
>> index 804889b70965..1fcf4be5cd20 100644
>> --- a/arch/mips/include/asm/pgtable.h
>> +++ b/arch/mips/include/asm/pgtable.h
>> @@ -86,10 +86,12 @@ extern void paging_init(void);
>> */
>> #define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd))
>>
>> +#ifndef CONFIG_MIPS_HUGE_TLB_SUPPORT
>> #define __pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
>> #ifndef CONFIG_TRANSPARENT_HUGEPAGE
>> #define pmd_page(pmd) __pmd_page(pmd)
>> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>> +#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
>
>While applying I've simplified that hunk to
>
>-#define __pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
>-#ifndef CONFIG_TRANSPARENT_HUGEPAGE
>-#define pmd_page(pmd) __pmd_page(pmd)
>-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>+#ifndef CONFIG_MIPS_HUGE_TLB_SUPPORT
>+#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
>+#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
>
It is much better.
Thanks for your kind reply.
Regards,
Zhaolong
>Thomas.
>
>--
>Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
>good idea. [ RFC1925, 2.3 ]
prev parent reply other threads:[~2021-11-02 12:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 8:24 [PATCH] mips: fix HUGETLB function without THP enabled Zhaolong Zhang
2021-11-02 10:20 ` Thomas Bogendoerfer
2021-11-02 12:17 ` Zhaolong Zhang [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=181761.42aa.17ce0959595.Coremail.zhangzl2013@126.com \
--to=zhangzl2013@126.com \
--cc=alobakin@pm.me \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=siyanteng@loongson.cn \
--cc=tsbogend@alpha.franken.de \
/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