From: Steven Rostedt <rostedt@goodmis.org>
To: "Viktor Rosendahl (BMW)" <viktor.rosendahl@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org,
Joel Fernandes <joel@joelfernandes.org>
Subject: Re: [PATCH v7 1/4] ftrace: Implement fs notification for tracing_max_latency
Date: Wed, 2 Oct 2019 11:13:24 -0400 [thread overview]
Message-ID: <20191002111324.7590bf6d@gandalf.local.home> (raw)
In-Reply-To: <20190920152219.12920-2-viktor.rosendahl@gmail.com>
On Fri, 20 Sep 2019 17:22:16 +0200
"Viktor Rosendahl (BMW)" <viktor.rosendahl@gmail.com> wrote:
> This patch implements the feature that the tracing_max_latency file,
> e.g. /sys/kernel/debug/tracing/tracing_max_latency will receive
> notifications through the fsnotify framework when a new latency is
> available.
>
> One particularly interesting use of this facility is when enabling
> threshold tracing, through /sys/kernel/debug/tracing/tracing_thresh,
> together with the preempt/irqsoff tracers. This makes it possible to
> implement a user space program that can, with equal probability,
> obtain traces of latencies that occur immediately after each other in
> spite of the fact that the preempt/irqsoff tracers operate in overwrite
> mode.
>
> This facility works with the hwlat, preempt/irqsoff, and wakeup
> tracers.
>
> The tracers may call the latency_fsnotify() from places such as
> __schedule() or do_idle(); this makes it impossible to call
> queue_work() directly without risking a deadlock. The same would
> happen with a softirq, kernel thread or tasklet. For this reason we
> use the irq_work mechanism to call queue_work().
Can fsnotify() be called from irq context? If so, why have the work
queue at all? Just do the work from the irq_work handler.
-- Steve
>
> This patch creates a new workqueue. The reason for doing this is that
> I wanted to use the WQ_UNBOUND and WQ_HIGHPRI flags. My thinking was
> that WQ_UNBOUND might help with the latency in some important cases.
>
> If we use:
>
> queue_work(system_highpri_wq, &tr->fsnotify_work);
>
> then the work will (almost) always execute on the same CPU but if we are
> unlucky that CPU could be too busy while there could be another CPU in
> the system that would be able to process the work soon enough.
>
> queue_work_on() could be used to queue the work on another CPU but it
> seems difficult to select the right CPU.
>
next prev parent reply other threads:[~2019-10-02 15:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-20 15:22 [PATCH v7 0/4] Some new features for the preempt/irqsoff tracers Viktor Rosendahl (BMW)
2019-09-20 15:22 ` [PATCH v7 1/4] ftrace: Implement fs notification for tracing_max_latency Viktor Rosendahl (BMW)
2019-10-02 0:32 ` Joel Fernandes
2019-10-03 10:23 ` Viktor Rosendahl
2019-10-02 15:13 ` Steven Rostedt [this message]
2019-10-02 22:04 ` Viktor Rosendahl
2019-10-02 22:50 ` Steven Rostedt
2019-09-20 15:22 ` [PATCH v7 2/4] preemptirq_delay_test: Add the burst feature and a sysfs trigger Viktor Rosendahl (BMW)
2019-10-02 0:43 ` Joel Fernandes
2019-09-20 15:22 ` [PATCH v7 3/4] Add the latency-collector to tools Viktor Rosendahl (BMW)
2019-09-20 15:22 ` [PATCH v7 4/4] ftrace: Add an option for tracing console latencies Viktor Rosendahl (BMW)
2019-10-02 0:52 ` Joel Fernandes
2019-10-02 22:44 ` Viktor Rosendahl
2019-10-03 13:48 ` Joel Fernandes
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=20191002111324.7590bf6d@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=viktor.rosendahl@gmail.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
all inboxes | Powered by JetHome®