Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5052362rdb; Tue, 12 Dec 2023 18:28:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6kqlIYjvOwmAx6xqCjHQbL6I2C/wo8HeTdHv2shzi5Sm+4PJ4Xn9zQkFVvMgXJ/F1Z9K9 X-Received: by 2002:a17:90a:9918:b0:286:1e90:fe2f with SMTP id b24-20020a17090a991800b002861e90fe2fmr8875509pjp.15.1702434503717; Tue, 12 Dec 2023 18:28:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702434503; cv=none; d=google.com; s=arc-20160816; b=z3q50YI6WSdzJbWs77bhG7/k1VKSoJtgjXeNpHFByRy1skn1FvwfOAGN5GOSC291CB B+7Zlh22ylcqg+UmG/aGLtyQHAqgA1qsuEuUW8d9XUt0mCVzRXGKIrai8NcvQqZ18kml FtbHEVJ6WsCCwPnzcrkAAxpQj9g1MAAvKJuD3Iwnrjki86BatADqCkTLs38U2revJXTl RWCtTHAG/M0DyyUo4U3T94dhEoRRGdvQhnztpXIVM2LtirdgcbQ3+kefr/fUBdIvoEEZ 1KvXtKMoXlblV8FsXjVOZ3JzePLpwju9xefZcynE1hJLnGUu/+u0/DGtxzvCEklcqtVy zHJg== 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=q7ogPeVXGwrtgOAoSCz/LwV9L8KL6rZODfc0Bz4jg5I=; fh=OtxHzvlmAgSPpKOxe0OFVgc8MIVgc+8+DolYWPKpKh0=; b=SJUCSgSfhqEu2j0b1s2bIagqQas5ul/uD/IfTCh2OT5miaES0kzabUgvxNYGg0Ndex K8riAatdPEEk1jT41DpF0i0a90jU3zPI4xwv2qXh6UED1+4Bf07DDxL7TS7yXB9cvM0h XvXf4ZjM8XTo/x69e+KzStppZogPknbmPBXgfHYdS7eokFG5Hn07rkQKqta9MvwlA1R4 mIVEIZ4s4qrwOLYEFrRS71lqFMuynzTd75DejdIdWS4GxAIt13AtHDXBJz3oIr+WdpXF doKUzGTXPQStiorvMIsqRxITIeIaSkWnng0ctADEirpOLtROiVThXjLIyiwLBleI/6+3 GZWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MaTpY4hW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id r7-20020a17090aad0700b00286596c9b37si9832541pjq.22.2023.12.12.18.28.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 18:28:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MaTpY4hW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 0B3808098417; Tue, 12 Dec 2023 18:28:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378305AbjLMC2E (ORCPT + 99 others); Tue, 12 Dec 2023 21:28:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232721AbjLMC2D (ORCPT ); Tue, 12 Dec 2023 21:28:03 -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 5FDC7A0 for ; Tue, 12 Dec 2023 18:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702434488; 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=q7ogPeVXGwrtgOAoSCz/LwV9L8KL6rZODfc0Bz4jg5I=; b=MaTpY4hWQVDu012XjFagR7j3NRuJR7Us8PGRA89qj37v4KSFCZ913lIsb0YpMxgyAO4VMI aVPlcjcFdb6Ho8qZeL1LYgJRzeUuFBrb1MQTywX1yEQpIQzWTVesEmny2pVSrqPl6T07Hj JUbzeiypVFHUkSRWirWnwYOtofD9bhY= 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-XpbZrWEdMHG6dIbEnA-3Kw-1; Tue, 12 Dec 2023 21:28:06 -0500 X-MC-Unique: XpbZrWEdMHG6dIbEnA-3Kw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 C1D9D87B2A1; Wed, 13 Dec 2023 02:28:05 +0000 (UTC) Received: from [10.22.16.51] (unknown [10.22.16.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81AB51C060AF; Wed, 13 Dec 2023 02:28:04 +0000 (UTC) Message-ID: Date: Tue, 12 Dec 2023 21:28:04 -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: Frederic Weisbecker Cc: Gianfranco Dutka , Tejun Heo , Vincent Guittot , linux-kernel@vger.kernel.org, vincent.guittot@linaro.com, Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , "Pandruvada, Srinivas" , Phil Auld , Cestmir Kalina References: <76587DD3-2A77-41A3-9807-6AEE4398EBA6@arista.com> <25E6E1E4-DC16-490E-B907-A3236FB9317A@arista.com> <7e3bf653-d3ea-48b0-b808-d92a3c5f2c5b@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 12 Dec 2023 18:28:21 -0800 (PST) On 12/12/23 18:57, Frederic Weisbecker wrote: > On Tue, Dec 12, 2023 at 03:18:43PM -0500, Waiman Long wrote: >> On 12/12/23 08:27, 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. >> As said by Phil, your help in in enabling dynamic rcu_nocb will be greatly >> appreciated. > rcu_nocb is already ready for that. The not yet ready part is nohz_full and its > several components (tick, remote tick, [hr-]timers affinity, workqueues affinity, kthreads > affinity, vmstat, buffer head, etc...). Last debate on plumbers suggested that > nohz_full should be dynamically turned on/off only on offline CPUs. That will > indeed simplify the problem. So rcu_nocb is ready for dynamically changing it without too much additional work. That is good to know as I haven't looked into that myself. The other pieces will still need additional work. I already have a patch in the cgroup tree that updates the unbound workqueue affinity to exclude isolated cpuset CPUs, though there may still be some further fine tuning that can be done. > >> My current thought is to have a root level >> cpuset.cpus.isolation_control file to enable additional CPU isolation like >> rcu_nocb to be applied to CPUs in isolated partitions. > Last time I tried that, Peter Zijlstra was more in favour of an isolate all or nothing > switch by default for nohz_full that would include rcu_nocb. And then if people > are interested in something more finegrained, introduce such a file to control > individual features (see > https://lore.kernel.org/lkml/YpIwsiaY2IPK96WO@hirez.programming.kicks-ass.net/ ) > > But so far I never heard about the need for such a finegrained isolation. Users of > nohz_full= seem to want to isolate everything out. Yes, I recall some of the discussion now. I am fine with a single on/off switch. That will likely simplify the process as we can add additional isolation features over time once the code is ready, may be a cpuset.cpus.isolation_full boolean flag. Cheers, Longman > > Thanks. >