Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4892735rdb; Tue, 12 Dec 2023 12:13:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5SiSr7unaVcdx3hUwoSKcIN6PIVZwH1fj0ZreRiJiA2Ns/CqOGWtaCzQIzPyitdz/yA9E X-Received: by 2002:a05:6a00:391c:b0:6ce:2731:e864 with SMTP id fh28-20020a056a00391c00b006ce2731e864mr7374569pfb.43.1702412018823; Tue, 12 Dec 2023 12:13:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702412018; cv=none; d=google.com; s=arc-20160816; b=q4yMH9iquQZfrOD2PMhhafzVFuWoyyw8+yibroZ3O9QHj+GjEZkCE97S0LXLKtpRs9 41QguX1z3H5CmDbWemgcAoOBRXmv4xCpLt6RfSd8Mpg2fBY2GPmXr3cbh7rmxaz/DmA7 PSyOt/RrxhdIDSmcBP2lhXdJs5jG9rtQKnqQJiyfPMuyBORgMWF/tcBwKKRtLjlnyx8T V0/Hhh5pkkoGtJEtq3s6l1lDkom/uTW2/LvudhsMWD7OhPvq+Pl44m6UHPRiejgaScKU JMvQJVw2N7u55ijb/p/LamHrHzQ6ZmdOKk4JHNftU70E/0hq3hSsH5t2znJsfB8Jf73r 5DAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=t4fxZP/IYisq2zbUjkaIJd5qdWpjoCmKZbuHhpCTTSE=; fh=e2o/kEwNyT3JtXbFPuNjQQ5YlM6AXNE/cmdzDOWAZuY=; b=ZdcR/pV2LyfiBf4FB0oyi0UDZ5o5Ol7pg2lg/gs7IkUSS3uq2Km0F1wXE03Xn9NOu6 bYvOjN3/YDufwELYmzfm0DoB0l2Abazh3XAJ1/e3ATNNN2E+vxI/QMVMCrZZJ3yDGeLY 02kd1fvXUHHxIJH3AHYD82ulh7p0QlL1YCst8lpa3CNEdKxNq3Z63G+wcfzu3KLL3+7E VtLqOywY06AV+MaTUvVEvqgXixCn77AwSDEoJVheePzD6DOUMFcqHDuvvl+yeXkHgt0x dQy2EwnqxELCI3wwIdB1GCu5n/2/EID6cbAh9r7jIDJKIFBWueZEFivmwEIalRYvHKL7 1YNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iT55Q9GT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id bx20-20020a056a02051400b0057795cb4f16si8744279pgb.684.2023.12.12.12.13.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 12:13:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iT55Q9GT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2752680A80C4; Tue, 12 Dec 2023 12:13:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377201AbjLLUNW (ORCPT + 99 others); Tue, 12 Dec 2023 15:13:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235047AbjLLUNV (ORCPT ); Tue, 12 Dec 2023 15:13:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8136AA5 for ; Tue, 12 Dec 2023 12:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702412006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t4fxZP/IYisq2zbUjkaIJd5qdWpjoCmKZbuHhpCTTSE=; b=iT55Q9GTYpFkkiSRBDDr/QxZCx+AgCzc6B3TmU4V7gpLTdpCeDsYPMR9f1HAzU78eayOmX G7GrtMQRU+xk0KVr7ra+L7Do1IMWo5thHyN+ukfaYf714Ci+d0Nt2AqNUgJkxy1yyFJ62/ MDrLuwJ3+k9Xvee0enUo+xoCdIo0jOI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-38-sOQM5YlMMJCYBc6bHvcaYA-1; Tue, 12 Dec 2023 15:13:23 -0500 X-MC-Unique: sOQM5YlMMJCYBc6bHvcaYA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A68C3185A783; Tue, 12 Dec 2023 20:13:22 +0000 (UTC) Received: from [10.22.10.183] (unknown [10.22.10.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9035F492BE6; Tue, 12 Dec 2023 20:13:21 +0000 (UTC) Message-ID: <64589863-d878-4daf-9eac-00717f317022@redhat.com> Date: Tue, 12 Dec 2023 15:13:21 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Modifying isolcpus, nohz_full, and rcu_nocb kernel parameters at runtime Content-Language: en-US To: "Pandruvada, Srinivas" , "frederic@kernel.org" , "Dutka, Gianfranco" Cc: "bsegall@google.com" , "vschneid@redhat.com" , "tj@kernel.org" , "dietmar.eggemann@arm.com" , "vincent.guittot@linaro.com" , "peterz@infradead.org" , "juri.lelli@redhat.com" , "linux-kernel@vger.kernel.org" , "vincent.guittot@linaro.org" , "mingo@redhat.com" , "rostedt@goodmis.org" , "mgorman@suse.de" , "bristot@redhat.com" References: <76587DD3-2A77-41A3-9807-6AEE4398EBA6@arista.com> <25E6E1E4-DC16-490E-B907-A3236FB9317A@arista.com> <2059341ff4189c8828a41082248f11712edd2b9e.camel@intel.com> From: Waiman Long In-Reply-To: <2059341ff4189c8828a41082248f11712edd2b9e.camel@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 12:13:36 -0800 (PST) On 12/12/23 09:04, Pandruvada, Srinivas wrote: > Hi Fredric, > On Tue, 2023-12-12 at 14:27 +0100, Frederic Weisbecker wrote: >> On Fri, Dec 08, 2023 at 09:18:53AM -0500, Gianfranco Dutka wrote: >>>> The isolcpus, nohz_full and rcu_nocbs are boot-time kernel >>>> parameters. I am in the process of improving dynamic CPU >>>> isolation at runtime. Right now, we are able to do >>>> isolcpus=domain with the isolated cpuset partition functionality. >>>> Other aspects of CPU isolation are being looked at with the goal >>>> of reducing the gap of what one can do at boot time versus what >>>> can be done at run time. It will certain take time to reach that >>>> goal. >>>> >>>> Cheers, >>>> Longman >>>> >>> Thank you Waiman for the response. It would seem that getting >>> similar >>> functionality through cgroups/cpusets is the only option at the >>> moment. Is it >>> completely out of the question to possibly patch the kernel to >>> modify these >>> parameters at runtime? Or would that entail a significant change >>> that might >>> not be so trivial to accomplish? For instance, the solution >>> wouldn’t be as >>> simple as patching the kernel to make these writeable and then >>> calling the >>> same functions which run at boot-time when these parameters are >>> originally >>> written? >> As for nohz_full (which implies rcu_nocb), it's certainly possible to >> make it >> tunable at runtime via cpusets. If people really want it, I'm willing >> to help. >> > We have a case for dynamically isolating CPUs at run time. > > https://lore.kernel.org/lkml/ZNM5qoUSCdBwNTuH@chenyu5-mobl2/ > > It was suggested by Vincent to use house keeping cpumask for solving > unnecessary wake ups on isolated CPUs. Can this house keeping cpu mask > and type be updated at runtime? The house keeping cpumasks are statically set up at boot time. The cpuset code will have an internal isolated_cpus cpumask that lists all the CPUs that are in isolated partitions. It will also expose it with a new cpuset_cpu_is_isolated() function. The code is currently in the cgroup tree and will be merged into the upcoming v6.8 kernel. As the new isolated_cpus mask can be changed at run time, some synchronization may be needed depending on how it is being used. So the cpumask itself will not be exported, new API can be provided to copy out the cpumask if needed. Cheers, Longman