lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 26 Feb 2019 12:03:39 -0500
From:   Dennis Zhou <dennis@...nel.org>
To:     Christopher Lameter <cl@...ux.com>
Cc:     Peng Fan <peng.fan@....com>, "tj@...nel.org" <tj@...nel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "van.freenix@...il.com" <van.freenix@...il.com>
Subject: Re: [PATCH 1/2] percpu: km: remove SMP check

On Tue, Feb 26, 2019 at 03:16:44PM +0000, Christopher Lameter wrote:
> On Mon, 25 Feb 2019, Dennis Zhou wrote:
> 
> > > @@ -27,7 +27,7 @@
> > >   *   chunk size is not aligned.  percpu-km code will whine about it.
> > >   */
> > >
> > > -#if defined(CONFIG_SMP) && defined(CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK)
> > > +#if defined(CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK)
> > >  #error "contiguous percpu allocation is incompatible with paged first chunk"
> > >  #endif
> > >
> > > --
> > > 2.16.4
> > >
> >
> > Hi,
> >
> > I think keeping CONFIG_SMP makes this easier to remember dependencies
> > rather than having to dig into the config. So this is a NACK from me.
> 
> But it simplifies the code and makes it easier to read.
> 
> 

I think the check isn't quite right after looking at it a little longer.
Looking at x86, I believe you can compile it with !SMP and
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK will still be set. This should
still work because x86 has an MMU.

I think more correctly it would be something like below, but I don't
have the time to fully verify it right now.

Thanks,
Dennis

---
diff --git a/mm/percpu-km.c b/mm/percpu-km.c
index 0f643dc2dc65..69ccad7d9807 100644
--- a/mm/percpu-km.c
+++ b/mm/percpu-km.c
@@ -27,7 +27,7 @@
  *   chunk size is not aligned.  percpu-km code will whine about it.
  */
 
-#if defined(CONFIG_SMP) && defined(CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK)
+#if !defined(CONFIG_MMU) && defined(CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK)
 #error "contiguous percpu allocation is incompatible with paged first chunk"
 #endif
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ