Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5573179ima; Tue, 5 Feb 2019 14:14:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IZCYfSMfd0JX/R4wx/PGNedTeVUgVBm5LVD498US4sr9Njafl5irPr4JkMl7BHEu7RcBwTm X-Received: by 2002:a62:37c3:: with SMTP id e186mr7398047pfa.251.1549404884126; Tue, 05 Feb 2019 14:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549404884; cv=none; d=google.com; s=arc-20160816; b=UGqeo5Hq43sVr/pDW+LghY3/J16/ca5QFx6ydMIPe9CFR/FvT+iLlpjPS5Q2al7aDt zWVnR52JSooN9zEW1ahIoedAKuUjhAVX9/YT8MrWhyMjt9+o6iHCnJRnwpIq669cuj9+ MtJcdan8A3N0qne61ItcY6ymiMi9mQ7IU6F9YxTGJNPlNU7vhMel8NMFrCIM+7fUjGpJ K4WF+Mnb8EglyoGhNAsSNNrbsEhJkQTl9/x9ug7PjB2Wb0d8CTvTu8UjRUPdWS0DspoW HnKC5PGI68u0K4FyZk28BvHq49wDcrexZO88qlt55ryns3bmuFOv+3vsh1sUqQ9tMW4e Kq6A== 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; bh=4fQxn99cknxXOn7oGw3R5ANr9NjWIN3E6ynQ/2EcXV4=; b=D28PX0x6BYFx6in2F1fOKz2yYEJM4PFROnLaonLfkf95c0MbobNDLujWlwDPeVphV9 3clFUlbBj6UAWfbePNi+PZKHBQHcH3GsuF83/DkohALmxV2jx+xW5HfCohynqnn4VL/e SNr65SzbXmTEZrSE7tti/sC1739sPW3AQWfJ+44yJ5Z197c9Lpj7PMzVYk5tfFnp/xNI irot5XQJmA92q+TyLGUgYeRiAXzmV6MJb5/DX5LFUHk4kkYZejfQ/LcBNiX2VwD8DvhW XQ8OSBonnW1BIrNivYdK2qsuYKNq5H9idEyAP584+RntHfiGQoQhQyMkTDNvK1I9oh+m jSbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fbpST3Ce; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n32si4050705pgm.439.2019.02.05.14.14.28; Tue, 05 Feb 2019 14:14:44 -0800 (PST) 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=@kernel.org header.s=default header.b=fbpST3Ce; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729890AbfBEWID (ORCPT + 99 others); Tue, 5 Feb 2019 17:08:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:55506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726114AbfBEWID (ORCPT ); Tue, 5 Feb 2019 17:08:03 -0500 Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B7CCD218A1; Tue, 5 Feb 2019 22:08:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549404481; bh=33gU8Y67ldAEaOcxe+uTft9byPtSrzIGHSfE+Y3SiQM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fbpST3CeLMzonZVG0QSgJ5FSMAPzLvRaNguVm+sMWh7p70d7JxVl0k9D1UCZipDa/ UwZCvKL74EEUpdmrHzvWCWzVbF5z98EH1geSe071aWnczmhR0+xUxGCinwQ9aoRYHR X2JmTw3y+nAqAR1XlAgRIlzQvafbFKDIdXf1IIG0= Received: by mail-ua1-f49.google.com with SMTP id d2so1667431ual.2; Tue, 05 Feb 2019 14:08:01 -0800 (PST) X-Gm-Message-State: AHQUAubnfxIYJgF2r/wTT02fiJkST0mGutd03TCHyLwDT5iihIamsztu Xsvh7rBXj+cwDh+0ykftUuGLJ8HldQDvz/v0DAc= X-Received: by 2002:ab0:63d6:: with SMTP id i22mr2721638uap.137.1549404480766; Tue, 05 Feb 2019 14:08:00 -0800 (PST) MIME-Version: 1.0 References: <1471462023-119645-1-git-send-email-cristina.moraru09@gmail.com> <20160818175505.GM3296@wotan.suse.de> <20160825074313.GC18622@lst.de> <20160825201919.GE3296@wotan.suse.de> In-Reply-To: <20160825201919.GE3296@wotan.suse.de> From: Luis Chamberlain Date: Tue, 5 Feb 2019 16:07:46 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 0/5] Add CONFIG symbol as module attribute To: Christoph Hellwig , Brendan Higgins Cc: Cristina Moraru , "vegard.nossum@gmail.com" , Valentin Rothberg , Hannes Reinecke , Sam Ravnborg , Michal Marek , "linux-kernel@vger.kernel.org" , Tom Gundersen , Kay Sievers , Rusty Russell , Andrew Morton , backports@vger.kernel.org, Guenter Roeck , Greg Kroah-Hartman , "rafael.j.wysocki" , Dmitry Torokhov , Takashi Iwai , Mauro Carvalho Chehab , Johannes Berg , Hauke Mehrtens , Paul Bolle , Paul Gortmaker , Alexey Khoroshilov , Sathya Prakash Veerichetty , "Martin K. Petersen" , Laurence Oberman , Johannes Thumshirn , Tejun Heo , Jej B , "Theodore Ts'o" , danijons@student.chalmers.se, Andrzej Wasowski 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 Thu, Aug 25, 2016 at 2:19 PM Luis R. Rodriguez wrote: > > On Thu, Aug 25, 2016 at 09:43:13AM +0200, Christoph Hellwig wrote: > > The idea seems useful, but I reallt don't like the 'reverse-engineering' > > approach. > > > > If we want to this properly from the ground up we should just split out > > our CONFIG_ SYMBOLS into > > > > MODULE_* - builds exactly one module (tristate, or maybe also as a built-in > > only one, then like a bool) > > > > CONFIG_* - just bool, MODULE_ may depend on it, too. > > Curious what does the split buy us if the real meaningful input is the value > assigned to the config ? Ie, MODULE_FOO=m would be the modules we want to > check for. Also, unless you have kernel sources I don't think you could still easily infer which MODULE_* config option enabled the module, could you? And this was one of the original goals with this patch set. I still think extending the modinfo section would be needed to allow udevadm info to easily extract the information, no? > > The other nice thing is that we could probably fold most of the Makefiles > > into Kconfig using that methods as well, by listing the objectes required > > for a module, e.g. > > OK If the Kconfig file has the objects listed I can see the gain of using > Kconfig then to more easily map out to a symbol, given doing this on Makefiles > is not straight forward. > > > module NVME_TARGET > > tristate "NVMe Target support" > > depends on BLOCK > > depends on CONFIGFS_FS > > name nvmet > > objects core.o configfs.o admin-cmd.o io-cmd.o fabrics-cmd.o > > objects discovery.o > > > > module NVME_TARGET_LOOP > > tristate "NVMe loopback device support" > > depends on BLK_DEV_NVME > > depends on NVME_TARGET > > select NVME_FABRICS > > select SG_POOL > > name nvme-loop > > objects loop.o > > I can see a huge win of having a direct specification that provides as a > feature two way mapping from CONFIG <--> module (objects) and backwards again > easily and clearly without hacks, specially if upon boot then we can then > provide the precise kernel configuration you need, for both built-in and > modules. The above could help with modules -- for built-in reverse mapping > we'd need something else, perhaps a configurable option to keep tabs on > inits called with associated configs. > > The above would be a pretty intrusive change though, in comparison to > Cristina's original approach. I think this is the biggest issue so far, and that we have no code to showcase for it. Meanwhile pegging at least a kconfig symbol to modinfo for at least a lot of modules would help considerably for other use cases mentioned. > The reverse-engineering object --> config > aspect of her work and of the old scripts/kconfig/streamline_config.pl > explains why it was hard. I'd be curious to learn of other gains possible > other than those listed so far, if we had this. > > Re-iterating gains of having a simple two way CONFIG <--> module (objects) > mapping (following the above proposal now): > > a) When optimizing build requirements for a kernel for a system. > That is you boot into a distro kernel and then want to build > a slim kernel only with sensible kernel configuration options. > > b) When you are on a distribution kernel but the distribution > kernel provided lacks hardware support for your device, you > may either want to upgrade the full kernel in which case you > want to do a) or -- you may want to just a backports release > which provides just the modules you need, you'd use it on top > of the distribution kernel. > > c) Having the mapping in sysfs would allow to simplify > streamline_config.pl avoid parsing Makefiles in perl. (From Michal) It took me a while to recall where this was and why after 3 years of not following up on this thread. So in case others fall into the same boat, the sysfs gain here is that the modinfo section could be readable then on any module's: /sys/module/e1000/section/kconfig_symb > d) Fold most of the Makefiles into Kconfig > > In retrospect c) still seems related to a) as we'd do away with > the hacks completely needed by streamline_config.pl, a) can be > augmented if we figure out a built-in solution as well. > > d) Just seems like collateral of a more precise mapping than > what a Makefile provides. Anything else ? In lieu of no Luke Skywalker, if you will, for a large kconfig revamp on this, I'm inclined to believe *at least* having some kconfig_symb exposed for some modules is better than nothing. Christoph are you totally opposed to this effort until we get a non-reverse engineered effort in place? It just seems like an extraordinary amount of work and I'm not quite sure who's volunteering to do it. Other stakeholders may benefit from at least having some config --> module mapping for now. Not just backports or building slimmer kernels. Luis