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:   Wed, 8 Aug 2018 16:09:42 -0700
From:   Josh Triplett <josh@...htriplett.org>
To:     Shakeel Butt <shakeelb@...gle.com>
Cc:     Kirill Tkhai <ktkhai@...tuozzo.com>,
        Michal Hocko <mhocko@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        gregkh@...uxfoundation.org, rafael@...nel.org,
        Alexander Viro <viro@...iv.linux.org.uk>,
        "Darrick J. Wong" <darrick.wong@...cle.com>,
        Paul McKenney <paulmck@...ux.vnet.ibm.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        mathieu.desnoyers@...icios.com, jiangshanlai@...il.com,
        Hugh Dickins <hughd@...gle.com>, shuah@...nel.org,
        robh@...nel.org, ulf.hansson@...aro.org, aspriel@...il.com,
        vivek.gautam@...eaurora.org, robin.murphy@....com, joe@...ches.com,
        heikki.krogerus@...ux.intel.com,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        Chris Wilson <chris@...is-wilson.co.uk>,
        Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>,
        Matthew Wilcox <willy@...radead.org>,
        Huang Ying <ying.huang@...el.com>, jbacik@...com,
        Ingo Molnar <mingo@...nel.org>, mhiramat@...nel.org,
        LKML <linux-kernel@...r.kernel.org>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>
Subject: Re: [PATCH RFC 01/10] rcu: Make CONFIG_SRCU unconditionally enabled

On Wed, Aug 08, 2018 at 04:02:29PM -0700, Shakeel Butt wrote:
> On Wed, Aug 8, 2018 at 11:02 AM Josh Triplett <josh@...htriplett.org> wrote:
> >
> > On Wed, Aug 08, 2018 at 07:30:13PM +0300, Kirill Tkhai wrote:
> > > On 08.08.2018 19:23, Kirill Tkhai wrote:
> > > > On 08.08.2018 19:13, Josh Triplett wrote:
> > > >> On Wed, Aug 08, 2018 at 01:17:44PM +0300, Kirill Tkhai wrote:
> > > >>> On 08.08.2018 10:20, Michal Hocko wrote:
> > > >>>> On Tue 07-08-18 18:37:36, Kirill Tkhai wrote:
> > > >>>>> This patch kills all CONFIG_SRCU defines and
> > > >>>>> the code under !CONFIG_SRCU.
> > > >>>>
> > > >>>> The last time somebody tried to do this there was a pushback due to
> > > >>>> kernel tinyfication. So this should really give some numbers about the
> > > >>>> code size increase. Also why can't we make this depend on MMU. Is
> > > >>>> anybody else than the reclaim asking for unconditional SRCU usage?
> > > >>>
> > > >>> I don't know one. The size numbers (sparc64) are:
> > > >>>
> > > >>> $ size image.srcu.disabled
> > > >>>    text      data     bss     dec     hex filename
> > > >>> 5117546   8030506 1968104 15116156         e6a77c image.srcu.disabled
> > > >>> $ size image.srcu.enabled
> > > >>>    text      data     bss     dec     hex filename
> > > >>> 5126175   8064346 1968104 15158625         e74d61 image.srcu.enabled
> > > >>> The difference is: 15158625-15116156 = 42469 ~41Kb
> > > >>
> > > >> 41k is a *substantial* size increase. However, can you compare
> > > >> tinyconfig with and without this patch? That may have a smaller change.
> > > >
> > > > $ size image.srcu.disabled
> > > >    text        data     bss     dec     hex filename
> > > > 1105900      195456   63232 1364588  14d26c image.srcu.disabled
> > > >
> > > > $ size image.srcu.enabled
> > > >    text        data     bss     dec     hex filename
> > > > 1106960      195528   63232 1365720  14d6d8 image.srcu.enabled
> > > >
> > > > 1365720-1364588 = 1132 ~ 1Kb
> > >
> > > 1Kb is not huge size. It looks as not a big price for writing generic code
> > > for only case (now some places have CONFIG_SRCU and !CONFIG_SRCU variants,
> > > e.g. drivers/base/core.c). What do you think?
> >
> > That's a little more reasonable than 41k, likely because of
> > CONFIG_TINY_SRCU. That's still not ideal, though. And as far as I can
> > tell, the *only* two pieces of core code that use SRCU are
> > drivers/base/core.c and kernel/notifier.c, and the latter is exclusively
> > code to use notifiers with SRCU, not notifiers wanting to use SRCU
> > themselves. So, as far as I can tell, this would really just save a
> > couple of small #ifdef sections in drivers/base/core.c, and I think
> > those #ifdef sections could be simplified even further. That doesn't
> > seem worth it at all.
> 
> Hi Josh, the motivation behind enabling SRCU is not to simplify the
> code in drivers/base/core.c but rather not to introduce similar ifdefs
> in mm/vmscan.c for shrinker traversals.

Leaving aside the comment someone made about sticking with rwsem for
this, I honestly hope that someday the shrinker is optional too. :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ