[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250927104321.50c71086@batman.local.home>
Date: Sat, 27 Sep 2025 10:43:21 -0400
From: Steven Rostedt <rostedt@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Masami
Hiramatsu <mhiramat@...nel.org>, Mark Rutland <mark.rutland@....com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Andrew Morton
<akpm@...ux-foundation.org>, Namhyung Kim <namhyung@...nel.org>, Takaya
Saeki <takayas@...gle.com>, Tom Zanussi <zanussi@...nel.org>, Thomas
Gleixner <tglx@...utronix.de>, Ian Rogers <irogers@...gle.com>, Douglas
Raillard <douglas.raillard@....com>
Subject: Re: [PATCH v2 3/8] tracing: Have syscall trace events read user
space string
On Thu, 25 Sep 2025 07:15:45 -0400
Steven Rostedt <rostedt@...nel.org> wrote:
> I have yet to cause the retry path under stress tests. I had to insert
> a msleep() for testing purposes to make sure it worked.
I wanted to update on this. My stress test wasn't stressing enough. So
I took a "cp-mmap" program I had that did this:
map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, ifd, 0);
if (map == MAP_FAILED)
exit(-1);
ofd = open(argv[2], O_WRONLY | O_TRUNC | O_CREAT, 0644);
if (ofd < 0)
exit(-1);
do {
r = write(ofd, map + w, st.st_size - w);
if (r < 0)
exit(-1);
w += r;
} while (w < st.st_size);
Where it mmaps the source file and then writes that. This would most
definitely fault at every write. Then I ran this while tracing
sys_entry_write() and an added trace_printk() in the goto again block:
# mkdir /tmp/dump
# for f in `find /usr/bin/ ` ; do n=`basename $f`; ./cp-mmap $f /tmp/dump/$n & done
And this did cause triggering:
12771 writes where it triggered the again loop 1635 times.
Thus, it triggered 12% of the time under a very intensive stress.
That's still faster than allocation, not to mention if one is tracing
both system calls and allocations, it will start to dirty the trace.
-- Steve
Powered by blists - more mailing lists