From: Thomas Gleixner <tglx@linutronix.de>
To: "Du, Changbin" <changbin.du@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
josh@joshtriplett.org, Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
jiangshanlai@gmail.com, John Stultz <john.stultz@linaro.org>,
Tejun Heo <tj@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] debugobjects: insulate non-fixup logic related to static obj from fixup callbacks
Date: Sat, 7 May 2016 10:26:28 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.11.1605071024440.3540@nanos> (raw)
In-Reply-To: <1462576157-14539-1-git-send-email-changbin.du@intel.com>
On Sat, 7 May 2016, changbin.du@intel.com wrote:
Can you please fix your mail client. Every mail you send has:
Cc: .....
"Du, Changbin" <changbin.du@intel.com>,
Du
And that stray 'Du' is just broken.
> At last, I have a concern about the fixups that can it change the
> object which is in incorrect state on fixup? Because the 'addr' may
> not point to any valid object if a non-static object is not tracked.
> Then Change such object can overwrite someone's memory and cause
> unexpected behaviour. For example, the timer_fixup_activate bind
> timer to function stub_timer.
Well, you have the choice of:
1) Leave the object uninitialized and watch the resulting explosion
2) Assume that the pointer is a valid object and initialize it
The latter has been chosen as the lesser of two evils.
> raw_spin_unlock_irqrestore(&db->lock, flags);
> /*
> - * Maybe the object is static. Let the type specific
> + * Maybe the object is static. Let the type specific
> * code decide what to do.
Instead of doing white space changes you really want to explain the logic
here.
> */
> - if (debug_object_fixup(descr->fixup_assert_init, addr,
> - ODEBUG_STATE_NOTAVAILABLE))
> + if (descr->is_static_object && descr->is_static_object(addr)) {
> + /* Make sure that it is tracked in the object tracker */
> + debug_object_init(addr, descr);
> + } else {
> debug_print_object(&o, "assert_init");
> + debug_object_fixup(descr->fixup_assert_init, addr,
> + ODEBUG_STATE_NOTAVAILABLE);
> + }
> return;
> }
Other than the missing comment this looks good.
Thanks,
tglx
next prev parent reply other threads:[~2016-05-07 8:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-06 23:09 [PATCH] debugobjects: insulate non-fixup logic related to static obj from fixup callbacks changbin.du
2016-05-07 0:16 ` kbuild test robot
2016-05-07 8:26 ` Thomas Gleixner [this message]
2016-05-07 12:47 ` Paul E. McKenney
2016-05-08 7:44 ` Du, Changbin
2016-05-08 16:09 ` Thomas Gleixner
2016-05-09 3:02 ` Du, Changbin
2016-05-09 7:03 ` [PATCH v2] " changbin.du
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.DEB.2.11.1605071024440.3540@nanos \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=changbin.du@intel.com \
--cc=jiangshanlai@gmail.com \
--cc=john.stultz@linaro.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rostedt@goodmis.org \
--cc=tj@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