Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5425459rwb; Mon, 8 Aug 2022 19:34:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR5LsRBcaFKOxofA1/+ScYvig13mzyixHR0YqzgMpWfFjhy0jg7gVu/1RG84KKZzHKNtc3f/ X-Received: by 2002:a17:906:dc90:b0:72f:cf96:50a1 with SMTP id cs16-20020a170906dc9000b0072fcf9650a1mr15894209ejc.546.1660012461558; Mon, 08 Aug 2022 19:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660012461; cv=none; d=google.com; s=arc-20160816; b=jIBLj0YZXBGr2p0EaxfhpA+RoP0UswSbi+HVCan+wnXc4raNfAIc4AYGnzs1UA0HOw p3RIYWIEoghNUwxFg65sBs2svPvwdS40IYkJh9sEOzPQZKjUjBvGU548KOVQ8Ot4uQ47 YvoGJkNSnxY9dlJxVE5T74SPqfjVtxQwbOsFsqoUYkelu0LDEfkIqejmfENbcv+2xO16 QZg7mBQSSqNtGzBnGYko3QJUgqHQve8GYqvN2kkIC5K7jZ3FVZzWKQl52GP2ArdnKkci GL762UwwTZU1a4PF9F+Kp8rvXcxmb9UowO/eZuibI30qt49AMvfGARC9n1/UvmBr7fAv jOhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+8W2Pk4vFE/5ScoPdt7aCafH2GFjYqFQgAnxxqtg8nw=; b=brq+UnDxakGiEFP1Gd/8qY+NKEgjxob1y3vPMWaKEiutWItpJBpulPFDhftis9890R B/w3u8ZJPC6beTc/tmhXhvfwEw/Wh1+j4d2vULSz0EJjfApswpGftdW4rB+dtDxvn6K9 0FvvrPZog/A9hiRy46WjnTK0vdf5njllJg9ZKfoj1MnhklTxSPNa1sv8QQvU+zxXteD4 f+fc6Fq2yoA+v7LujjdF2UBy9ZdvYb3FAsz+Ji58I3mngOCfkWbfZfi4x+bEiao3hpNs o9ANVjY10FkLLN9PCA/5RIuikz+mi2YgQxeUnvUWo8QFXCc8BgGviuOZEP9XC5wyaWBL tOwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=V+H30Agv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg18-20020a170907971200b00730b62beb0bsi1069303ejc.185.2022.08.08.19.33.53; Mon, 08 Aug 2022 19:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=V+H30Agv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231459AbiHICDB (ORCPT + 99 others); Mon, 8 Aug 2022 22:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbiHICC6 (ORCPT ); Mon, 8 Aug 2022 22:02:58 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73884183B3; Mon, 8 Aug 2022 19:02:57 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id l21so154901ljj.2; Mon, 08 Aug 2022 19:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=+8W2Pk4vFE/5ScoPdt7aCafH2GFjYqFQgAnxxqtg8nw=; b=V+H30AgvA9w6ZWfKURgwUBwd3mxfGB1HsOf7idEhywJMyyh3aV0tnyni06iUAzLPCs BnScYAvMxuuj+s0sP3f0iDwjh2lLFJPWfe9HN8lVY1BHFywuBcaUr97Ja2iHvFx5fwAx OWzLsVRRbu3SOT7zmz1rL81aFE9dp9y2sdNVYHC20w6FIggNtAU7d66h+mlMs3JmvKO8 d/+NX0Bu+A4eaex1LqPvFRQ4NBgmni0HZWqMUeeDvsBd7sjLv5Rnw38KF7ArKl3/8bIb 4t/Fk98LLTEIehXxSOuWaJmZadkN7reRaAW563HuxbYD60AHjwPJCIn9Z9DGtjvvz+88 FU9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=+8W2Pk4vFE/5ScoPdt7aCafH2GFjYqFQgAnxxqtg8nw=; b=sN5J/pBzyrMFW8nqhuR/op3SvtOWkbWT3+777HssoVVHvxmQrpvz1YSyE6VgQrujzK a+KcAMj5H88yFn4CK6AmQ/q1wl+FaW5z3am2dCNtUN7rbJKOg57UkCMLrH0IArFoX50x 0rE8n14NKAq6E9wwmEmGI1vYm51EDmhcUwqENV646LFobCk5postTh/6/DrGN/vmGDa7 4qLxeiWxAJbHm3Bw1gkX0+ElIqW9yaPeRCNfzaslSgnFkyuM75J8VsgpdeK5QvcWw0RW RZtV/omHEGpXX8MeHRzU9ur4lNhVFEtilcYAc1xr4qaJXPAloEICpUQOD/4IkECQE5rH kN2Q== X-Gm-Message-State: ACgBeo1DjT4V7efsUQsXpUJcWxzI478sb/ubVOKz6fevTBWH3f2+OsyO pX8RTSkhARdNPtHnAYVpP19OqR1aF026DzOC+fs= X-Received: by 2002:a2e:a587:0:b0:25f:e6ac:c287 with SMTP id m7-20020a2ea587000000b0025fe6acc287mr1723207ljp.416.1660010575748; Mon, 08 Aug 2022 19:02:55 -0700 (PDT) MIME-Version: 1.0 References: <20220705123705.764-1-xuewen.yan@unisoc.com> <20220711174629.uehfmqegcwn2lqzu@wubuntu> <20220729083949.6uaojl3vqyvwpkuk@wubuntu> In-Reply-To: From: Xuewen Yan Date: Tue, 9 Aug 2022 10:02:44 +0800 Message-ID: Subject: Re: [PATCH] sched/schedutil: Fix deadlock between cpuset and cpu hotplug when using schedutil To: Tejun Heo Cc: Qais Yousef , Waiman Long , Xuewen Yan , rafael@kernel.org, viresh.kumar@linaro.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, ke.wang@unisoc.com, xuewyan@foxmail.com, linux-pm@vger.kernel.org, Lukasz Luba , pengcheng.lai@unisoc.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tejun On Sat, Jul 30, 2022 at 3:59 AM Tejun Heo wrote: > > On Fri, Jul 29, 2022 at 09:39:49AM +0100, Qais Yousef wrote: > > I *think* it's because we haven't removed cpus_read_lock() from > > cpuset_attach(). So we end up holding the lock twice in the same path. Since we > > hold it unconditionally now, we should remove cpuset dependency on > > cpus_read_lock() I believe. > > Ah, yeah, that's because pending write locker makes future reader lockers > wait, so even if we're holding read lock, if we try to read lock again, we > end up waiting. I'll make the cpus_read_lock() unconditional in cgroup core > and drop it from cpuset's attach operation. I revert the following patch which add the cpus_read_lock() in cpuset's attach and have test for a while. And the deadlock has not reproduced. https://lore.kernel.org/all/20220121101210.84926-1-zhangqiao22@huawei.com/ But I do not know the risk with reverting the patch.. Thanks! BR -- xuewen > > Thanks. > > -- > tejun