linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jason.yqhu@gmail.com
To: bluesmoke-devel@lists.sourceforge.net
Subject: It seems kobject_put for mci->edac_mci_kobj were called more than kobject_get
Date: Thu, 25 Feb 2010 11:06:23 +0800	[thread overview]
Message-ID: <1f6dcb291002241906m3c5cc7d4o8767d0276ff2228@mail.gmail.com> (raw)

Hi,

It seems that mci->edac_mci_kobj is put more that expected.

A typical call sequence to add a mc device is :

1.  call edac_mc_alloc
mci->edac_mci_kobj was initialized by calling edac_mc_register_sysfs_main_kobj

2. ...

3. edac_mc_add_mc:
added to global list,  but no reference count operation for  mci->edac_mci_kobj

And to  remove a mc device
1. call edac_mc_del_mc
edac_remove_sysfs_mci_device(mci) was called:
    /* unregister this instance's kobject */
    kobject_put(&mci->edac_mci_kobj);
We can  see from the log here that mci is  freed.

2. edac_mc_free:
edac_mc_unregister_sysfs_main_kobj(mci) was called:
    /* delete the kobj from the mc_kset */
    kobject_put(&mci->edac_mci_kobj)

Since mci has been freed. This operation will do nothing if mci is not
reused by others, other wise, a panic occurs.

And sometimes if mci is used after it is freed, there will be strange
debug message output:

EDAC DEBUG: edac_mc_del_mc()
EDAC DEBUG: edac_mc_workq_teardown() mci-0
EDAC DEBUG: edac_remove_sysfs_mci_device()
EDAC DEBUG: edac_remove_sysfs_mci_device()  unreg csrow-0
EDAC DEBUG: edac_csrow_instance_release()
EDAC DEBUG: edac_remove_sysfs_mci_device()  remove_link
EDAC DEBUG: edac_remove_sysfs_mci_device()  remove_mci_instance
EDAC DEBUG: edac_remove_sysfs_mci_device()  unregister this mci kobj
EDAC DEBUG: edac_mci_control_release() mci instance idx=0 releasing
EDAC MC: Removed device 0 for <NULL> <NULL>: DEV <NULL>
EDAC DEBUG: edac_mc_del_mc() mc_devices list is now EMPTY


Could some one help me confirm this ?

Thanks

Jason

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

                 reply	other threads:[~2010-02-25  3:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1f6dcb291002241906m3c5cc7d4o8767d0276ff2228@mail.gmail.com \
    --to=jason.yqhu@gmail.com \
    --cc=bluesmoke-devel@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).