From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Matthew Wilcox <willy@infradead.org>
Cc: Hillf Danton <hdanton@sina.com>,
linux-kernel@vger.kernel.org,
"Eric W. Biederman" <ebiederm@xmission.com>,
Ingo Molnar <mingo@redhat.com>, Mel Gorman <mgorman@suse.de>,
Oleg Nesterov <oleg@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Vincent Guittot <vincent.guittot@linaro.org>,
linux-mm@kvack.org,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v4] signal: Let tasks cache one sigqueue struct.
Date: Wed, 24 May 2023 17:33:05 +0200 [thread overview]
Message-ID: <20230524153305.60aTQ2sC@linutronix.de> (raw)
In-Reply-To: <ZC+Tt2WqyFmNEm/w@casper.infradead.org>
On 2023-04-07 04:53:27 [+0100], Matthew Wilcox wrote:
> On Fri, Apr 07, 2023 at 08:03:06AM +0800, Hillf Danton wrote:
> > On Thu, 6 Apr 2023 22:47:21 +0200 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > > The sigqueue caching originated in the PREEMPT_RT tree. A few of the
> > > applications, that were ported to Linux, were ported from OS-9. Sending
> > > notifications from one task to another via a signal was a common
> > > communication model there and so the applications are heavy signal
> > > users. Removing the allocation reduces the critical path, avoids locks
> > > and so lowers the maximal latency of the task while sending a signal.
>
> It might lower the _average_ latency, but it certainly doesn't lower
> the _maximum_ latency, because you have to assume worst case scenario
> for maximum latency. Which is that there's no sigqueue cached, so you
> have to go into the slab allocator. And again, worst case scenario is
> that you have to go into the page allocator from there, and further that
> you have to run reclaim, and ...
Yes. The idea is in general not to send more signals in parallel than
the available number cached slots.
> What I find odd about the numbers that you quote:
>
> > The numbers of system boot followed by an allmod kernel build:
> > Out of 333216 allocations, 194876 (~58%) were served from the cache.
> > From all free invocations, 4212 were in a path were caching is not done
> > and 329002 sigqueue were cached.
>
> ... is that there's no absolute numbers. Does it save 1% of the cost
> of sending a signal? 10%? What does perf say about the cost saved
> by no longer going into slab? Because the fast path in slab is very
> fast. It might even be quicker than your fast path for multithreaded
> applications which have threads running on different NUMA nodes.
I asked for updated numbers and the improvement is not as big as
initially reported. There might have been a change in the configuration
for the testing an so the improvement is not as big as initially assumed.
I'm sorry, but I didn't get any numbers to back anything up. I'm
dropping the effort here, thanks for the review :)
Sebastian
prev parent reply other threads:[~2023-05-24 15:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230406194004.KP1K6FwO@linutronix.de>
[not found] ` <20230406204721.A6lSYL7A@linutronix.de>
2023-04-07 0:03 ` Hillf Danton
2023-04-07 3:53 ` Matthew Wilcox
2023-05-24 15:33 ` Sebastian Andrzej Siewior [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=20230524153305.60aTQ2sC@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=ebiederm@xmission.com \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.guittot@linaro.org \
--cc=willy@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