Linux Trace Kernel
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: Roman Storozhenko <romeusmeister@gmail.com>
Cc: "Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,
	"Radim Krčmář" <rkrcmar@ventanamicro.com>
Subject: Re: [PATCH v2] riscv: mm: Trace TLB flush path selection
Date: Thu, 15 Oct 2026 12:27:05 +0800	[thread overview]
Message-ID: <atBWGQ2iWpm2VKcY@xhacker> (raw)
In-Reply-To: <atAROTefufggiFPO@xhacker>

On Thu, Oct 15, 2026 at 07:33:13AM +0800, Jisheng Zhang wrote:
> On Wed, Oct 14, 2026 at 05:58:42PM +0200, Roman Storozhenko wrote:
> > Hi Jisheng,
> > 
> > Thanks for the clarification.
> > 
> > Since Radim's tracepoint code-generation results are now part of this
> > discussion, I've added him to Cc in case I misinterpret any aspect of
> > that issue.
> > 
> > I agree with you on one point regarding the compiler overhead. Since
> > the kernel supports older GCC versions, we have to take the code
> > generated by those supported compilers into account today. So
> > describing the issue simply as temporary was too strong.
> > 
> > However, I think there are two separate questions here: whether the
> > event exposes useful information, and whether the disabled-path cost
> > of its current implementation is acceptable.
> > 
> > Regarding kprobes, most of the raw fields in this event are indeed
> > already arguments of `__flush_tlb_range()`. My point is not that these
> > values are impossible to obtain dynamically.
> > 
> > Kprobes can be used to observe a very large part of the kernel. If the
> > ability to reconstruct an event with kprobes were by itself sufficient
> > reason not to add a tracepoint, the same reasoning would apply to many
> > existing tracepoints.
> > 
> > The distinction I see here is between observing implementation details
> > and exposing the semantic event directly.
> > 
> > For this case, the interesting information is not only `start`,
> > `size`, `stride`, `cmask`, etc., but their correlation with the path
> > Linux selected for that particular request:
> > 
> >         local
> >         SBI RFENCE
> >         cross-CPU call
> > 
> > Calculating the local case from `cmask` may be simple with the current
> > implementation, but the tracing program still has to reproduce
> > knowledge of the selection logic. Likewise, observing downstream
> > functions ties the tracing program to the current call graph.
> > 
> > I also don't think `/proc/interrupts` provides equivalent information here.
> > 
> > The RISC-V IPI statistics are aggregate counters. In particular, Linux
> > accounts `IPI_CALL_FUNC` as "Function call interrupts", while SBI
> > RFENCE is handled below Linux by firmware; for example, OpenSBI
> > implements the remote TLB operation using its own `IPI_TLB` event.
> 
> I think you misunderstood something. A riscv platform uses either
> SBI RFENCE or IPI for tlb shootdown, and won't change. So you can
> know whether the system is SBI RFENCE powered or IPI powered by
> cat /proc/interrupts. It's much simpler.

Aha, I missed aclint sswi case, if sswi, no explict /proc/interrupts
difference between sswi and traditonal plic. However, whether TLB is
powered by SBI RFENCE or IPI can still be known by checking
"providing IPIs using SBI IPI extension" in dmesg.

  reply	other threads:[~2026-10-15  4:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-30 14:36 [PATCH v2] riscv: mm: Trace TLB flush path selection Roman 'Hedin' Storozhenko
2026-09-13 10:14 ` Roman Storozhenko
2026-10-02 15:44 ` Jisheng Zhang
2026-10-03  8:54   ` Roman Storozhenko
2026-10-10  4:24     ` Jisheng Zhang
2026-10-11 12:43       ` Roman Storozhenko
2026-10-14  5:05         ` Jisheng Zhang
2026-10-14 15:58           ` Roman Storozhenko
2026-10-14 23:33             ` Jisheng Zhang
2026-10-15  4:27               ` Jisheng Zhang [this message]
2026-10-15 17:08                 ` Roman Storozhenko
2026-10-15 17:35                   ` Roman Storozhenko

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=atBWGQ2iWpm2VKcY@xhacker \
    --to=jszhang@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=rkrcmar@ventanamicro.com \
    --cc=romeusmeister@gmail.com \
    --cc=rostedt@goodmis.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