From: Gabriele Monaco <gmonaco@redhat.com>
To: linux-kernel@vger.kernel.org,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
"Paul E. McKenney" <paulmck@kernel.org>
Cc: Gabriele Monaco <gmonaco@redhat.com>, Shuah Khan <shuah@kernel.org>
Subject: [PATCH 0/2] sched: Run task_mm_cid_work in batches to lower latency
Date: Mon, 17 Feb 2025 12:23:15 +0100 [thread overview]
Message-ID: <20250217112317.258716-1-gmonaco@redhat.com> (raw)
This patchset is a continuation of [1] but using a simpler approach.
The task_mm_cid_work runs as a task_work returning to userspace and
causes a non-negligible scheduling latency, mostly due to its iterations
over all cores.
Split the work into several batches, each call to task_mm_cid_work will
not run for all cpus but just for a configurable number of cpus. Next
runs will pick up where the previous left off.
The mechanism that avoids running too frequently (100ms) is enforced
only when we finish all cpus, that is when we start from 0.
Patch 1 implements the logic behind the change
Patch 2 implements a test to validate mm_cids are compacted, since this
patchset doesn't address the fact processes running in bursts are less
likely to run the task_work, we add a busy loop in the test to make sure
the mm_cid runs during the test duration (not necessary in [1]). The
test would of course fail if the mm_cid compaction mechanism is broken.
This patchset is based on 1/3 of [1] ("sched: Compact RSEQ concurrency
IDs with reduced threads and affinity"), which will be merged separately,
lacking that commit might have the test in patch 2 fail.
[1] - https://lore.kernel.org/lkml/20250210153253.460471-1-gmonaco@redhat.com/
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
To: Paul E. McKenney <paulmck@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Gabriele Monaco (2):
sched: Compact RSEQ concurrency IDs in batches
rseq/selftests: Add test for mm_cid compaction
include/linux/mm_types.h | 8 +
init/Kconfig | 12 +
kernel/sched/core.c | 27 ++-
tools/testing/selftests/rseq/.gitignore | 1 +
tools/testing/selftests/rseq/Makefile | 2 +-
.../selftests/rseq/mm_cid_compaction_test.c | 208 ++++++++++++++++++
6 files changed, 254 insertions(+), 4 deletions(-)
create mode 100644 tools/testing/selftests/rseq/mm_cid_compaction_test.c
--
2.48.1
next reply other threads:[~2025-02-17 11:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 11:23 Gabriele Monaco [this message]
2025-02-17 11:23 ` [PATCH 1/2] sched: Compact RSEQ concurrency IDs in batches Gabriele Monaco
2025-02-17 19:46 ` Mathieu Desnoyers
2025-02-18 9:52 ` Gabriele Monaco
2025-02-17 11:23 ` [PATCH 2/2] rseq/selftests: Add test for mm_cid compaction Gabriele Monaco
2025-02-17 19:59 ` Mathieu Desnoyers
2025-02-18 8:13 ` Gabriele Monaco
2025-02-18 13:49 ` Gabriele Monaco
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=20250217112317.258716-1-gmonaco@redhat.com \
--to=gmonaco@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=shuah@kernel.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
all inboxes | Powered by JetHome®