From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754523AbeAQQcq (ORCPT ); Wed, 17 Jan 2018 11:32:46 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:45613 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754007AbeAQQcl (ORCPT ); Wed, 17 Jan 2018 11:32:41 -0500 X-Originating-IP: 50.39.166.153 Date: Wed, 17 Jan 2018 08:32:35 -0800 From: Josh Triplett To: Arnd Bergmann Cc: "Paul E. McKenney" , Nicolas Pitre , Linux Kernel Mailing List Subject: Re: [PATCH RFC tip/core/rcu] Make SRCU be once again optional Message-ID: <20180117163235.GA14896@localhost> References: <20170512191005.GE3956@linux.vnet.ibm.com> <20170603035915.GA23375@linux.vnet.ibm.com> <20170603203620.GL3721@linux.vnet.ibm.com> <20180116223431.GA9671@linux.vnet.ibm.com> <20180116235703.GD9671@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 17, 2018 at 11:29:26AM +0100, Arnd Bergmann wrote: > On Wed, Jan 17, 2018 at 12:57 AM, Paul E. McKenney > wrote: > > On Wed, Jan 17, 2018 at 12:03:18AM +0100, Arnd Bergmann wrote: > >> Evidently there is at least one driver that uses SRCU but doesn't 'select SRCU' > >> in Kconfig. There are probably others that just haven't been found. > > > > Does adding "select SRCU" on "config PM_SLEEP" in kernel/power/Kconfig > > fix this? > > I'm sure it does, but the point I was making is that we probably have a number > of those, and would never find the other ones through the current build test > setup. > > I've now tried disabling a ridiculous number of options to come up with a > setup that never enables SRCU. Interestingly, that also means we don't > get the drivers/base/power/wakeup.c problem in 'allmodconfig', though > I did get a link-time error: [...] > Turning off lockdep and kmemleak gives me a working allmodconfig build. > I'm doing some more testing on ARM, but it looks like this is a dark corner > of the randconfig state space that I'm not sure I want to explore more. > > Doing an hour of randconfig builds, I already found exactly two missing > 'select SRCU': > > ERROR: "__srcu_read_unlock" [drivers/infiniband/core/ib_uverbs.ko] undefined! > drivers/base/power/wakeup.c:68:1: error: type defaults to 'int' in > declaration of 'DEFINE_STATIC_SRCU' [-Werror=implicit-int] I've found that, when trying to make something optional, it doesn't suffice to do randconfigs. You need a configuration with *everything* enabled, except for the option you want to test disabling, and anything that depends on or selects that option. And, conversely, when testing if a specific option has all the dependencies it needs, you want a configuration with that option and its dependencies/selects enabled and everything else disabled. I wonder how easily we could make a kconfig option for an "all except" or "none except" config? Such an option would read a minimal config snippet containing only specific options, and then act like allyesconfig/allmodconfig/allnoconfig as long as doing so doesn't change anything from the minimal config snippet. - Josh Triplett