Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1119520imm; Wed, 8 Aug 2018 11:04:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyiRCvwAWE9HVZSBQM/dqQueuUh6CJ7WV6IqfAvBWedpeyzsdJDHOFUcBYLEHXZxX+qiQ7u X-Received: by 2002:a65:50cc:: with SMTP id s12-v6mr3442215pgp.375.1533751460504; Wed, 08 Aug 2018 11:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533751460; cv=none; d=google.com; s=arc-20160816; b=CjNpvRm3Se9J1uyWqxVLAnXC1mL8TQaYwDK1LJAj6tuL6ojtmkMvAoUvNHMCo2ySzj M+sKEI9pvssoqg7xIf4FncIeEWjwyYG/fCVFJqXWeBrz+BZX+ZrR1GWpjJog3QC0CVTG IcoyY8gY88fWKtIYYlrf8SXuObKAOWAtMQvAQKskKiQbkUfQrsOY7VH9r+FrrQRXk6mz pkz5e4OXhs0zo6QAuhOQjOR+mv8jCnTih/nvrjiAnbNwJW0VAlTbJpxeF9N4g64gBYOw NXOq5/tAbzM5mieY4F0Y/mW0mEa60u+RxiCle5d2vZ7FfhrTyaIPutxo3ZMMzLI7lO33 vuhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=CDGT9W2D716fpKLClKka/gEI0rxR7QsyC164slJpaYw=; b=qq8P0PvpAcNCJ7kImx6zkXx8fWNevHE3hs7pFZx9E2d0A8U2r4Fk4tJCAtDt2FdPMJ LQa+ILRyjWlFwpXxItIB7cY39GoQJTWwpwp5MSLel2qpIdxBrr3N+RdBaIcdZgTlwwkc rADkO9Cl8sWRLXfZ0ZZDhaqfsQWuZXlJynXc6SwtjJdzl19LVuguplEXPQEMV3XzLkno bfIEzo3LfjVZNqOgDSl1gLkBsGJf+V68pDr2v50OCl8KgEWZ3eVAxtrcA/mpI1DAT8NO zBT1lEylLVJ9pi7Urp8muJhl14AXCNIztfTVpLsTfnxlot0cf2T3H74Hjihpc4IjvCSF A+GQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5-v6si4908524pga.602.2018.08.08.11.04.05; Wed, 08 Aug 2018 11:04:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729756AbeHHUXR (ORCPT + 99 others); Wed, 8 Aug 2018 16:23:17 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:55885 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727748AbeHHUXR (ORCPT ); Wed, 8 Aug 2018 16:23:17 -0400 X-Originating-IP: 134.134.139.76 Received: from localhost (unknown [134.134.139.76]) (Authenticated sender: josh@joshtriplett.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id D46264000D; Wed, 8 Aug 2018 18:02:10 +0000 (UTC) Date: Wed, 8 Aug 2018 11:01:55 -0700 From: Josh Triplett To: Kirill Tkhai Cc: Michal Hocko , akpm@linux-foundation.org, gregkh@linuxfoundation.org, rafael@kernel.org, viro@zeniv.linux.org.uk, darrick.wong@oracle.com, paulmck@linux.vnet.ibm.com, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, hughd@google.com, shuah@kernel.org, robh@kernel.org, ulf.hansson@linaro.org, aspriel@gmail.com, vivek.gautam@codeaurora.org, robin.murphy@arm.com, joe@perches.com, heikki.krogerus@linux.intel.com, sfr@canb.auug.org.au, vdavydov.dev@gmail.com, chris@chris-wilson.co.uk, penguin-kernel@I-love.SAKURA.ne.jp, aryabinin@virtuozzo.com, willy@infradead.org, ying.huang@intel.com, shakeelb@google.com, jbacik@fb.com, mingo@kernel.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH RFC 01/10] rcu: Make CONFIG_SRCU unconditionally enabled Message-ID: <20180808180152.GA2480@localhost> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> <153365625652.19074.8434946780002619802.stgit@localhost.localdomain> <20180808072040.GC27972@dhcp22.suse.cz> <20180808161330.GA22863@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.