From: Dennis Zhou <dennis@kernel.org>
To: Rich Felker <dalias@libc.org>
Cc: Rob Landley <rob@landley.net>, Dennis Zhou <dennis@kernel.org>,
Vladimir Murzin <vladimir.murzin@arm.com>,
linux-arch-owner@vger.kernel.org, linux-mm@kvack.org,
tj@kernel.org, cl@linux.com, akpm@linux-foundation.org,
npiggin@gmail.com, hch@lst.de, arnd@arndb.de,
linux-sh@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] percpu: km: ensure it is used with NOMMU (either UP or SMP)
Date: Mon, 6 Dec 2021 12:54:57 -0500 [thread overview]
Message-ID: <Ya5OcTGfD1587C0O@fedora> (raw)
In-Reply-To: <20211206162140.GJ7074@brightrain.aerifal.cx>
On Mon, Dec 06, 2021 at 11:21:46AM -0500, Rich Felker wrote:
> On Mon, Dec 06, 2021 at 06:01:59AM -0600, Rob Landley wrote:
> > On 12/3/21 3:02 PM, Dennis Zhou wrote:
> > > On Wed, Dec 01, 2021 at 11:51:04AM +0000, Vladimir Murzin wrote:
> > >> Hi,
> > >>
> > >> On 11/30/21 5:41 PM, Dennis Zhou wrote:
> > >> > Hello,
> > >> >
> > >> > On Tue, Nov 30, 2021 at 05:29:54PM +0000, Vladimir Murzin wrote:
> > >> >> Currently, NOMMU pull km allocator via !SMP dependency because most of
> > >> >> them are UP, yet for SMP+NOMMU vm allocator gets pulled which:
> > >> >>
> > >> >> * may lead to broken build [1]
> > >> >> * ...or not working runtime due to [2]
> > >> >>
> > >> >> It looks like SMP+NOMMU case was overlooked in bbddff054587 ("percpu:
> > >> >> use percpu allocator on UP too") so restore that.
> > >> >>
> > >> >> [1]
> > >> >> For ARM SMP+NOMMU (R-class cores)
> > >> >>
> > >> >> arm-none-linux-gnueabihf-ld: mm/percpu.o: in function `pcpu_post_unmap_tlb_flush':
> > >> >> mm/percpu-vm.c:188: undefined reference to `flush_tlb_kernel_range'
> > >> >>
> > >> >> [2]
> > >> >> static inline
> > >> >> int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
> > >> >> pgprot_t prot, struct page **pages, unsigned int page_shift)
> > >> >> {
> > >> >> return -EINVAL;
> > >> >> }
> > >> >>
> > >> >> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> > >> >> ---
> > >> >> mm/Kconfig | 3 +--
> > >> >> 1 file changed, 1 insertion(+), 2 deletions(-)
> > >> >>
> > >> >> diff --git a/mm/Kconfig b/mm/Kconfig
> > >> >> index d16ba92..66331e0 100644
> > >> >> --- a/mm/Kconfig
> > >> >> +++ b/mm/Kconfig
> > >> >> @@ -425,9 +425,8 @@ config THP_SWAP
> > >> >> # UP and nommu archs use km based percpu allocator
> > >> >> #
> > >> >> config NEED_PER_CPU_KM
> > >> >> - depends on !SMP
> > >> >> bool
> > >> >> - default y
> > >> >> + default !SMP || !MMU
> > >> >>
> > >> >
> > >> > Should this be `depends on !SMP || !MMU` with default yes? Because with
> > >> > SMP && MMU, it shouldn't be an option to run with percpu-km.
> > >>
> > >> IIUC these are equivalent, truth table would not change if is under "depends"
> > >> or "default"
> > >>
> > >> SMP MMU NEED_PER_CPU_KM
> > >> y y !y || !y => n || n => n
> > >> y n !y || !n => n || y => y
> > >> n y !n || !y => y || n => y
> > >> n n !n || !n => y || y => y
> > >>
> > >
> > > I may be wrong, but I think this is slightly different as we're using
> > > #ifdef / #if defined().
> > >
> > >> >
> > >> >> config CLEANCACHE
> > >> >> bool "Enable cleancache driver to cache clean pages if tmem is present"
> > >> >> --
> > >> >> 2.7.4
> > >> >>
> > >> >
> > >> > It's interesting to me that this is all coming up at once. Earlier this
> > >> > month I had the same conversation with people involved with sh [1].
> > >> >
> > >> > [1] https://lore.kernel.org/linux-sh/YY7tp5attRyK42Zk@fedora/
> > >> >
> > >> > I can pull this shortly once I see whatever happened to linux-sh.
> > >>
> > >> Ahh, good to know! Adding SH folks here (start of discussion [0]). I see you came
> > >> to the same conclusion, right?
> > >
> > > Yeah, I don't see anything else from linux-sh. So I'll go ahead and
> > > apply this with my change if you're fine with that.
> >
> > I can't test against current until I get some unrelated fixes from Rich Felker
> > (who's been busy over the weekend), but I tested the "depends" version on 5.10
> > and got a shell prompt on my "make ARCH=sh j2_defconfig" board.
> >
> > Tested-by: Rob Landley <rob@landley.net>
>
> Tested-by: Rich Felker <dalias@libc.org>
>
> I've tested the version as originally posted and it works for j2 (sh2)
> (both build and runtime checked). I'd tested the other (depends
> version) before and I'm fine with either going upstream.
>
> Rich
>
Thank you all for testing and bearing with me. I've applied this to
for-5.16-fixes. Will send it up later in the week.
Thanks,
Dennis
next prev parent reply other threads:[~2021-12-06 17:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 17:29 [PATCH] percpu: km: Use for SMP+NOMMU Vladimir Murzin
2021-11-30 17:29 ` [PATCH] percpu: km: ensure it is used with NOMMU (either UP or SMP) Vladimir Murzin
2021-11-30 17:41 ` Dennis Zhou
2021-12-01 11:51 ` Vladimir Murzin
2021-12-03 21:02 ` Dennis Zhou
2021-12-06 8:27 ` Vladimir Murzin
2021-12-06 12:01 ` Rob Landley
2021-12-06 16:21 ` Rich Felker
2021-12-06 17:54 ` Dennis Zhou [this message]
2021-12-14 16:29 ` Geert Uytterhoeven
2021-12-14 17:26 ` Dennis Zhou
2021-12-14 19:02 ` Geert Uytterhoeven
2021-12-14 19:18 ` Dennis Zhou
2021-12-14 20:12 ` Geert Uytterhoeven
2021-12-14 20:50 ` Dennis Zhou
2021-12-15 7:56 ` Geert Uytterhoeven
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=Ya5OcTGfD1587C0O@fedora \
--to=dennis@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=cl@linux.com \
--cc=dalias@libc.org \
--cc=hch@lst.de \
--cc=linux-arch-owner@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-sh@vger.kernel.org \
--cc=npiggin@gmail.com \
--cc=rob@landley.net \
--cc=tj@kernel.org \
--cc=vladimir.murzin@arm.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