Re: [PATCH v2] sched: async unthrottling for cfs bandwidth

From: Michal Koutný
Date: Wed Nov 16 2022 - 04:57:47 EST


On Tue, Nov 15, 2022 at 07:01:31PM -0800, Josh Don <joshdon@xxxxxxxxxx> wrote:
> After more thought, I realized that we can't reuse the throttled_list
> list_head, since that would potentially break the lockless traversal
> of a concurrent list_for_each_entry_rcu() (ie. if we removed the
> element from the throttled list and then added it to the CSD list).

I see, the concurrent RCU traversal is a valid point for the two heads.

What does it mean for SCHED_WARN_ON in __unthrottle_cfs_rq_async()?

IIUC, if the concurrency of cfs_b->throttled_cfs_rq list is
expected (hence I'm not sure about the SCHED_WARN_ON), then it may
happen that __unthrottle_cfs_rq_async is called on cfs_rq that's already
on rq->cfsb_csd_list (there's still rq lock but it's only help inside
cfs_b->throttled_cfs_rq iteration).

Thanks,
Michal

Attachment: signature.asc
Description: Digital signature