From: Huang Pei <huangpei@loongson.cn>
To: Joshua Kinard <kumba@gentoo.org>
Cc: Linux/MIPS <linux-mips@vger.kernel.org>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [RFC]: Maybe revert 'MIPS: add PMD table accounting into MIPS'pmd_alloc_one' from 5.4 LTS?
Date: Wed, 21 Jul 2021 10:11:54 +0800 [thread overview]
Message-ID: <20210721021154.dlyrrtljz2hrlqng@ambrosehua-HP-xw6600-Workstation> (raw)
In-Reply-To: <370c2578-5032-08d6-9f48-c2f284a9b62d@gentoo.org>
On Tue, Jul 20, 2021 at 08:45:45PM -0400, Joshua Kinard wrote:
Hi,
> (resend using the correct list address)
>
> Hi all,
>
> I think there may be an issue with upstream commit
> ed914d48b6a1040d1039d371b56273d422c0081e (MIPS: add PMD table accounting
> into MIPS'pmd_alloc_one), which got backported to 5.4 LTS.
>
> I am running my SGI Octane on the 5.4 LTS kernel series w/ Gentoo's IP30
> patches, since basic IP30 support didn't get fully mainlined until ~5.7 and
> I am just behind on kernels for the time being. Generally, the 5.4 series
> is stable on this machine, but as of using 5.4.133 yesterday and 5.4.134
> today, I have had three kernel panics, all with completely different stack
> traces, while building a multilib-enabled glibc-2.33 package.
>
> Since the stack traces are all completely different, I am suspecting an
> issue with memory allocation, which picking through the 5.4.133 changelog,
> got me to look at commit ed914d48b6a1. My initial thought is it looks like
> this patch should not have been backported to 5.4, because 5.4 is missing
> the asm-generic version of pmd_free(), which means the MIPS-specific version
> is likely used instead, and that function was not updated alongside
> pmd_alloc_one().
>
> Now, I am not a memory person, but some quick reading indicates there may be
> some other issues with this patch as well:
>
> - use of 'GFP_KERNEL | __GFP_ACCOUNT' when there is GFP_KERNEL_ACCOUNT
> available.
Yes, this is better
>
> - the return value of pgtable_pmd_page_ctor(pg); is not checked to make sure
> it succeeded. Per Documentation/vm/split_page_table_lock, "NOTE:
> pgtable_page_ctor() and pgtable_pmd_page_ctor() can fail -- it must
> be handled properly."
Yes, I missed this one
>
> - there is no call to pgtable_pmd_page_dtor() in pmd_free() in MIPS'
> pgalloc. The commit message indicates that pmd_free in asm-generic will
> handle this, but that function doesn't exist in 5.4, leading to mismatched
> implementations.
Yes, my fix is to fix the mismatch.
I think all stable branches before 5.10 should *not* apply this my patch
>
> I think the fix is to either revert ed914d48b6a1 on the 5.4 stable series
> (and any earlier series that are missing asm-generic pmd_free), or the MIPS
> pmd_free() needs to be updated to call pgtable_pmd_page_dtor() in a similar
> manner to x86 and arm64. I'd opt for reverting.
>
> Currently testing a build of 5.4.134 with this patch reverted running some
> compile jobs. If it survives building multilib glibc, then I think my
> suspicions may be valid.
>
> --
> Joshua Kinard
> Gentoo/MIPS
> kumba@gentoo.org
> rsa6144/5C63F4E3F5C6C943 2015-04-27
> 177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943
>
> "The past tempts us, the present confuses us, the future frightens us. And
> our lives slip away, moment by moment, lost in that vast, terrible in-between."
>
> --Emperor Turhan, Centauri Republic
next prev parent reply other threads:[~2021-07-21 2:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-21 0:45 [RFC]: Maybe revert 'MIPS: add PMD table accounting into MIPS'pmd_alloc_one' from 5.4 LTS? Joshua Kinard
2021-07-21 2:11 ` Huang Pei [this message]
2021-07-24 23:22 ` Joshua Kinard
2021-07-26 1:51 ` loongson
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=20210721021154.dlyrrtljz2hrlqng@ambrosehua-HP-xw6600-Workstation \
--to=huangpei@loongson.cn \
--cc=kumba@gentoo.org \
--cc=linux-mips@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).