From: Breno Leitao <leitao@debian.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
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 v3] perf bench: add --write-size option to sched pipe
Date: Wed, 3 Jun 2026 03:25:44 -0700 [thread overview]
Message-ID: <ah__hAGKk2B3nYCC@gmail.com> (raw)
In-Reply-To: <ah-5-g2kRJG7qMPJ@z2>
On Tue, Jun 02, 2026 at 10:22:02PM -0700, Namhyung Kim wrote:
> On Mon, Jun 01, 2026 at 04:10:29AM -0700, Breno Leitao wrote:
> > Hello Namhyung,
> >
> > On Wed, May 27, 2026 at 10:31:10AM -0700, Namhyung Kim wrote:
> > > On Wed, May 27, 2026 at 06:42:59AM -0700, Breno Leitao wrote:
> > > > +static inline int write_pipe(struct thread_data *td)
> > > > +{
> > > > + unsigned int done = 0;
> > > > + int ret;
> > > > +
> > > > + while (done < write_size) {
> > > > + ret = write(td->pipe_write, td->buf + done, write_size - done);
> > > > + if (ret < 0) {
> > > > + if (nonblocking && errno == EWOULDBLOCK)
> > > > + continue;
> > >
> > > Don't we also need the blocking part?
> >
> > Just to make sure I'm reading this right: do you mean the writer
> > should epoll_wait() on EPOLLOUT before retrying (symmetric to what
> > read_pipe() does for EPOLLIN), so we sleep until the pipe drains
> > instead of spinning on EWOULDBLOCK? Or are you pointing at something
> > else — e.g. behavior in the blocking (!nonblocking) path?
>
> I simply meant if it needs to check EINTR if !nonblocking.
Ack, thanks for clarifying - I get what you meant now. A blocking
read()/write() can return -1/EINTR if a signal is delivered while it's
parked in the syscall (e.g. the user hits Ctrl-C), so I'll just
continue on errno == EINTR in both helpers.
I'll respin with that, and also address the "medium" issue Sashiko
flagged on the same write path: instead of busy-spinning on
EWOULDBLOCK in non-blocking mode, the writer now poll()s on POLLOUT and
only retries once the peer has drained the pipe.
Thanks,
--breno
prev parent reply other threads:[~2026-06-03 10:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 13:42 [PATCH v3] perf bench: add --write-size option to sched pipe Breno Leitao
2026-05-27 14:07 ` sashiko-bot
2026-05-27 17:31 ` Namhyung Kim
2026-06-01 11:10 ` Breno Leitao
2026-06-03 5:22 ` Namhyung Kim
2026-06-03 10:25 ` 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=ah__hAGKk2B3nYCC@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox