Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752358AbdLKPdF (ORCPT ); Mon, 11 Dec 2017 10:33:05 -0500 Received: from mail-qt0-f180.google.com ([209.85.216.180]:38453 "EHLO mail-qt0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbdLKPdB (ORCPT ); Mon, 11 Dec 2017 10:33:01 -0500 X-Google-Smtp-Source: ACJfBouHqOyY249s1PurY0KdTOxR+L1Mkvko0k6zVgw+r7KJJkUw6MACGoo3If1c9wc9AMu7C0d8WA== Date: Mon, 11 Dec 2017 07:32:58 -0800 From: Tejun Heo To: Prateek Sood Cc: Peter Zijlstra , avagin@gmail.com, mingo@kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, sramana@codeaurora.org Subject: Re: [PATCH] cgroup/cpuset: fix circular locking dependency Message-ID: <20171211153258.GI2421075@devbig577.frc2.facebook.com> References: <1511868946-23959-1-git-send-email-prsood@codeaurora.org> <623f214b-8b9a-f967-7a3d-ca9c06151267@codeaurora.org> <20171204202219.GF2421075@devbig577.frc2.facebook.com> <20171204225825.GP2421075@devbig577.frc2.facebook.com> <20171204230117.GF20227@worktop.programming.kicks-ass.net> <4e63b5e9-1696-910f-16ac-4d4d7eb98725@codeaurora.org> <40968aea-cd73-5ce4-d559-962d91e315c5@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40968aea-cd73-5ce4-d559-962d91e315c5@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1041 Lines: 30 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