From: Oleg Nesterov <oleg@redhat.com>
To: Zhaolei <zhaolei@cn.fujitsu.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>,
Tom Zanussi <tzanussi@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing/workqueue: Get rid of searching last executed worklet in probe_worklet_complete()
Date: Thu, 21 May 2009 15:05:28 +0200 [thread overview]
Message-ID: <20090521130528.GA14149@redhat.com> (raw)
In-Reply-To: <4A153345.3040905@cn.fujitsu.com>
On 05/21, Zhaolei wrote:
>
> We don't need search workqueue's worklet list for worklet which was latest
> executed, instead, we can use a pointer in cpu_workqueue_stats to remember
> which worklet was just executed.
Minor nit,
> @@ -192,22 +192,11 @@ probe_worklet_complete(struct task_struct *wq_thread, void *work)
> goto end;
>
> found_wq:
> - list_for_each_entry(wfnode, &node->workfunclist, list) {
> - u64 executed_time;
> + executed_time = trace_clock_global() - node->last_workfunc->start_time;
> + node->last_workfunc->total_time += executed_time;
Suppose that "enqueue" handler fails to allocate the memory for the new
work_struct.
This means that the "execute" handler does not record ->last_workfunc.
In that case probe_worklet_complete() uses the wrong workfunc_stats or
we can even crash if ->last_workfunc == NULL.
I think _execute() should set ->last_workfunc = NULL first, then serach
for wfnode. _complete() should check ->last_workfunc != NULL and return
if it is NULL.
Oleg.
next prev parent reply other threads:[~2009-05-21 13:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-21 10:56 [PATCH] tracing/workqueue: Get rid of searching last executed worklet in probe_worklet_complete() Zhaolei
2009-05-21 13:05 ` Oleg Nesterov [this message]
2009-05-22 0:42 ` [PATCH] tracing/workqueue: Get rid of searching last executedworklet " Zhaolei
2009-05-22 2:40 ` [PATCH v2] tracing/workqueue: Get rid of searching last executed worklet " Zhaolei
2009-05-22 18:37 ` Oleg Nesterov
2009-05-26 20:23 ` Frederic Weisbecker
2009-05-27 18:32 ` Oleg Nesterov
2009-05-24 21:30 ` Frederic Weisbecker
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=20090521130528.GA14149@redhat.com \
--to=oleg@redhat.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=tzanussi@gmail.com \
--cc=zhaolei@cn.fujitsu.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