Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932395AbdIFOYK (ORCPT ); Wed, 6 Sep 2017 10:24:10 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59102 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754482AbdIFOYF (ORCPT ); Wed, 6 Sep 2017 10:24:05 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F36E06047C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=prsood@codeaurora.org Subject: Re: [PATCH] cgroup/cpuset: remove circular dependency deadlock To: Waiman Long , tj@kernel.org, lizefan@huawei.com, cgroups@vger.kernel.org, mingo@kernel.org References: <1504698535-8187-1-git-send-email-prsood@codeaurora.org> <3992b0d5-947c-e343-5c07-8da43af5646d@redhat.com> Cc: linux-kernel@vger.kernel.org, sramana@codeaurora.org From: Prateek Sood Message-ID: <0667dcec-ba42-5f44-596f-c2af891a770e@codeaurora.org> Date: Wed, 6 Sep 2017 19:53:59 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <3992b0d5-947c-e343-5c07-8da43af5646d@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1448 Lines: 45 On 09/06/2017 06:26 PM, Waiman Long wrote: > On 09/06/2017 07:48 AM, Prateek Sood wrote: >> Remove circular dependency deadlock in a scenario where hotplug of CPU is >> being done while there is updation in cgroup and cpuset triggered from >> userspace. >> >> Example scenario: >> kworker/0:0 => kthreadd => init:729 => init:1 => kworker/0:0 >> >> kworker/0:0 - lock(cpuhotplug.mutex) [held] >> flush(work) [no high prio workqueue available on CPU] >> wait_for_completion() >> >> kthreadd - percpu_down_read(cgroup_threadgroup_rwsem) [waiting] >> >> init:729 - percpu_down_write(cgroup_threadgroup_rwsem) [held] >> lock(cpuset_mutex) [waiting] >> >> init:1 - lock(cpuset_mutex) [held] >> lock(cpuhotplug.mutex) [waiting] >> >> Eliminate this dependecy by reordering locking of cpuset_mutex >> and cpuhotplug.mutex in following order >> 1. Acquire cpuhotplug.mutex >> 2. Acquire cpuset_mutex >> >> Signed-off-by: Prateek Sood > > Is this patch for the latest upstream kernel or 4.4? There is no > cpuhotplug.mutex anymore in upstream kernel. It is a per-cpu rwsem > cpu_hotplug_lock. > > Cheers, > Longman > Thanks for inputs, I will check latest kernel for details Regards Prateek -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project