Re: [PATCH] modules: sysfs - export: taint, address, size

From: Rusty Russell
Date: Mon Jan 09 2012 - 17:54:50 EST


On Mon, 9 Jan 2012 13:44:52 +0100, Kay Sievers <kay.sievers@xxxxxxxx> wrote:
> On Mon, Jan 9, 2012 at 08:27, Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
> > The else here is weird. ÂShouldn't we leave the exclusion elsewhere?
>
> You mean the 'else if ... TAINT_OOT_MODULE'? It's a one-to-one copy
> of the current code, which just moved up a bit.
>
> Disconnect the two flags form each other?

Yes, I think so.

> > This copies a past mistake, and is definitely wrong. ÂEither expose both
> > pointers and sizes, or don't include init_size here. ÂSure, it'll
> > normally be 0, but if not it's confusing...
>
> Ah, good to know, mod->init_size is 0 for all modules here, so we
> should just drop mod->init_size and maybe name the 'size' attribute to
> 'coresize'?

If a module is still initializing, mod->init_size may well be non-zero.
Let's rename it to coresize, and add initsize.

> > But the bigger question is: Why are we exposing these sizes?
> > /proc/modules did since 2.2, or before, but that doesn't make it the
> > best option...
>
> Good question, I doubt it is too useful, it's just that 'lsmod' shows
> it, so we wanted to show too.

And breaking lsmod output might kill some scripts. So it stays.

Let's drop the address stuff though.

We can actually do something more radical: we could change the kernel to
call modprobe to resolve unresolved symbols. We already support
symbol:<symbol> for symbol_request().

This means that modprobe still needs to maintain a sym->mod mapping
(though I would argue depmod should be moved into the kernel source),
but not any dependency mapping.

Thanks,
Rusty.
--
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/