mirror of
https://github.com/sched-ext/scx.git
synced 2024-11-25 04:00:24 +00:00
scx_flatcg: Make good use of __sync_fetch_and_sub()
Fetch the value of "delta" directly from the returned value from __sync_fetch_and_sub, as it returns the origin value of cgc->cvtime_delta. Additional fetching instruction of cgc->cvtime_delta would be redundant here. Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
This commit is contained in:
parent
a72c9058a3
commit
aae826b1b3
@ -258,8 +258,7 @@ static void cgrp_cap_budget(struct cgv_node *cgv_node, struct fcg_cgrp_ctx *cgc)
|
||||
* and thus can't be updated and repositioned. Instead, we collect the
|
||||
* vtime deltas separately and apply it asynchronously here.
|
||||
*/
|
||||
delta = cgc->cvtime_delta;
|
||||
__sync_fetch_and_sub(&cgc->cvtime_delta, delta);
|
||||
delta = __sync_fetch_and_sub(&cgc->cvtime_delta, cgc->cvtime_delta);
|
||||
cvtime = cgv_node->cvtime + delta;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user