Re: [RFC/PATCH] init/main.c: Simplify initcall_blacklisted()
From: Prarit Bhargava
Date: Tue Jan 20 2015 - 13:40:26 EST
On 01/20/2015 01:05 PM, Oleg Nesterov wrote:
> On 01/20, Prarit Bhargava wrote:
>>
>> On 01/19/2015 08:05 PM, Rusty Russell wrote:
>>> Oleg Nesterov <oleg@xxxxxxxxxx> writes:
>>>>
>>>> If we want to optimize this... I am wondering if we can change
>>>> initcall_blacklist()
>>>>
>>>> - entry->buf = alloc_bootmem(strlen(str_entry) + 1);
>>>> + ebtry->fn = kallsyms_lookup_name(str_entry);
>>>>
>>>> and then change initcall_blacklisted() to just compare the pointers.
>>>
>>> That would make far, far more sense. It would fail for modules of
>>> course, but that might be OK. Prarit, this was your code; does it
>>> matter?
>>
>> It does actually matter to me. I've been using it to blacklist modules at boot
>> as well ... and it works really well :) So I'm okay with the original patch but
>> not the second suggested change.
>
> Yes, I didn't know/realize that initcall_blacklist paramater can be
> also used to disable the modules, thanks for correcting me.
I didn't have that in mind originally, but I've been using it to debug initramfs
module loading. It has worked quite well.
>
> But I'd say that initcall_blacklisted(mod->init) looks a bit strange,
> I mean it would be probably better to use mod->name in this case, not
> the "internal" name of this likely static function.
:) I've been thinking about exactly this too. I just haven't had any time to
do it.
>
> Perhaps even another kernel parameter makes sense for this, I dunno..
> From Documentation/kernel-parameters.txt:
>
> initcall_blacklist= [KNL] Do not execute a comma-separated list of
> initcall functions. Useful for debugging built-in
> modules and initcalls.
>
> note that this only mentions built-in modules.
I can fix that up too.
P.
>
> Nevermind, I was wrong anyway. Thanks!
>
> Oleg.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/