lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 12 Jul 2022 23:02:48 -0400
From:   Waiman Long <longman@...hat.com>
To:     Steven Rostedt <rostedt@...dmis.org>, Tejun Heo <tj@...nel.org>
Cc:     Qais Yousef <qais.yousef@....com>,
        Xuewen Yan <xuewen.yan@...soc.com>, rafael@...nel.org,
        viresh.kumar@...aro.org, mingo@...hat.com, peterz@...radead.org,
        juri.lelli@...hat.com, vincent.guittot@...aro.org,
        dietmar.eggemann@....com, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, linux-kernel@...r.kernel.org,
        ke.wang@...soc.com, xuewyan@...mail.com, linux-pm@...r.kernel.org
Subject: Re: [PATCH] sched/schedutil: Fix deadlock between cpuset and cpu
 hotplug when using schedutil

On 7/11/22 17:11, Steven Rostedt wrote:
> On Mon, 11 Jul 2022 10:58:28 -1000
> Tejun Heo <tj@...nel.org> wrote:
>
>> I don't think lockdep would be able to track CPU1 -> CPU2 dependency here
>> unfortunately.
>>
>>> AFAIU:
>>>
>>>
>>> CPU0                                     CPU1                                   CPU2
>>>
>>> // attach task to a different
>>> // cpuset cgroup via sysfs
>>> __acquire(cgroup_threadgroup_rwsem)
>>>
>>>                                           // pring up CPU2 online
>>>                                           __acquire(cpu_hotplug_lock)
>>>                                           // wait for CPU2 to come online
> Should there be some annotation here that tells lockdep that CPU1 is now
> blocked on CPU2?
>
> Then this case would be caught by lockdep.
>
> -- Steve
>
>
>>>                                                                                  // bringup cpu online
>>>                                                                                  // call cpufreq_online() which tries to create sugov kthread
>>> __acquire(cpu_hotplug_lock)                                                     copy_process()
>>>                                                                                     cgroup_can_fork()
>>>                                                                                        cgroup_css_set_fork()
>>>                                                                                        __acquire(cgroup_threadgroup_rwsem)
>>> // blocks forever                        // blocks forever                            // blocks forever

Actually, the dependency can probably be coded by calling 
lockdep_acquire_cpus_lock() in cpu2 (task 2) before acquiring 
cgroup_threadgroup_rwsem to indicate the dependency between CPU1 and 
CPU2 (task 1 and task 2). lockdep_release_cpus_lock() can then called 
after release the rwsem.

Cheers,
Longman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ