From: Greg KH <greg@kroah.com>
To: Akinobu Mita <mita@miraclelinux.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [patch 2/4] kref debugging config option
Date: Mon, 24 Apr 2006 20:52:16 -0700 [thread overview]
Message-ID: <20060425035216.GC18085@kroah.com> (raw)
In-Reply-To: <20060424083342.069630000@localhost.localdomain>
On Mon, Apr 24, 2006 at 04:33:35PM +0800, Akinobu Mita wrote:
> This patch converts all WARN_ON() in kref code to BUG_ON().
> And split them into new DEBUG_KREF config option.
>
> Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
>
> lib/Kconfig.debug | 7 +++++++
> lib/kref.c | 30 +++++++++++++++++++++++++-----
> 2 files changed, 32 insertions(+), 5 deletions(-)
>
> Index: 2.6-git/lib/Kconfig.debug
> ===================================================================
> --- 2.6-git.orig/lib/Kconfig.debug
> +++ 2.6-git/lib/Kconfig.debug
> @@ -130,6 +130,13 @@ config DEBUG_KOBJECT
> If you say Y here, some extra kobject debugging messages will be sent
> to the syslog.
>
> +config DEBUG_KREF
> + bool "kref debugging"
> + depends on DEBUG_KERNEL
> + help
> + This option enables addition error checking for kref,
> + library routines for handling generic reference counted objects.
> +
> config DEBUG_HIGHMEM
> bool "Highmem debugging"
> depends on DEBUG_KERNEL && HIGHMEM
> Index: 2.6-git/lib/kref.c
> ===================================================================
> --- 2.6-git.orig/lib/kref.c
> +++ 2.6-git/lib/kref.c
> @@ -20,16 +20,38 @@
> */
> void kref_init(struct kref *kref)
> {
> - atomic_set(&kref->refcount,1);
> + atomic_set(&kref->refcount, 1);
> }
>
> +#ifdef CONFIG_DEBUG_KREF
> +static void kref_get_debug_check(struct kref *kref)
> +{
> + BUG_ON(!atomic_read(&kref->refcount));
> +}
Eeek, no, you do not want to do this. Unless you never want to get a
bug report with this enabled :)
thanks,
greg k-h
next prev parent reply other threads:[~2006-04-25 3:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-24 8:33 [patch 0/4] kref debugging Akinobu Mita
2006-04-24 8:33 ` [patch 1/4] kref: warn kref_put() with unreferenced kref Akinobu Mita
2006-04-25 3:51 ` Greg KH
2006-04-25 4:19 ` Valdis.Kletnieks
2006-04-25 5:11 ` Greg KH
2006-04-25 4:34 ` Akinobu Mita
2006-04-25 5:09 ` Greg KH
2006-04-25 6:27 ` Akinobu Mita
2006-04-27 11:45 ` Rogier Wolff
2006-04-24 8:33 ` [patch 2/4] kref debugging config option Akinobu Mita
2006-04-24 21:38 ` Andrew Morton
2006-04-25 4:53 ` Akinobu Mita
2006-04-25 5:08 ` Greg KH
2006-04-25 3:52 ` Greg KH [this message]
2006-04-24 8:33 ` [patch 3/4] dynamic configurable kref debugging Akinobu Mita
2006-04-25 3:55 ` Greg KH
2006-04-24 8:33 ` [patch 4/4] change slab poison pattern Akinobu Mita
2006-04-24 9:20 ` Pekka Enberg
2006-04-24 10:23 ` Akinobu Mita
2006-04-24 15:33 ` Matt Mackall
2006-04-25 3:49 ` [patch 0/4] kref debugging Greg KH
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=20060425035216.GC18085@kroah.com \
--to=greg@kroah.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mita@miraclelinux.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
Powered by JetHome