The Linux Kernel Mailing List
 help / color / mirror / Atom feed
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 v2 2/5] sched_ext: Manage the validity of scx_rq_clock
Date: Mon, 2 Dec 2024 10:58:47 +0100	[thread overview]
Message-ID: <20241202095847.GK24400@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20241202043849.1465664-3-changwoo@igalia.com>

On Mon, Dec 02, 2024 at 01:38:46PM +0900, Changwoo Min wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 95e40895a519..ab8015c8cab4 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -789,6 +789,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);
>  
> @@ -800,11 +801,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);

This adds a write to a second cacheline for *everyone* always.

Please don't do that.

  reply	other threads:[~2024-12-02  9:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02  4:38 [PATCH v2 0/5] sched_ext: Support high-performance monotonically non-decreasing clock Changwoo Min
2024-12-02  4:38 ` [PATCH v2 1/5] sched_ext: Implement scx_rq_clock_update/stale() Changwoo Min
2024-12-02  4:38 ` [PATCH v2 2/5] sched_ext: Manage the validity of scx_rq_clock Changwoo Min
2024-12-02  9:58   ` Peter Zijlstra [this message]
2024-12-02 14:50     ` Changwoo Min
2024-12-02  4:38 ` [PATCH v2 3/5] sched_ext: Implement scx_bpf_clock_get_ns() Changwoo Min
2024-12-02  4:38 ` [PATCH v2 4/5] sched_ext: Add scx_bpf_clock_get_ns() for BPF scheduler Changwoo Min
2024-12-02  4:38 ` [PATCH v2 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=20241202095847.GK24400@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