lkml.org 
[lkml]   [2024]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 2/5] sched_ext: Manage the validity of scx_rq_clock
From
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

\
 
 \ /
  Last update: 2024-12-02 15:57    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog