public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Michal Marek <mmarek@suse.cz>
Cc: linux-arch@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	linux-kbuild@vger.kernel.org,
	Randy Dunlap <randy.dunlap@oracle.com>,
	Vegard Nossum <vegard.nossum@gmail.com>
Subject: Re: kbuild: fixing the select problem
Date: Thu, 06 May 2010 09:52:34 -0500	[thread overview]
Message-ID: <1273157554.23208.69.camel@mulgrave.site> (raw)
In-Reply-To: <4BE2D10D.4070706@suse.cz>

On Thu, 2010-05-06 at 16:24 +0200, Michal Marek wrote:
> On 5.5.2010 23:49, James Bottomley wrote:
> > [Sam: I know you don't maintain kbuild anymore, but since you have the
> > most experience, if you could find time to comment, I'd be grateful]
> > 
> > The select problem is that the kbuild select directive will turn a
> > symbol on without reference to its dependencies.  This, in turn, means
> > that either selected symbols must select their dependencies, or that
> > people using select have to be aware of the selected symbol's dependency
> > and build those dependencies into their symbol (leading to duplication
> > and the possibility of getting the dependencies out of sync).  We use
> > select for the scsi transport classes, so we run into this problem in
> > SCSI quite a lot.
> > 
> > I think the correct fix is to make a symbol that selects another symbol
> > automatically inherit all of the selected symbol's dependencies.
> > 
> > There seems to be a fairly easy way to do this in kbuild.  Right at the
> > moment, select is handled as additional symbol values as the last point
> > in the symbol tree evaluation process.  Instead, what I propose doing is
> > for every select symbol, we add an extra unconditional default for the
> > selected symbol of the selecting symbol's current value (this breaks a
> > possible dependency cycle) and add to the dependencies of the selecting
> > symbol, the symbol it's currently selecting.
> 
> Nice trick :-).
> 
> 
> > There's one wrinkle to all of this in that the current parser for
> > default values stops when it finds the first valid (i.e. whose if clause
> > evaluates to true) default.  To make the above scheme work, I need to
> > modify the default parser so it takes the highest tristate of all the
> > valid defaults (and bumps m to y for bool).
> 
> We should check if some Kconfig file doesn't rely on this "first hit"
> behavior and fix it to explicitly list the condition for a given
> default.

I actually asked kconfig to generate the list of symbols (in my config)
with multiple defaults.  It's pretty small and the default y seems to be
the thing with multiple if clauses, so they act like or statements.

The list is

USB_ARCH_HAS_HCD has 4 defaults
DEFCONFIG_LIST has 5 defaults
MAC80211_RC_DEFAULT has 2 defaults
X86_L1_CACHE_SHIFT has 2 defaults
SPLIT_PTLOCK_CPUS has 2 defaults
X86_MINIMUM_CPU_FAMILY has 3 defaults
DEFAULT_TCP_CONG has 2 defaults
DEFCONFIG_LIST has 5 defaults
USB_ARCH_HAS_HCD has 4 defaults
X86_L1_CACHE_SHIFT has 2 defaults
X86_MINIMUM_CPU_FAMILY has 3 defaults
SPLIT_PTLOCK_CPUS has 2 defaults
DEFAULT_TCP_CONG has 2 defaults
MAC80211_RC_DEFAULT has 2 defaults

>  Another option would be to add
> default SYM1 || SYM2
> to a symbol selected by SYM1 and SYM2.

Well, that's effectively what the proposal does (it or's the states).

> > Does this look acceptable to people?  I think it should give the desired
> > result and has the added benefit that we can then strip the extra select
> > overlay out of the kbuild system (making the parser slightly simpler).
> > 
> > If this looks like a good idea to people, I think I can code up a quick
> > patch.
> 
> Other than the above, right now I don't see any issues with such approach.
> 
> On a related note, I see Vegard's GSoC project to use a sat solver for
> kconfig got accepted [1]. Vegard, how is the project progressing?
> 
> [1]
> http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/psu_home/t127230762803
> 
> Michal

James



  parent reply	other threads:[~2010-05-06 14:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 21:49 kbuild: fixing the select problem James Bottomley
2010-05-05 21:49 ` James Bottomley
2010-05-06  6:47 ` Geert Uytterhoeven
2010-05-06  6:47   ` Geert Uytterhoeven
2010-05-06 13:17   ` James Bottomley
2010-05-06 13:17     ` James Bottomley
2010-05-06 13:36     ` Geert Uytterhoeven
2010-05-06 16:47     ` Valdis.Kletnieks
2010-05-06 16:47       ` Valdis.Kletnieks
2010-05-06 17:25       ` Geert Uytterhoeven
2010-05-06 17:25         ` Geert Uytterhoeven
2010-05-06 14:24 ` Michal Marek
2010-05-06 14:24   ` Michal Marek
2010-05-06 14:52   ` James Bottomley [this message]
2010-05-06 14:52     ` James Bottomley
2010-05-06 20:48     ` James Bottomley
2010-05-06 20:59       ` Randy Dunlap
2010-05-06 21:05         ` James Bottomley
2010-05-06 16:52   ` Vegard Nossum
2010-05-07 11:31 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273157554.23208.69.camel@mulgrave.site \
    --to=james.bottomley@hansenpartnership.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=randy.dunlap@oracle.com \
    --cc=sam@ravnborg.org \
    --cc=vegard.nossum@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox