From: Peter Zijlstra <peterz@infradead.org>
To: Changwoo Min <multics69@gmail.com>
Cc: tj@kernel.org, void@manifault.com, mingo@redhat.com,
changwoo@igalia.com, kernel-dev@igalia.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] sched_ext: Manage the validity of scx_rq_clock
Date: Sat, 16 Nov 2024 20:32:35 +0100 [thread overview]
Message-ID: <20241116193235.GQ22801@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20241116160126.29454-3-changwoo@igalia.com>
On Sun, Nov 17, 2024 at 01:01:23AM +0900, Changwoo Min wrote:
> An rq clock becomes valid when it is updated using update_rq_clock()
> and invalidated when the rq is unlocked using rq_unpin_lock(). Also,
> after long running operations -- ops.running() and ops.update_idle() --
> in a BPF scheduler, the sched_ext core invalidates the rq clock.
>
> Signed-off-by: Changwoo Min <changwoo@igalia.com>
> ---
> kernel/sched/core.c | 6 +++++-
> kernel/sched/ext.c | 3 +++
> kernel/sched/sched.h | 2 +-
> 3 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index a910a5b4c274..d0eb58b6a2da 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -784,6 +784,7 @@ static void update_rq_clock_task(struct rq *rq, s64 delta)
> void update_rq_clock(struct rq *rq)
> {
> s64 delta;
> + u64 clock;
>
> lockdep_assert_rq_held(rq);
>
> @@ -795,11 +796,14 @@ void update_rq_clock(struct rq *rq)
> SCHED_WARN_ON(rq->clock_update_flags & RQCF_UPDATED);
> rq->clock_update_flags |= RQCF_UPDATED;
> #endif
> + clock = sched_clock_cpu(cpu_of(rq));
> + scx_rq_clock_update(rq, clock);
It is not at all clear why you think you need to keep a second copy of
that value. You like cache misses?
next prev parent reply other threads:[~2024-11-16 19:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-16 16:01 [PATCH 0/5] sched_ext: Support high-performance monotonically non-decreasing clock Changwoo Min
2024-11-16 16:01 ` [PATCH 1/5] sched_ext: Implement scx_rq_clock_update/stale() Changwoo Min
2024-11-16 16:01 ` [PATCH 2/5] sched_ext: Manage the validity of scx_rq_clock Changwoo Min
2024-11-16 19:32 ` Peter Zijlstra [this message]
2024-11-17 15:46 ` Changwoo Min
2024-11-18 9:41 ` Peter Zijlstra
2024-11-19 1:19 ` Changwoo Min
2024-11-19 8:17 ` Peter Zijlstra
2024-11-19 15:57 ` Changwoo Min
2024-11-27 0:41 ` Changwoo Min
2024-11-16 16:01 ` [PATCH 3/5] sched_ext: Implement scx_bpf_clock_get_ns() Changwoo Min
2024-11-16 19:31 ` Peter Zijlstra
2024-11-17 15:48 ` Changwoo Min
2024-11-18 9:44 ` Peter Zijlstra
2024-11-16 16:01 ` [PATCH 4/5] sched_ext: Add scx_bpf_clock_get_ns() for BPF scheduler Changwoo Min
2024-11-16 16:01 ` [PATCH 5/5] sched_ext: Replace bpf_ktime_get_ns() to scx_bpf_clock_get_ns() Changwoo Min
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=20241116193235.GQ22801@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=changwoo@igalia.com \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=multics69@gmail.com \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/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®