All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>,
	 Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	 Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	 Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	 linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH v4] perf bench: add --write-size option to sched pipe
Date: Thu, 4 Jun 2026 08:12:13 -0700	[thread overview]
Message-ID: <aiGVuVHCiA96IKqF@gmail.com> (raw)
In-Reply-To: <aiF7vEJNyxJcluC2@x1>

On Thu, Jun 04, 2026 at 10:21:00AM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Jun 03, 2026 at 04:34:36PM -0700, Namhyung Kim wrote:
> > On Wed, Jun 03, 2026 at 03:35:07AM -0700, Breno Leitao wrote:
> > > The default ping-pong uses sizeof(int) (4 bytes) per iteration, which
> > > exercises only the pipe-buffer merge path and keeps allocation entirely
> > > out of the picture. That makes the bench a useful scheduler / context-
> > > switch latency probe but unable to surface anything from the pipe
> > > page-allocation hot path.
> 
> > > Add a -s/--write-size option that sets the bytes written and read per
> > > ping-pong iteration. The buffer is allocated for each side via
> > > struct thread_data and replaces the on-stack int previously used. The
> > > default remains sizeof(int) so existing invocations are unchanged.
> 
> > > With --write-size set above PAGE_SIZE the bench drives anon_pipe_write()
> > > through alloc_page() (or the bulk pre-alloc, if the relevant patch is
> > > applied), which is what we want when measuring pipe locking and page
> > > allocation work.
> 
> > > The bench is a ping-pong: both sides call write() before read(), so a
> > > single write_size payload must fit entirely in the pipe buffer or both
> > > sides deadlock waiting for the other to drain. Resize the pipe via
> > > F_SETPIPE_SZ to match write_size (skipped at the sizeof(int) default),
> > > and error out cleanly when the request exceeds
> > > /proc/sys/fs/pipe-max-size.
> 
> > > Signed-off-by: Breno Leitao <leitao@debian.org>
> 
> > Acked-by: Namhyung Kim <namhyung@kernel.org>
> 
> Thanks, tested and applied:

Awesome. Thanks Arnaldo.

      reply	other threads:[~2026-06-04 15:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03 10:35 [PATCH v4] perf bench: add --write-size option to sched pipe Breno Leitao
2026-06-03 23:34 ` Namhyung Kim
2026-06-04 13:21   ` Arnaldo Carvalho de Melo
2026-06-04 15:12     ` Breno Leitao [this message]

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=aiGVuVHCiA96IKqF@gmail.com \
    --to=leitao@debian.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.