All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Bohrer <shawn.bohrer@gmail.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] module: make modversion_info contain a pointer, not an array.
Date: Thu, 5 Feb 2009 10:01:28 -0600	[thread overview]
Message-ID: <20090205160128.GA9486@mediacenter> (raw)
In-Reply-To: <200901290005.52819.rusty@rustcorp.com.au>

On Thu, Jan 29, 2009 at 12:05:52AM +1030, Rusty Russell wrote:
> With allmodconfig (minus non-building modules) on 32-bit x86:
> Total size of modules before: 60009790 bytes
> Total size of modules after: 55927866 bytes
> 
> Saving 7% of module size for CONFIG_MODVERSIONS=y; and these sections
> are kept resident as well.
> 
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> ---
>  include/linux/module.h |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/module.h b/include/linux/module.h
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -37,10 +37,12 @@ struct kernel_symbol
>  	const char *name;
>  };
>  
> +/* This is put in the __versions section of a module to indicate the version
> + * it expects for unknown symbols. */
>  struct modversion_info
>  {
>  	unsigned long crc;
> -	char name[MODULE_NAME_LEN];
> +	char *name;
>  };

Hey Rusty thanks for the change, but I just got around to testing this
and I have a few observations/questions.  First this breaks:

modprobe --dump-modversions foo.ko

I actually don't care, but just happened to stumble upon it when I also
noticed that your changes seemed to be working a little too well.  I
currently happen to be building my modules out of order for example
module B depends on symbols from module A, but I build module B first.
This means that the exported symbols are not in the Module.symvers file
when module B is compiled.  I would expect module B to fail to load yet
with your patches it magically works and I don't see any errors in the
logs.  If I run:

objdump -s --section __versions B.ko

I only get something like:

Contents of section __versions:
 0000 d782ec86 00000000

Of course if I build the modules in the correct order and dump the
__versions section I see the correct number of crc/char* pairs.

--
Shawn

  parent reply	other threads:[~2009-02-05 16:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 13:35 [PATCH 5/6] module: make modversion_info contain a pointer, not an array Rusty Russell
2009-01-28 14:52 ` Arjan van de Ven
2009-01-28 22:29   ` Rusty Russell
2009-01-28 22:41     ` Arjan van de Ven
2009-01-29  7:44       ` Rusty Russell
2009-01-29  6:50     ` Jon Masters
2009-02-05 16:01 ` Shawn Bohrer [this message]
2009-02-07  2:24   ` Rusty Russell
2009-02-09 17:50     ` Shawn Bohrer
2009-02-10  3:27       ` Rusty Russell

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=20090205160128.GA9486@mediacenter \
    --to=shawn.bohrer@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.