Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4233379rwl; Tue, 28 Mar 2023 04:42:49 -0700 (PDT) X-Google-Smtp-Source: AKy350YgrAlqN00gN3GzxISEkYjmuVR4/LGUuPkcJsdG809inR8w2xRlV+4i89anSkY+sONFCC+e X-Received: by 2002:a17:903:1c6:b0:1a1:d366:b085 with SMTP id e6-20020a17090301c600b001a1d366b085mr15283844plh.21.1680003769696; Tue, 28 Mar 2023 04:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680003769; cv=none; d=google.com; s=arc-20160816; b=F+oubIxjtNDkupXj4pNBOqSUPWOI1jZTxDsNC7ByUc450Bve5r9Q6IHdYXFm72Rf3z FVlah6+UMliZuxL3pgn5qcavheTf5grG1ll/ewmnflRqE3+eAcmfswTnZEuG+Aga7tLi ZYZEC1cPmJTKFNdDANoFLz+NMN9fOKIwi227rIy4j/cbqYm4+7UvHeneGKJVJOxY1ut6 63lNCEjth+RGgPz4K0uMwWVwUbq5174p3QDIpyA02kntEESJFiNqFO/54IR6/6BEwL+C W/93t4bYxQpWRUnbUBWdUUGx46FQoXezi/4WKcJ4ExHtuG61KkO2G9iDH7GBG/YHIjQE bdgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cIU73uZAPETkegjxRuuYfoqpT7fkVOB4NcpXsVljnOU=; b=hng6ofCoSeLU5amYLtHhz/Ybc3cDoD9SoNa0jDgbgkf6dY7UVhkTq99Qs7O+V3+U7E OAsze+ic0SgVUNszsqb5Ko89n0IbTmjMn74scHohiSlP4QBRydrnVvw9/5neVZZpfBza n5XMyHnZJI96pLaQJI4dQgGLhz3be8VH0RzWcKpaEP34ri4k0jEKXhTr4OThtnJ8KJsZ JbXZ6ago8DEX+Nr6dR67OBa+YnHbSAn5oav7nfyhF+I9B8DUB0w5rhHBqJywNLYek1E6 hiddx3l08i62g5kzbTYFvBTBOMw41e/IjHChD1p97jQGDx0hpb0TuiGik/0ed2Yo4LDA aNuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TXBdL1RA; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a170902e80b00b001a1abc91952si30237257plg.194.2023.03.28.04.42.35; Tue, 28 Mar 2023 04:42:49 -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=@kernel.org header.s=k20201202 header.b=TXBdL1RA; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232787AbjC1Liz (ORCPT + 99 others); Tue, 28 Mar 2023 07:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232797AbjC1Liy (ORCPT ); Tue, 28 Mar 2023 07:38:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C54C55BB for ; Tue, 28 Mar 2023 04:38:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 237DCB81C14 for ; Tue, 28 Mar 2023 11:38:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61D88C433EF; Tue, 28 Mar 2023 11:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680003525; bh=jOmrs/Lchl59dAkRYGNIhG6/nypGKLzZbxjHzoW4mfQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TXBdL1RALxKCk3tpTvdW+ixaWAD/0SsshjdwXvmH8P9hpo6oNhoKa6ijmxu9vljze IwKi5Yj2uz+xgwqKnWglcpcvOP7WeKFVnmVhKl7CsSyjbo+mBbmUWr3UBLZB93cuoK XB3+IE1O0Ed6CcAXtIppJDAc6C9c3jGLnFcTq39vlwKMTrRwfamVrDqDmsxvHS380A t+2o5gJWTkxoYgjr435kPSfKPdad19ykRkuJso4zt1PaXJ+H1IUHXKBW2++kyHn8z8 yqlSIFxiwGJcYZkNQoDN8re986Nf0lI/xTaEClN9vatYwz24DjDz/n72JZn3x3Kiy+ jCrrG/Y8zJ10A== Date: Tue, 28 Mar 2023 13:38:42 +0200 From: Frederic Weisbecker To: Marcelo Tosatti Cc: Michal Hocko , Frederic Weisbecker , Andrew Morton , Leonardo Bras , Peter Zijlstra , Thomas Gleixner , Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , LKML , linux-mm@kvack.org Subject: Re: [PATCH 1/2] sched/isolation: Add cpu_is_isolated() API Message-ID: References: <20230317134448.11082-1-mhocko@kernel.org> <20230317134448.11082-2-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 On Mon, Mar 27, 2023 at 07:24:54AM -0300, Marcelo Tosatti wrote: > On Fri, Mar 24, 2023 at 11:35:35PM +0100, Frederic Weisbecker wrote: > > Le Sat, Mar 18, 2023 at 09:04:38AM +0100, Michal Hocko a ?crit : > > > On Fri 17-03-23 15:35:05, Marcelo Tosatti wrote: > > > > On Fri, Mar 17, 2023 at 03:33:13PM -0300, Marcelo Tosatti wrote: > > > > > On Fri, Mar 17, 2023 at 02:44:47PM +0100, Michal Hocko wrote: > > > > > > From: Frederic Weisbecker > > > > > > > > > > > > Provide this new API to check if a CPU has been isolated either through > > > > > > isolcpus= or nohz_full= kernel parameter. > > > > > > > > > > > > It aims at avoiding kernel load deemed to be safely spared on CPUs > > > > > > running sensitive workload that can't bear any disturbance, such as > > > > > > pcp cache draining. > > > > > > > > > > Hi Michal, > > > > > > > > > > This makes no sense to me. > > > > > > > > > > HK_TYPE_DOMAIN is set when isolcpus=domain is configured. > > > > > HK_TYPE_TICK is set when nohz_full= is configured. > > > > > > > > > > The use-cases i am aware of use either: > > > > > > > > > > isolcpus=managed_irq,... nohz_full= > > > > > OR > > > > > isolcpus=domain,managed_irq,... nohz_full= > > > > > > > > > > So what is the point of this function again? > > > > > > > > > > Perhaps it made sense along with, but now does not make sense > > > > > anymore: > > > > > > > > > > Subject: [PATCH 1/2] sched/isolation: Merge individual nohz_full features into a common housekeeping flag > > > > > > > > > > The individual isolation features turned on by nohz_full were initially > > > > > split in order for each of them to be tunable through cpusets. However > > > > > plans have changed in favour of an interface (be it cpusets or sysctl) > > > > > grouping all these features to be turned on/off altogether. Then should > > > > > the need ever arise, the interface can still be expanded to handle the > > > > > individual isolation features. > > > > > > > > > > But Michal can just use housekeeping_test_cpu(cpu, HK_TYPE_TICK) and > > > > > the convertion of nohz_full features into a common housekeeping flag > > > > > can convert that to something else later? > > > > > > > > Actually introducing cpu_is_isolated() seems fine, but it can call > > > > housekeeping_test_cpu(cpu, HK_TYPE_TICK) AFAICS. > > > > > > This is not really my area. Frederic, could you have a look please? > > > > The point is to have a function that tells if either nohz_full= or > > isolcpus=[domain] has been passed for the given CPU. > > > > Because I assumed that both would be interested in avoiding that flush > > noise, wouldn't it be the case? > > Yes, that is the case. But as a note: for the two main types of > configuration performed (one uses isolcpus=[domain] and the other > cgroups, for isolating processes) nohz_full= is always set. > > So just testing for nohz_full= would be sufficient (which perhaps would > make the code simpler). Ok then all is needed is to test tick_nohz_full_cpu(target), right?