[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241118094100.GG39245@noisy.programming.kicks-ass.net>
Date: Mon, 18 Nov 2024 10:41:00 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Changwoo Min <changwoo@...lia.com>
Cc: tj@...nel.org, void@...ifault.com, mingo@...hat.com,
kernel-dev@...lia.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] sched_ext: Manage the validity of scx_rq_clock
On Mon, Nov 18, 2024 at 12:46:32AM +0900, Changwoo Min wrote:
> The main reason to keep the second copy (rq->scx.clock) is that
> a BPF scheduler can call scx_bpf_clock_get_ns() at almost any
> time in any context, including any of sched_ext operations, BPF
> timer callbacks, BPF syscalls, kprobes, and so on.
If it's going to be a BPF wide thing, why is it presented as part of
sched_ext ? That makes no sense.
> Another approach would be to extend struct sched_clock_data (in
> kernel/sched/clock.c) to store the update flag
> (SCX_RQ_CLK_UPDATED). This would be the best regarding the number
> of cache line accesses. However, that would be an overkill since
> now sched_clock_data stores the sched_ext-specific data.
> I thought it would be better to keep sched_ext specific data in
> one place, struct scx_rq, for managibility.
What's the purpose of that flag? Why can't BPF use sched_clock_local()
and call it a day?
Do note that kernel/sched/clock.c is very much x86 specific (it was
briefly used by ia64 since their 'TSC' was of equal quality).
Growing sched_clock_data shouldn't be a problem, it's only 24 bytes, so
we have plenty free bytes there.
Powered by blists - more mailing lists