[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250217112317.258716-1-gmonaco@redhat.com>
Date: Mon, 17 Feb 2025 12:23:15 +0100
From: Gabriele Monaco <gmonaco@...hat.com>
To: linux-kernel@...r.kernel.org,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>
Cc: Gabriele Monaco <gmonaco@...hat.com>,
Shuah Khan <shuah@...nel.org>
Subject: [PATCH 0/2] sched: Run task_mm_cid_work in batches to lower latency
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@...icios.com>
To: Peter Zijlstra <peterz@...radead.org>
To: Ingo Molnar <mingo@...nel.org>
To: Paul E. McKenney <paulmck@...nel.org>
Cc: Shuah Khan <shuah@...nel.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
Powered by blists - more mailing lists