[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171211153258.GI2421075@devbig577.frc2.facebook.com>
Date: Mon, 11 Dec 2017 07:32:58 -0800
From: Tejun Heo <tj@...nel.org>
To: Prateek Sood <prsood@...eaurora.org>
Cc: Peter Zijlstra <peterz@...radead.org>, avagin@...il.com,
mingo@...nel.org, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org, sramana@...eaurora.org
Subject: Re: [PATCH] cgroup/cpuset: fix circular locking dependency
Hello, Prateek.
On Fri, Dec 08, 2017 at 05:15:55PM +0530, Prateek Sood wrote:
> There is one deadlock issue during cgroup migration from cpu
> hotplug path when a task T is being moved from source to
> destination cgroup.
>
> kworker/0:0
> cpuset_hotplug_workfn()
> cpuset_hotplug_update_tasks()
> hotplug_update_tasks_legacy()
> remove_tasks_in_empty_cpuset()
> cgroup_transfer_tasks() // stuck in iterator loop
> cgroup_migrate()
> cgroup_migrate_add_task()
>
> In cgroup_migrate_add_task() it checks for PF_EXITING flag of task T.
> Task T will not migrate to destination cgroup. css_task_iter_start()
> will keep pointing to task T in loop waiting for task T cg_list node
> to be removed.
Heh, that's a bug in cgroup_transfer_tasks() which happened because I
forgot to update when we changed how we handle exiting tasks. The
right thing to do here is making cgroup_transfer_tasks() repeat iff
there were a valid migration target which didn't get transferred.
Thanks.
--
tejun
Powered by blists - more mailing lists