The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Changwoo Min <changwoo@igalia.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: tj@kernel.org, void@manifault.com, mingo@redhat.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 23:50:40 +0900	[thread overview]
Message-ID: <55d10cfc-fed7-489f-94e8-50a7568f5341@igalia.com> (raw)
In-Reply-To: <20241202095847.GK24400@noisy.programming.kicks-ass.net>

Hello Peter,

On 24. 12. 2. 18:58, Peter Zijlstra wrote:
> 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.
> 

Thank you for the suggestion! I will update the flags only when
the scx is enabled by checking it inside the
scx_rq_clock_update() and scx_rq_clock_stale() functions.

Regards,
Changwoo Min

  reply	other threads:[~2024-12-02 14:51 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
2024-12-02 14:50     ` Changwoo Min [this message]
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=55d10cfc-fed7-489f-94e8-50a7568f5341@igalia.com \
    --to=changwoo@igalia.com \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --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