Re: [External] Re: [PATCH] sched/core: Fix wrong warning check in rq_clock_start_loop_update()

From: Hao Jia
Date: Thu Oct 12 2023 - 05:05:51 EST




On 2023/10/10 Peter Zijlstra wrote:
On Sat, Oct 07, 2023 at 04:44:46PM +0800, Hao Jia wrote:

That is, would not something like the below make more sense?

If we understand correctly, this may not work.

After applying this patch, the following situation will trigger the
rq->clock_update_flags < RQCF_ACT_SKIP warning.

If rq_clock_skip_update() is called before __schedule(), so RQCF_REQ_SKIP of
rq->clock_update_flags is set.




__schedule() {
rq_lock(rq, &rf); [rq->clock_update_flags is RQCF_REQ_SKIP]
rq->clock_update_flags <<= 1;
update_rq_clock(rq); [rq->clock_update_flags is RQCF_ACT_SKIP]
+ rq->clock_update_flags &= ~(RQCF_ACT_SKIP|RQCF_REQ_SKIP);
* At this time, rq->clock_update_flags = 0; *

Fixed easily enough, just change to:

rq->clock_updated_flags = RQCF_UPDATED;



Thanks for your suggestions and help, I revised the commit message and sent patch v2.

https://lore.kernel.org/all/20231012090003.11450-1-jiahao.os@xxxxxxxxxxxxx/

Please review again.

Thanks,
Hao


pick_next_task_fair
set_next_entity
update_load_avg
assert_clock_updated() <---
}