From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2674AC00140 for ; Mon, 15 Aug 2022 09:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241976AbiHOJ0L (ORCPT ); Mon, 15 Aug 2022 05:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230431AbiHOJ0G (ORCPT ); Mon, 15 Aug 2022 05:26:06 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F01613F8B; Mon, 15 Aug 2022 02:26:05 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id z6so9875998lfu.9; Mon, 15 Aug 2022 02:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=m64dCm5y6abMgyqwAQFCPVcLqHA6yb02EbRC6+noQbw=; b=nnmZdSGgeYdNQlt7klf2KWrMATSS13t2yHEkVMt+x0DICtLrR28QtzNdoDTRaEmPom z+Gs8Dqq57cX383CEv81ElNXe4hwEdFC/yx/espCw2xpTQameFuDpE7JbCuTbWB+Kbol yO27DHFvxupX+VcmZM86sl6boJZeqggbNf4o8YzZtEaZQeYGSShIxAUkWIBfNtoTsM9T Cr27BqXZo98/XfG56V1Yvc/jztezBrzouNmTZvHA/wtgonY4MU0pci1t+I+tRr3mf5HO sdAx6MpIxbc1GK37dE/4nGERixFc6AjZOLsoU/8XHkj2Yc63r6S/c5WZxknVrcBXx/3D 7pig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=m64dCm5y6abMgyqwAQFCPVcLqHA6yb02EbRC6+noQbw=; b=RT6YJPAJueei7w63vVPs9dVCRx4QBOfpXclsM4r//GL8EYpiBly6Xu4QKMs8NNVE6H o8F4fHgrQt/4fAn0axpS/aDhv0q0qHnc090DR/mqNB4SLdLb7EayCyCjc58BOIKe6TIM NGSirZkSUAXUmj5MGKMlr6oF1l357jLYtLHkaP9lowxWqqp/9zHu1kwb0TMLxC1Srf/X QrYT1oRsKWRFaPpFl/1cieJS0ff7j8Jj2Qv/ilCYnXQxT1E924OwTEulNX8bCtI/HSLX R7d3gJNpMw2i/pO/U9qorihpa5qt8qb2RUY7woVaDoDGemCtYHLh8ZwcB+EQr2xh1q8Q eDkw== X-Gm-Message-State: ACgBeo3Y/6eknJtqCYI3SgozN9+pUujbs9w/KxY8UWWnIk0U9QE8VLkg Kklc77WFYZcCtYfGwfxpN8YoLgZYwV5v7fiihYk= X-Google-Smtp-Source: AA6agR6CMLudliLU8DkPuETG1wkoC+cdz48zIm15B0wjSPjwtbMMftxqAWoUVL/mbhEco5kEFVzLgUqmqMD3Vr4rsnk= X-Received: by 2002:a05:6512:168d:b0:491:3206:b63 with SMTP id bu13-20020a056512168d00b0049132060b63mr3115806lfb.149.1660555563305; Mon, 15 Aug 2022 02:26:03 -0700 (PDT) MIME-Version: 1.0 References: <8245b710-8acb-d8e6-7045-99a5f71dad4e@oracle.com> <26d0e4cc-be0e-2c12-6174-dfbb1edb1ed6@oracle.com> <224b19f3-912d-b858-7af4-185b8e55bc66@quicinc.com> <20220815090556.GB27407@blackbody.suse.cz> In-Reply-To: <20220815090556.GB27407@blackbody.suse.cz> From: Xuewen Yan Date: Mon, 15 Aug 2022 17:25:52 +0800 Message-ID: Subject: Re: Query regarding deadlock involving cgroup_threadgroup_rwsem and cpu_hotplug_lock To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Mukesh Ojha , Tejun Heo , Imran Khan , lizefan.x@bytedance.com, hannes@cmpxchg.org, tglx@linutronix.de, steven.price@arm.com, peterz@infradead.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Zhao Gongyi , Zhang Qiao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal On Mon, Aug 15, 2022 at 5:06 PM Michal Koutn=C3=BD wrote= : > > +Cc: Zhao Gongyi , Zhang Qiao > > On Fri, Aug 12, 2022 at 03:57:00PM +0530, Mukesh Ojha wrote: > > The original patch of yours [1] and the revert of [2] is fixing the is= sue > > and it is also confirmed here [3]. > > Can we get proper fix merge on your tree? > > > > [1] https://lore.kernel.org/lkml/YuGbYCfAG81mZBnN@slm.duckdns.org/ > > > > [2] > > https://lore.kernel.org/all/20220121101210.84926-1-zhangqiao22@huawei.c= om/ > > The revert + Tejun's patch looks fine wrt the problem of the reverted > patch (just moves cpus_read_lock to upper callers). Your means is that the problem should be fixed by [1]+[2]'s revert ? I just tested the case which reverted the [2]. Need I test with [1] and [2]= ? Thanks! > > I'd just suggest a comment that'd explicitly document also the lock > order that we stick to, IIUC, it should be: > > cpu_hotplug_lock // cpus_read_lock > cgroup_threadgroup_rwsem > cpuset_rwsem > > Michal > > > > > [3] https://lore.kernel.org/lkml/CAB8ipk-72V-bYRfL-VcSRSyXTeQqkBVj+1d5M= HSVV5CTar9a0Q@mail.gmail.com/ > > > > -Mukesh From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xuewen Yan Subject: Re: Query regarding deadlock involving cgroup_threadgroup_rwsem and cpu_hotplug_lock Date: Mon, 15 Aug 2022 17:25:52 +0800 Message-ID: References: <8245b710-8acb-d8e6-7045-99a5f71dad4e@oracle.com> <26d0e4cc-be0e-2c12-6174-dfbb1edb1ed6@oracle.com> <224b19f3-912d-b858-7af4-185b8e55bc66@quicinc.com> <20220815090556.GB27407@blackbody.suse.cz> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=m64dCm5y6abMgyqwAQFCPVcLqHA6yb02EbRC6+noQbw=; b=nnmZdSGgeYdNQlt7klf2KWrMATSS13t2yHEkVMt+x0DICtLrR28QtzNdoDTRaEmPom z+Gs8Dqq57cX383CEv81ElNXe4hwEdFC/yx/espCw2xpTQameFuDpE7JbCuTbWB+Kbol yO27DHFvxupX+VcmZM86sl6boJZeqggbNf4o8YzZtEaZQeYGSShIxAUkWIBfNtoTsM9T Cr27BqXZo98/XfG56V1Yvc/jztezBrzouNmTZvHA/wtgonY4MU0pci1t+I+tRr3mf5HO sdAx6MpIxbc1GK37dE/4nGERixFc6AjZOLsoU/8XHkj2Yc63r6S/c5WZxknVrcBXx/3D 7pig== In-Reply-To: <20220815090556.GB27407-9OudH3eul5jcvrawFnH+a6VXKuFTiq87@public.gmane.org> List-ID: Content-Type: text/plain; charset="macroman" To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Mukesh Ojha , Tejun Heo , Imran Khan , lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org, hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org, steven.price-5wv7dgnIgG8@public.gmane.org, peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Zhao Gongyi , Zhang Qiao Hi Michal On Mon, Aug 15, 2022 at 5:06 PM Michal Koutn=C3=BD wrote= : > > +Cc: Zhao Gongyi , Zhang Qiao > > On Fri, Aug 12, 2022 at 03:57:00PM +0530, Mukesh Ojha wrote: > > The original patch of yours [1] and the revert of [2] is fixing the is= sue > > and it is also confirmed here [3]. > > Can we get proper fix merge on your tree? > > > > [1] https://lore.kernel.org/lkml/YuGbYCfAG81mZBnN-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org/ > > > > [2] > > https://lore.kernel.org/all/20220121101210.84926-1-zhangqiao22@huawei.c= om/ > > The revert + Tejun's patch looks fine wrt the problem of the reverted > patch (just moves cpus_read_lock to upper callers). Your means is that the problem should be fixed by [1]+[2]'s revert ? I just tested the case which reverted the [2]. Need I test with [1] and [2]= ? Thanks! > > I'd just suggest a comment that'd explicitly document also the lock > order that we stick to, IIUC, it should be: > > cpu_hotplug_lock // cpus_read_lock > cgroup_threadgroup_rwsem > cpuset_rwsem > > Michal > > > > > [3] https://lore.kernel.org/lkml/CAB8ipk-72V-bYRfL-VcSRSyXTeQqkBVj+1d5M= HSVV5CTar9a0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org/ > > > > -Mukesh