* [PATCH] kernel/module.c Getting rid of the redundant spinlock in resolve_symbol()
@ 2005-12-15 4:32 Ashutosh Naik
0 siblings, 0 replies; only message in thread
From: Ashutosh Naik @ 2005-12-15 4:32 UTC (permalink / raw)
To: Rusty Russell
Cc: Jesper Juhl, anandhkrishnan, linux-kernel, rth, akpm, Greg KH, alan
[-- Attachment #1: Type: text/plain, Size: 753 bytes --]
On 12/15/05, Rusty Russell <rusty@rustcorp.com.au> wrote:
> On Wed, 2005-12-14 at 11:16 +0530, Ashutosh Naik wrote:
> > On 12/14/05, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > Was just wondering, in that case, if we really need the spinlock in
> > resolve_symbol() function, where there exists a spinlock around the
> > __find_symbol() function
>
> Yes, I think that's redundant as well. We're not altering the module
> list itself, so either of the two locks is sufficient, and we have the
> semaphore.
Changelog -
This patch gets rid of the redundant spinlock in the function
resolve_symbol() as we are not altering the module list, and we
already hold the semaphore.
Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
[-- Attachment #2: mod-patch2.txt --]
[-- Type: text/plain, Size: 684 bytes --]
diff -Naurp linux-2.6.15-rc5-vanilla/kernel/module.c linux-2.6.15-rc5/kernel/module.c
--- linux-2.6.15-rc5-vanilla/kernel/module.c 2005-12-14 10:14:08.000000000 +0530
+++ linux-2.6.15-rc5/kernel/module.c 2005-12-15 09:41:59.000000000 +0530
@@ -958,7 +958,6 @@ static unsigned long resolve_symbol(Elf_
unsigned long ret;
const unsigned long *crc;
- spin_lock_irq(&modlist_lock);
ret = __find_symbol(name, &owner, &crc, mod->license_gplok);
if (ret) {
/* use_module can fail due to OOM, or module unloading */
@@ -966,7 +965,6 @@ static unsigned long resolve_symbol(Elf_
!use_module(mod, owner))
ret = 0;
}
- spin_unlock_irq(&modlist_lock);
return ret;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-12-16 3:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-15 4:32 [PATCH] kernel/module.c Getting rid of the redundant spinlock in resolve_symbol() Ashutosh Naik
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).