mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: akpm@google.com
Cc: cschan@codeaurora.org, john.stultz@linaro.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2/2] kernel/timer.c: use debugobjects to catch deletion of uninitialized timers
Date: Wed, 21 Sep 2011 10:50:48 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1109211028060.2723@ionos> (raw)
In-Reply-To: <201109202114.p8KLErtg011804@hpaq2.eem.corp.google.com>

Christine,

On Tue, 20 Sep 2011, akpm@google.com wrote:

> From: Christine Chan <cschan@codeaurora.org>
> Subject: kernel/timer.c: use debugobjects to catch deletion of uninitialized timers
> 
> del_timer_sync() calls debug_object_assert_init() to assert that a timer
> has been initialized before calling lock_timer_base().  lock_timer_base()
> would spin forever on a NULL(uninit-ed) base.  The check is added to
> del_timer() to prevent silent failure, even though it would not get stuck
> in an infinite loop.

Ok, that makes sense, but the changelog of the debugobjects code wants
a better explanation.
 
> +/*
> + * fixup_assert_init is called when:
> + * - an untracked/uninit-ed object is found
> + */
> +static int timer_fixup_assert_init(void *addr, enum debug_obj_state state)
> +{
> +	struct timer_list *timer = addr;
> +
> +	switch (state) {
> +	case ODEBUG_STATE_NOTAVAILABLE:
> +		if (timer->entry.prev == TIMER_ENTRY_STATIC) {
> +			/*
> +			 * This is not really a fixup. The timer was
> +			 * statically initialized. We just make sure that it
> +			 * is tracked in the object tracker.
> +			 */
> +			debug_object_init(timer, &timer_debug_descr);
> +			return 0;
> +		} else {
> +			WARN_ON(1);
> +			init_timer(timer);
> +			return 1;

Can we please remove the WARN_ON() and use the return value in the
debugobjects code? That needs a variant of debug_print_object() to give us
proper state output.

Also the fixup function should check for timer->function == NULL and
set a default stub callback.

Thinking more about that, we should do the same for the
timer_fixup_activate() case.

Can you have a stab at that, please?

Thanks,

	tglx

           reply	other threads:[~2011-09-21  8:50 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <201109202114.p8KLErtg011804@hpaq2.eem.corp.google.com>]

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=alpine.LFD.2.02.1109211028060.2723@ionos \
    --to=tglx@linutronix.de \
    --cc=akpm@google.com \
    --cc=cschan@codeaurora.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®