public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>, akpm@osdl.org
Cc: tony.luck@intel.com, "Systemtap" <systemtap@sources.redhat.com>,
	"Jim Keniston" <jkenisto@us.ibm.com>,
	"Keith Owens" <kaos@sgi.com>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Subject: [patch 2/2] Link new module to the tail of module list
Date: Tue, 10 Jan 2006 12:39:14 -0800	[thread overview]
Message-ID: <20060110204045.894417221@csdlinux-2.jf.intel.com> (raw)
In-Reply-To: 20060110203912.007577046@csdlinux-2.jf.intel.com

[-- Attachment #1: module_link_order.patch --]
[-- Type: text/plain, Size: 1350 bytes --]

[PATCH] Link new module to the tail of module list

When we are linking/adding a new module, it would be
better to insert the new module to the tail of the
module list. 

The reason is when kallsyms_lookup_name(name)
looks for the text address corresponding to the name
from the head of the module list, we always hit the
module exporting the text address first and then the
module using the text address later. This helps
kallsyms_lookup_name() search which indeed need
the text address.

Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
-------------------------------------------------------------------

 kernel/module.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

Index: linux-2.6.15-mm1/kernel/module.c
===================================================================
--- linux-2.6.15-mm1.orig/kernel/module.c
+++ linux-2.6.15-mm1/kernel/module.c
@@ -1911,7 +1911,12 @@ static struct module *load_module(void _
 static int __link_module(void *_mod)
 {
 	struct module *mod = _mod;
-	list_add(&mod->list, &modules);
+	/* Insert the new modules at the tail of the list,
+	 * so kallsyms_lookup_name finds the module exporting
+	 * the text address of a function first and quickens
+	 * the search when searching based on function name
+	 */
+	list_add_tail(&mod->list, &modules);
 	return 0;
 }
 

--


      parent reply	other threads:[~2006-01-10 19:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-10 20:39 kallsyms_lookup_name should return the text addres Anil S Keshavamurthy
2006-01-10 20:39 ` [patch 1/2] [BUG]kallsyms_lookup_name " Anil S Keshavamurthy
2006-01-10 20:45   ` Paulo Marques
2006-01-10 21:07     ` Keshavamurthy Anil S
2006-01-10 23:11       ` Keith Owens
2006-01-10 23:29         ` Keshavamurthy Anil S
2006-01-11  0:02           ` Keith Owens
2006-01-11  0:07             ` Randy.Dunlap
2006-01-11  0:23               ` Keith Owens
2006-01-11  0:39                 ` Keshavamurthy Anil S
2006-01-11  2:26                   ` Frank Ch. Eigler
2006-01-10 20:39 ` Anil S Keshavamurthy [this message]

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=20060110204045.894417221@csdlinux-2.jf.intel.com \
    --to=anil.s.keshavamurthy@intel.com \
    --cc=akpm@osdl.org \
    --cc=jkenisto@us.ibm.com \
    --cc=kaos@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=systemtap@sources.redhat.com \
    --cc=tony.luck@intel.com \
    /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