Re: [PATCH 3/6] sched_ext: Make @rf optional for dispatch_to_local_dsq()
From: Tejun Heo
Date: Wed Jul 10 2024 - 12:55:21 EST
Hello,
On Wed, Jul 10, 2024 at 01:41:42PM +0200, Peter Zijlstra wrote:
...
> > Not a blocker, but would it make sense to provide some wrappers for
> > rq_unpin_lock() / rq_repin_lock() to simply return if rf == NULL?
Will address this part later.
> There are very limited contexts where unpin is sound. I have no idea if
> this is one of them or not.
This is called from balance to migrate tasks across rq's, which is where the
@rf for the unpin/repin is coming from. This patchset makes the same code
path called from other places, e.g. ->task_woken(), where the rq lock is
already unpinned. It could be that the better thing to do here is just
unpinning from the balance()'s context so that the inner functions don't
have to worry about lock pinning. They're always called in a context where
the rq lock can be dropped after all.
Thanks.
--
tejun