From: Greg KH <gregkh@suse.de>
To: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Andrew Morton <akpm@osdl.org>, Arjan <arjan@linux.intel.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: kref refcnt and false positives
Date: Wed, 13 Dec 2006 16:12:46 -0800 [thread overview]
Message-ID: <20061214001246.GA10056@suse.de> (raw)
In-Reply-To: <20061213153408.A13049@unix-os.sc.intel.com>
On Wed, Dec 13, 2006 at 03:34:08PM -0800, Venkatesh Pallipadi wrote:
>
> With WARN_ON addition to kobject_init()
> [ http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.19/2.6.19-mm1/dont-use/broken-out/gregkh-driver-kobject-warn.patch ]
>
> I started seeing following WARNING on CPU offline followed by online on my
> x86_64 system.
>
> WARNING at lib/kobject.c:172 kobject_init()
>
> Call Trace:
> [<ffffffff8020ab45>] dump_trace+0xaa/0x3ef
> [<ffffffff8020aec4>] show_trace+0x3a/0x50
> [<ffffffff8020b0f6>] dump_stack+0x15/0x17
> [<ffffffff80350abc>] kobject_init+0x3f/0x8a
> [<ffffffff80350be1>] kobject_register+0x1a/0x3e
> [<ffffffff803bbd89>] sysdev_register+0x5b/0xf9
> [<ffffffff80211d0b>] mce_create_device+0x77/0xf4
> [<ffffffff80211dc2>] mce_cpu_callback+0x3a/0xe5
> [<ffffffff805632fd>] notifier_call_chain+0x26/0x3b
> [<ffffffff8023f6f3>] raw_notifier_call_chain+0x9/0xb
> [<ffffffff802519bf>] _cpu_up+0xb4/0xdc
> [<ffffffff80251a12>] cpu_up+0x2b/0x42
> [<ffffffff803bef00>] store_online+0x4a/0x72
> [<ffffffff803bb6ce>] sysdev_store+0x24/0x26
> [<ffffffff802baaa2>] sysfs_write_file+0xcf/0xfc
> [<ffffffff8027fc6f>] vfs_write+0xae/0x154
> [<ffffffff80280418>] sys_write+0x47/0x6f
> [<ffffffff8020963e>] system_call+0x7e/0x83
> DWARF2 unwinder stuck at system_call+0x7e/0x83
> Leftover inexact backtrace:
>
> This is a false positive as mce.c is unregistering/registering sysfs
> interfaces cleanly on hotplug.
The warning above tends to look like this is not true.
> kref_put() and conditional decrement of refcnt seems to be the root cause
> for this and the patch below resolves the issue for me.
Why?
Are you properly initializing your kref to null before you register it
with the driver core? Or is it a static object?
> Original comment seemed to indicate that this conditional thing was
> performance related. Is it really? If not, we should consider the below patch.
Yes, it's a performance gain and I don't see how this patch would change
the above warning.
thanks,
greg k-h
next prev parent reply other threads:[~2006-12-14 0:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-13 23:34 kref refcnt and false positives Venkatesh Pallipadi
2006-12-14 0:12 ` Greg KH [this message]
2006-12-14 0:08 ` Venkatesh Pallipadi
2006-12-14 0:41 ` Andrew Morton
2006-12-14 7:56 ` Eric Dumazet
-- strict thread matches above, loose matches on Subject: below --
2006-12-14 23:51 Pallipadi, Venkatesh
2006-12-15 0:19 ` Eric W. Biederman
2006-12-15 0:35 ` Andrew Morton
2006-12-15 0:53 ` Eric W. Biederman
[not found] <200612210901.kBL91MwR027509@hera.kernel.org>
2006-12-31 15:16 ` David Woodhouse
2007-01-01 20:13 ` Benjamin Herrenschmidt
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=20061214001246.GA10056@suse.de \
--to=gregkh@suse.de \
--cc=akpm@osdl.org \
--cc=arjan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=venkatesh.pallipadi@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