Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5209050imw; Wed, 20 Jul 2022 00:48:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sSUApk1ZIlfdoxDg0GEJG3BKghM7aLEJ8tRCTc+ZLCk6R0f7g1lTNAr7YWlBt6aRmsS3+K X-Received: by 2002:a17:903:52:b0:16d:22e6:ed2b with SMTP id l18-20020a170903005200b0016d22e6ed2bmr1117669pla.109.1658303315825; Wed, 20 Jul 2022 00:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658303315; cv=none; d=google.com; s=arc-20160816; b=SFEEJxl5dXmqGx1vZOzaJN2hVSTe/kkWHWE6N0vaU5Bta8mZYqzgpaf/NwAX5nC4dE tPGrd0myCAKC5jG/dtSAg4ec+X7olS9cm4PtDSqSlbprK8n08ZGr8Jmxsdi2jmhSwx8z dgE7ym2jGeQbmxV0Uaya6NrTfBATq17nHK55JGTmYuLdwB+m9Q50rPSy/lueYYi91X16 n1jbUKfxHq9k2/AZyCFCP/FFvPn9u7LP0yolmeqrGA+vICiXZ85o9y1z36Cn2iDWTLWg k9GbRUbY9WMSN+5mxeMBTMrrJ86iJQWqjmMx9KQRNUJPO4GDreDYJSCOkvxJ8YOHtIZp mHVQ== 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=tVPIkcHFbrIBqwWvbgKoMairnWOWXDJLFc+/HEF3fRk=; b=f8N+H/7I40m8LPo/6aTgN++jAWowMk7fQcY2zCylxUV6smV0Z8RQgNx6/agJci9f+T +11arDI1hMr3tIzQUAKCv77tuiNmhzvuIQv6zEOlqbveqlVWSaT7+wkw+Hyo2oJ636V1 RBrBrOh60wSQ77xNNMfM7IqgxB5dVJFRU2O/2UcjKaYjvPR/b7GpA8Olqzp36/TcCZaM uyS3JP5IpYfZfLx1Pcnn2uwENtQh4eX19P26S4dhYI9CE/KdgLBdvL//cPha9pG9ejeo A58wvHNu1VbQlttc1Opu0lybVlhwOYJHVoK7REeAan9g30StD5mlMPgV+wZk7T3oeic8 6l9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TvwRSCVD; 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 t27-20020a63445b000000b003fd2121ace3si20763881pgk.237.2022.07.20.00.48.21; Wed, 20 Jul 2022 00:48:35 -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=TvwRSCVD; 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 S232062AbiGTHpp (ORCPT + 99 others); Wed, 20 Jul 2022 03:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231868AbiGTHpl (ORCPT ); Wed, 20 Jul 2022 03:45:41 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFA4021E3C; Wed, 20 Jul 2022 00:45:39 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id o7so28874173lfq.9; Wed, 20 Jul 2022 00:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tVPIkcHFbrIBqwWvbgKoMairnWOWXDJLFc+/HEF3fRk=; b=TvwRSCVDrRciTpOnKLMfyHifAJeyTe5WXyx5ysgT2EPtGU05SCryU9kIUgyHW4kqR9 EBaLbVU/27CKoVZLHD4EI4UbEJKJuU02+DzFI3TSmKuXYkVRl+soRhLc4NQMyQ4eZa9D Zr2M1A6XuTHZSPLLhQYBdSC9rIgXAcxpYM9YVlXXoMj2HNJs0lqrUyFzfcNe2jKsnOE/ RJKNLUgBLZ1Iaza/7BOUpvblYMIj1thXugwy+f81/8tsODb2glK69wBixB3SnotUfGzL Vah626GD6k40pZjo6zpYRoH9/S2sKqMPE7FyvN/hDDPav2Qwc+VwpXP/aBxhmlHCAjJg /Z8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tVPIkcHFbrIBqwWvbgKoMairnWOWXDJLFc+/HEF3fRk=; b=WuCmJjwzZdD9gqtQl5EQF45cVp1zIWdcpQKLlyoK5w11OD0cwqrOImD12PGet4rfyU Um3M/Bs0wiTi36/UqPeeSDGgNwsQgVE8wtyij7s/PYA72t0HfP4WJoycWQDqwEz8Aeg2 C4BeDHLf/T0m3jvnLnJXc72kHsMejtkDQOiDh0LOda2on5ykBHsIcCxMTcCTN3ICJTl2 PDCzRCQV1yruEcEwrj4H7Yq4QVUCvonImNzXbchii0cWtbhI8/qo5j1XvLy7LjwVugYB JvYYik41R6QsfM7gRQ2p7hmKC2024mralpsXuutnoVOjr1naTcvWLmFdcZsu7e6N8wVV m+Kw== X-Gm-Message-State: AJIora+GdF2li8uXb/QH5mpWyarSNOH1JhqPNwmCqHl6ClbM/bEVF2tG RxkIR0P3sjPhluW6FG+hhuY/XU8EMz2XsGVf/iY= X-Received: by 2002:a05:6512:23a0:b0:489:d19c:602d with SMTP id c32-20020a05651223a000b00489d19c602dmr19783960lfv.89.1658303138187; Wed, 20 Jul 2022 00:45:38 -0700 (PDT) MIME-Version: 1.0 References: <20220705123705.764-1-xuewen.yan@unisoc.com> <20220711174629.uehfmqegcwn2lqzu@wubuntu> In-Reply-To: From: Xuewen Yan Date: Wed, 20 Jul 2022 15:45:27 +0800 Message-ID: Subject: Re: [PATCH] sched/schedutil: Fix deadlock between cpuset and cpu hotplug when using schedutil To: Tejun Heo Cc: Waiman Long , Qais Yousef , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 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 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 Dear all On Wed, Jul 13, 2022 at 11:20 AM Tejun Heo wrote: > > On Tue, Jul 12, 2022 at 10:49:57PM -0400, Waiman Long wrote: > > > Well, the only thing I can think of is always grabbing cpus_read_lock() > > > before grabbing threadgroup_rwsem. Waiman, what do you think? > > > > That is a possible solution as cpus_read_lock() is rather lightweight. It is > > a good practice to acquire it first. > > On a similar note, I think we probably should re-enable percpu operations on > threadgroup_rwsem too by default and allow users who are affected by slower > write path operations to opt-in. After the new CLONE_INTO_CGROUP which > doesn't need the rwsem, we have far fewer write lockers after all. > If there's any patch for me to try? I would be very grateful. Thanks! --- xw.yan