From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Alexander Potapenko <glider@google.com>
Cc: linux-kernel@vger.kernel.org,
Andrew Donnellan <ajd@linux.ibm.com>,
Xiaoke Wang <xkernel.wang@foxmail.com>,
stable@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH] lib/test_meminit: fix off-by-one error in test_pages()
Date: Thu, 12 Oct 2023 13:24:01 +0200 [thread overview]
Message-ID: <2023101218-whacking-evolution-8f97@gregkh> (raw)
In-Reply-To: <CAG_fn=W0cRThcNzE3G7bu5VqwOddTp_uqup3k7tZSMqM2te0_w@mail.gmail.com>
On Thu, Oct 12, 2023 at 01:14:39PM +0200, Alexander Potapenko wrote:
> On Thu, Oct 12, 2023 at 12:37 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Thu, Oct 12, 2023 at 12:26:58PM +0200, Greg Kroah-Hartman wrote:
> > > On Thu, Oct 12, 2023 at 10:40:14AM +0200, Alexander Potapenko wrote:
> > > > On Thu, Oct 12, 2023 at 10:17 AM Greg Kroah-Hartman
> > > > <gregkh@linuxfoundation.org> wrote:
> > > > >
> > > > > In commit efb78fa86e95 ("lib/test_meminit: allocate pages up to order
> > > > > MAX_ORDER"), the loop for testing pages is set to "<= MAX_ORDER" which
> > > > > causes crashes in systems when run. Fix this to "< MAX_ORDER" to fix
> > > > > the test to work properly.
> > > >
> > > > What are the crashes you are seeing? Are those OOMs?
> > >
> > > They are WARN_ON() triggers. They are burried in the Android build
> > > system, let me see if I can uncover them.
> > >
> > > > IIUC it should be valid to allocate with MAX_ORDER.
> > >
> > > "should", but I no longer get runtime warnings with this patch applied,
> > > so something is wrong :)
>
> I think I know what's going on. In March 2023 Kirill changed the
> semantics of MAX_ORDER to be inclusive: now alloc_pages() accepts
> 0..MAX_ORDER, whereas previously it was 0..MAX_ORDER-1:
> https://github.com/torvalds/linux/commit/23baf831a32c04f9a968812511540b1b3e648bf5
> Older kernel versions had an explicit check for order >= MAX_ORDER,
> which is what you're seeing on Android.
Thanks for digging this up. I'll just queue this patch up for 6.1 and
older stable kernels then as the commit above you found is in 6.4 so
nothing newer than that will need this fix.
Thanks for the quick response!
greg k-h
prev parent reply other threads:[~2023-10-12 11:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 8:17 [PATCH] lib/test_meminit: fix off-by-one error in test_pages() Greg Kroah-Hartman
2023-10-12 8:40 ` Alexander Potapenko
2023-10-12 10:26 ` Greg Kroah-Hartman
2023-10-12 10:37 ` Greg Kroah-Hartman
2023-10-12 11:14 ` Alexander Potapenko
2023-10-12 11:24 ` Greg Kroah-Hartman [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=2023101218-whacking-evolution-8f97@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=ajd@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=glider@google.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=xkernel.wang@foxmail.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