linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harish Jenny Kandiga Nagaraj <harish_kandiga@mentor.com>
To: Michal Marek <mmarek@suse.cz>,
	Lucas De Marchi <lucas.de.marchi@gmail.com>,
	Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-modules <linux-modules@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	greg KH <gregkh@linuxfoundation.org>
Subject: Re: Differences between builtins and modules
Date: Tue, 24 Feb 2015 17:12:06 +0530	[thread overview]
Message-ID: <54EC638E.1060007@mentor.com> (raw)
In-Reply-To: <54EB4C83.2000500@suse.cz>


On Monday 23 February 2015 09:21 PM, Michal Marek wrote:
> On 2015-02-23 15:30, Lucas De Marchi wrote:
>> This could be particularly bad if in a kernel version an option was
>> tristate and in a new version it changed to boolean. I'm not sure if
>> this is common to happen in kernel. Any code that did "modprobe
>> <module>" would start to fail.
> I think it's quite uncommon (*) and also the use case for loading
> builtin modules is not that common. I can think of:
> 1) building the initramfs, to determine which *.ko files need to be
>    copied to it. Since such tools are often updated for other reasons,
>    it's not a big deal.
> 2) Hardcoded module names in things like softdep -- hopefully not that
>    common either, plus the kernel-provided soft dependencies can be
>    fixed together with the change.
>
> Until not so long ago, the kernel would return EINVAL if passed a
> non-existent (renamed, removed) module option to init_module, yet there
> were no attempts at preserving the module options for compatibility reasons.
>
> (*) I now did a quick search:
> $ git log -p origin/master --no-merges -- '*/Kconfig*' | grep -C3 '^-
> *tristate' | grep '^+ *bool'
> +       bool "Intel P state control"
> +       bool "Intel microcode patch loading support"
> +       bool "AMD microcode patch loading support"
> +        bool "STI text console"
> +       bool "Enable DDC2 Support"
> +       bool "Enable Console Acceleration"
>
> That's only 6 cases in the whole git history. Maybe there are a few more
> hidden outside the three-line context as part of larger edits, but I'm
> sure more modules have been *removed* entirely from the kernel over this
> period.
>
>
>> My questions are:
>> 1) should we put *all* the "modules" in the builtin index?
> You mean all *.o files that do not end up in some *.ko? That won't work,
> because unlike module names, the names of object files are not global.
> Plus, there was IIRC an idea to teach lsmod to print builtin modules --
> listing all *.o would make it rather useless.
>
>
>> 2) should we actually check /sys/module/<modulename> to report a
>> module as builtin or just stop doing that and rely solely in the
>> index? Initially I'd like to do the opposite, but given the race in
>> deciding this I'm favoring the index.
> If the race between the creation of /sys/module/<modulename> and
> /sys/module/<modulename>/initstate is inevitable, then I'm afraid we
> have to rely on the index.
>
> Michal

Can we add some flag like
KMOD_PROBE_FORCE_DIRECTORY_CHECK = 0x00040,
and pass it to kmod_module_get_initstate to make
"modprobe --show-depends vt" to report as "builtin" ?

Also if the use case for loading builtin modules is not that common
( Also don’t know if 'modprobe vt' command does the loading if not loaded)
can we have the same flags be used after checking if it is  .ko file or from .o file if required?

  reply	other threads:[~2015-02-24 11:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 14:30 Differences between builtins and modules Lucas De Marchi
2015-02-23 15:51 ` Michal Marek
2015-02-24 11:42   ` Harish Jenny Kandiga Nagaraj [this message]
2015-02-25  1:07     ` Lucas De Marchi
2015-02-25  1:02   ` Lucas De Marchi
2015-02-25 11:53     ` Michal Marek
2015-02-28 17:24       ` Lucas De Marchi
2018-04-07  1:00     ` Randy Dunlap
2018-05-10 12:03       ` Jason Vas Dias

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=54EC638E.1060007@mentor.com \
    --to=harish_kandiga@mentor.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.com \
    --cc=mmarek@suse.cz \
    --cc=rusty@rustcorp.com.au \
    /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;
as well as URLs for NNTP newsgroup(s).