mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Changwoo Min <changwoo@igalia.com>
Cc: tj@kernel.org, void@manifault.com, mingo@redhat.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: Mon, 18 Nov 2024 10:41:00 +0100	[thread overview]
Message-ID: <20241118094100.GG39245@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <494b8851-ba5b-4205-bea0-dc504c2ffa33@igalia.com>

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.

  reply	other threads:[~2024-11-18  9:41 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
2024-11-17 15:46     ` Changwoo Min
2024-11-18  9:41       ` Peter Zijlstra [this message]
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=20241118094100.GG39245@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=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®