Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2420228rwd; Wed, 14 Jun 2023 02:31:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5BwdHbgXxQ5hheW6t5yDrTZagWoHMtIP1fERYHKJykrUZ6RktInn9Vo/mwUWuhLms61awz X-Received: by 2002:a19:e34f:0:b0:4f6:1c08:e9bb with SMTP id c15-20020a19e34f000000b004f61c08e9bbmr6664225lfk.63.1686735100872; Wed, 14 Jun 2023 02:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686735100; cv=none; d=google.com; s=arc-20160816; b=eH8jdGb+b73091f4+FgjLUx8Dv6spPAOhLJ//EAKFh6iTok3SimwBrKvobGfz0TCnH v6a4wSmi5veYKv2tqq25CJ7EbY7ldqS+IXdIUvRKMcm19iM190aO6tVaADC3IJPFaGun tm5hqyckYvCiUb88NJHo/I81g1PH9pxw6XwHP2gM229A65qM5ica4pD+qFmADxjheb6A l/7VVM4pj+InH5ipBxLDa6LbMN5OjsTIFqeZ9yFE4WQ1xKviaP+L6mJ7853USe0RyEwF H8UHu6BelLysUlUjrBCMdrwuvQ3JFVl00BdNeFvJz4tI1m1t11I7XHjApkXkCsJW4CHt cFMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date; bh=kXtcb5EuPU2Z9+wW49nfENhCFH2n9rdElaSM8xwexLA=; b=ckenOJTEuBMmABm2bZgQPaeQ4II63O3l8NGjn7zkf95oc83ghgE9KXr72aL80/+/hY eNiJLW8lDk3E23SENHM00QZ8oiTmjjcuFl9d0ZaP6wVwoaLWd1AtX6+XdcbSZEnK17QW q1Z8iKQUIghS5XRbv/K/5UABdiE+ONN93gIS0S1lUmD32LOQYn9nvtKQwKaT/Ui5Npj3 B6HAdvtYPP5/zXypqkc0XMQA1wu5LRxaRr2QpKYBNH891BBysuXZIWuBDNxtMDuX5mP+ n/bt4ldAEr2xz5Kfv3MixjR0jtkfmHd8zVlKjwXOBU8YzTRuJ8K8yPuV+er5X+tB7az3 3ncA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020a056402039200b00519523cfe33si228023edv.465.2023.06.14.02.31.13; Wed, 14 Jun 2023 02:31:40 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235132AbjFNJUS (ORCPT + 99 others); Wed, 14 Jun 2023 05:20:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243999AbjFNJT4 (ORCPT ); Wed, 14 Jun 2023 05:19:56 -0400 Received: from mx5.didiglobal.com (mx5.didiglobal.com [111.202.70.122]) by lindbergh.monkeyblade.net (Postfix) with SMTP id D9C3A10E9 for ; Wed, 14 Jun 2023 02:19:54 -0700 (PDT) Received: from mail.didiglobal.com (unknown [10.79.65.12]) by mx5.didiglobal.com (Maildata Gateway V2.8) with ESMTPS id 6A12DB012F056; Wed, 14 Jun 2023 17:19:52 +0800 (CST) Received: from didi-ThinkCentre-M930t-N000 (10.79.64.101) by ZJY02-ACTMBX-02.didichuxing.com (10.79.65.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 14 Jun 2023 17:19:51 +0800 Date: Wed, 14 Jun 2023 17:19:45 +0800 X-MD-Sfrom: tiozhang@didiglobal.com X-MD-SrcIP: 10.79.65.12 From: tiozhang To: , , , , CC: , , , , , , , , , , , Subject: [PATCH v2] sched/isolation: add a workqueue parameter to constrain unbound CPUs Message-ID: <20230614091923.GA1059@didi-ThinkCentre-M930t-N000> Mail-Followup-To: tj@kernel.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.co, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, fuyuanli@didiglobal.com, zwp10758@gmail.com, zyhtheonly@gmail.com, zyhtheonly@yeah.net MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230613092819.GA18487@didi-ThinkCentre-M930t-N000> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.79.64.101] X-ClientProxiedBy: ZJY01-PUBMBX-01.didichuxing.com (10.79.64.32) To ZJY02-ACTMBX-02.didichuxing.com (10.79.65.12) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 Motivation of doing this is to better improve boot times for devices when we want to prevent our workqueue works from running on some specific CPUs, e,g, some CPUs are busy with interrupts. Suggested-by: Tejun Heo Signed-off-by: tiozhang --- kernel/sched/isolation.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 373d42c707bc..5cd67c51622e 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -181,8 +181,8 @@ static int __init housekeeping_nohz_full_setup(char *str) { unsigned long flags; - flags = HK_FLAG_TICK | HK_FLAG_WQ | HK_FLAG_TIMER | HK_FLAG_RCU | - HK_FLAG_MISC | HK_FLAG_KTHREAD; + flags = HK_FLAG_TICK | HK_FLAG_TIMER | HK_FLAG_RCU | HK_FLAG_MISC + | HK_FLAG_KTHREAD; return housekeeping_setup(str, flags); } @@ -208,6 +208,12 @@ static int __init housekeeping_isolcpus_setup(char *str) continue; } + if (!strncmp(str, "workqueue,", 10)) { + str += 10; + flags |= HK_FLAG_WQ; + continue; + } + if (!strncmp(str, "managed_irq,", 12)) { str += 12; flags |= HK_FLAG_MANAGED_IRQ; -- 2.17.1