lkml.org 
[lkml]   [2022]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched/schedutil: Fix deadlock between cpuset and cpu hotplug when using schedutil
On Tue, Jul 12, 2022 at 01:57:02PM +0100, Qais Yousef wrote:
> Is there a lot of subsystems beside cpuset that needs the cpus_read_lock()?
> A quick grep tells me it's the only one.
>
> Can't we instead use cpus_read_trylock() in cpuset_can_attach() so that we
> either hold the lock successfully then before we go ahead and call
> cpuset_attach(), or bail out and cancel the whole attach operation which should
> unlock the threadgroup_rwsem() lock?

But now we're failing user-initiated operations randomly. I have a hard time
seeing that as an acceptable solution. The only thing we can do, I think, is
establishing a locking order between the two locks by either nesting
threadgroup_rwsem under cpus_read_lock or disallowing thread creation during
hotplug operations.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2022-07-12 18:16    [W:1.408 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site