Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1370610imm; Wed, 8 Aug 2018 16:03:46 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw/N3sOq7vwU7r9xnckvoNZYrTBL8PUDdzVZ+xnhsssSQJF07C/Clfm+/xVPRNO97e6PCd+ X-Received: by 2002:a63:bf08:: with SMTP id v8-v6mr4168876pgf.3.1533769426285; Wed, 08 Aug 2018 16:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533769426; cv=none; d=google.com; s=arc-20160816; b=MUeSflfIYRfqEbFPNZwPkpy+hTFiPvoM1HlA9PjlB+ISPeel886B0VQuUOLIjcdY8C BuQj9yqjlH1mqBprQeMGSzfI39Oq5bW7y2ACbvNdgAzu9d7d6x+bzz3+QZu3uguA/2zg 97yciuJmHA65GSeoa8P5g/HC67lAmiMww1DOkZmqfoITuEz/9i3Fcas4+LEHU11A+B5C mkVLtFDHGz3jlu4dtkeXgLIi4hePWMSMcbulF05nn3dqvmAeOwkKOcJs9GljAMyAfmHH ymJQMYbHsSa716r9aat5eFq7gawSmtZwu2oMZQ5M0eUfO94czg5yuIDvg5LhNXrS+ANV ex/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=tkNmsLhRlos1SBwsBAZ5DzdPrXJuslpk9MRcdMhtJcM=; b=Qv2mNMOhnH6+BocSYk09X2JBHUzXRWk91QyhihO8bCCTQ/FECQkhC4vSmsQ4ObX34N 3uPCUsM3XTW+pAiisZQDV4W7/Aj6JkBNyS7MSV9T5wPQ5WKi4a6ffgDGJgEGrSeNlPOE XUS8YLPTN1IloJggj17U911QITjGsNc+2QyCde7Os/wBjS7yxuC6QdU0MzitzSpnjSq5 8cajBm4H/lSkV9bYeS4JUPHKSJMB2ccm5uXtP9WYh2FwPT0VOwOv6rWPush8K0D9ge8I yFH0fiVKROVyHxxVrJ23dBcuATC4c4rxUw8SsmuWUXLwtaJuIyuXWQIDKLI9XTKPLL2Z mUMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="vEk6Ic/R"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17-v6si4469498pgd.682.2018.08.08.16.03.32; Wed, 08 Aug 2018 16:03:46 -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; dkim=pass header.i=@google.com header.s=20161025 header.b="vEk6Ic/R"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731652AbeHIBYd (ORCPT + 99 others); Wed, 8 Aug 2018 21:24:33 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:37059 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731298AbeHIBYc (ORCPT ); Wed, 8 Aug 2018 21:24:32 -0400 Received: by mail-ua0-f195.google.com with SMTP id y10-v6so4276611uao.4 for ; Wed, 08 Aug 2018 16:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tkNmsLhRlos1SBwsBAZ5DzdPrXJuslpk9MRcdMhtJcM=; b=vEk6Ic/R12pZNFyhXGGn2ZQyPJsvE5VrXI5ZtjawoSwtoWZtS4KuIkRBkjkQzb1WXs IrZSzwcWH+xQjS+0O0z7/vCVFDWf+on8QlenPGrOwejcdkWZmPtn6AeSSh4rHun2LZ23 fxOsOf7IopGdrqFvicOXYXl7K9+WZNRB3LK4a4bm8nD47bJUrmxK0NEXEQuKayBTNDBL EpRd4OCVxcl9mMzYRY0JKsh7dWE+/iYa/E0OPorrbkmW3lvhHMX/jmch4AsLP2aDFR9g +S6yLz2UvaDD6BOfIDiVhDTJII50zH4FvnPO0NUQuzf9zIAgJScxl5/qdsKG/s2N7ZhT AgyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tkNmsLhRlos1SBwsBAZ5DzdPrXJuslpk9MRcdMhtJcM=; b=BQ+Mzrv4iLtcuNXnPuEoCbat7+keUUMBpkUx5KAGCuTqySab28QRNRjKOwJuDi2+Rb rg7rbcM8NqT0eEVC8o2jHkrtTauXvb3n43X+UrXhRdtINH7Jzc+3tetP/5Tqa9w+49MT WnEvCpbOTvNzviGZtS3rHAksFYNjuypzfEBvpkqeNJNzJsHHkKnzwfgkb6ncnTSvpx+k tQjRYGZnDiYP9fQ8XQyanqQyhfvqedw2Ch71iEmL4ncf2MgWTWJGbw0g/BtTX+prAKrr NU+UbSVI10HmSScy2f8tYeIOK9Rh0EvyK193xGW5VtCqydjYpu9HXbFGGkJHfxtPh1xM lsSw== X-Gm-Message-State: AOUpUlFwc8AwZ1S1MvMCa5ht/LyTsV1cOe4ahqtCV9idjWXJ1lvkvrA4 CwCnYVLIc3bfSPZ9xQ6vJ0faLvuSqyPdUnryUdWvQg== X-Received: by 2002:a1f:b9ca:: with SMTP id j193-v6mr3290041vkf.139.1533769360789; Wed, 08 Aug 2018 16:02:40 -0700 (PDT) MIME-Version: 1.0 References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> <153365625652.19074.8434946780002619802.stgit@localhost.localdomain> <20180808072040.GC27972@dhcp22.suse.cz> <20180808161330.GA22863@localhost> <20180808180152.GA2480@localhost> In-Reply-To: <20180808180152.GA2480@localhost> From: Shakeel Butt Date: Wed, 8 Aug 2018 16:02:29 -0700 Message-ID: Subject: Re: [PATCH RFC 01/10] rcu: Make CONFIG_SRCU unconditionally enabled To: josh@joshtriplett.org Cc: Kirill Tkhai , Michal Hocko , Andrew Morton , gregkh@linuxfoundation.org, rafael@kernel.org, Alexander Viro , "Darrick J. Wong" , Paul McKenney , Steven Rostedt , mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, Hugh Dickins , 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, Stephen Rothwell , Vladimir Davydov , Chris Wilson , Tetsuo Handa , Andrey Ryabinin , Matthew Wilcox , Huang Ying , jbacik@fb.com, Ingo Molnar , mhiramat@kernel.org, LKML , linux-fsdevel , Linux MM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 8, 2018 at 11:02 AM Josh Triplett 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. Shakeel