From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Correct sparse warning about different lock contexts for basic block
Date: Thu, 28 Oct 2010 11:49:31 +0200 [thread overview]
Message-ID: <201010281149.45974.sven.eckelmann@gmx.de> (raw)
In-Reply-To: <1288166545-8252-1-git-send-email-sven.eckelmann@gmx.de>
[-- Attachment #1: Type: Text/Plain, Size: 2305 bytes --]
On Wednesday 27 October 2010 10:02:25 Sven Eckelmann wrote:
> sparse noticed that if_list_lock is taken in some situations with bottom
> halfes disabled in some SMP kernels and that we must always lock it with
> spin_lock_bh.
I would like to reject that patch by myself. Not that it does something bad,
but more that it does not make any sense what sparse says. I've looked through
the 2.6.32 smp code and couldn't locate the real problem. So if anyone has a
opinion or can show were the actual problem is... please tell me.
My current test was done like that (on debian squeeze i386):
-----------------------------------------------------------
$ cd $MY_v2.6.32
$ make mrproper
$ make allnoconfig
$ grep -v 'CONFIG_MODULES is not set' .config > .config.tmp; mv .config.tmp \
.config
$ grep -v 'CONFIG_NET is not set' .config > .config.tmp; mv .config.tmp \
.config
$ grep -v 'CONFIG_SMP is not set' .config > .config.tmp; mv .config.tmp \
.config
$ grep -v 'CONFIG_MODULE_UNLOAD is not set' .config > .config.tmp; mv \
.config.tmp .config
$ echo 'CONFIG_MODULES=y' >> .config
$ echo 'CONFIG_NET=y' >> .config
$ echo 'CONFIG_SMP=y' >> .config
$ echo 'CONFIG_MODULE_UNLOAD=y' >> .config
$ echo 'xy'|make menuconfig
$ make prepare
$ make modules
$ mkdir test
$ cd test
$ cat << EOF > Makefile
obj-m += test.o
test-y += main.o
EOF
$ cat << EOF > main.c
#include <linux/module.h>
#include <linux/spinlock.h>
static DEFINE_SPINLOCK(testlock);
static int __init test_init(void)
{
spin_lock(&testlock);
spin_unlock(&testlock);
return 0;
}
static void __exit test_exit(void)
{
}
module_init(test_init);
module_exit(test_exit);
EOF
$ make CC=cgcc -C $MY_v2.6.32/linux-next M=$(pwd) modules
make: Entering directory `$MY_v2.6.32'
CC [M] $MY_v2.6.32/testmodule/main.o
$MY_v2.6.32/test/main.c:6:19: warning: context imbalance in 'test_init' -
wrong count at exit
LD [M] $MY_v2.6.32/test/test.o
Building modules, stage 2.
MODPOST 1 modules
LD [M] $MY_v2.6.32/test/test.ko
make: Leaving directory `$MY_v2.6.32'
-----------------------------------------------------------
The sparse version was v0.4.3.
I will post a question regarding that problem on the sparse mailinglist
Best regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2010-10-28 9:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-27 8:02 [B.A.T.M.A.N.] [PATCH] batman-adv: Correct sparse warning about different lock contexts for basic block Sven Eckelmann
2010-10-28 9:49 ` Sven Eckelmann [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=201010281149.45974.sven.eckelmann@gmx.de \
--to=sven.eckelmann@gmx.de \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/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