From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DE4DC6FD1D for ; Fri, 17 Mar 2023 18:36:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C1B86B007D; Fri, 17 Mar 2023 14:36:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 44AC96B007E; Fri, 17 Mar 2023 14:36:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 275896B0080; Fri, 17 Mar 2023 14:36:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 158EC6B007D for ; Fri, 17 Mar 2023 14:36:48 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DA6D21A0851 for ; Fri, 17 Mar 2023 18:36:47 +0000 (UTC) X-FDA: 80579246454.16.5DFC6C2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 0D056C0017 for ; Fri, 17 Mar 2023 18:36:45 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=doWct6Vj; spf=pass (imf22.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679078206; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=EZUL8o0Hxspjf9WQhOGBGAxIyrZGEUO1SIJiRh0pxXY=; b=3v+MnjD1v6P4lh1q8s7cfMJ63/p+pp7ehzY2nuU7ch1/pC4wsGpzMYft9srsPLw0wl5kIi qMcKYUt0BsxozUpT4qNn/ne9ZNnhrlSYyKmJ/cm5eyKasizjiWQy8XdI0KqvDROGhxTbgU /veZ0HQnsw4EMb8tn5jPcvH80wDyX04= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=doWct6Vj; spf=pass (imf22.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679078206; a=rsa-sha256; cv=none; b=kGzyL0h9QwbbJKlHs8klKU7Byi7neRxHDsh9oNyUFVLB/L83vePNGlowd1QDY+aB8/1Iq7 1bXlvEDn/WyZbN8TcRxA2vWkwRp6rui2YGqhKwgMj/qhnhojpHe8n9I3dqJvvMgFGj/YI+ tOumtls2YlholEcB3Rtcc6JpXH0Dn6I= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679078205; 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: in-reply-to:in-reply-to:references:references; bh=EZUL8o0Hxspjf9WQhOGBGAxIyrZGEUO1SIJiRh0pxXY=; b=doWct6VjJw3XCVo4dKw3B3lfMWVURtuSU/ExW4BiwwfLXIPD02EWf6cbHh3/n26d/MRItv JT88ezK8TDdncGCamzDJDTqIBUvq1bPsTSHVtEORw6csY5zicAsdBfbfZn6WIbxYrXtYu6 cvMYxYjWcJrz9/uSrbi0m7o776SdS7k= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-267-SJzpPHoxMUWtA7JC4hI7EA-1; Fri, 17 Mar 2023 14:36:41 -0400 X-MC-Unique: SJzpPHoxMUWtA7JC4hI7EA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 50F361C12989; Fri, 17 Mar 2023 18:36:40 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03D39483EC1; Fri, 17 Mar 2023 18:36:39 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id EE2C0403B5BB3; Fri, 17 Mar 2023 15:33:13 -0300 (-03) Date: Fri, 17 Mar 2023 15:33:13 -0300 From: Marcelo Tosatti To: Michal Hocko Cc: Andrew Morton , Leonardo Bras , Frederic Weisbecker , Peter Zijlstra , Thomas Gleixner , Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , LKML , linux-mm@kvack.org, Frederic Weisbecker , Michal Hocko 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=us-ascii Content-Disposition: inline In-Reply-To: <20230317134448.11082-2-mhocko@kernel.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Rspamd-Queue-Id: 0D056C0017 X-Stat-Signature: 1s1ynutymptip98jwabfgxp9wnzy3tj5 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1679078205-848611 X-HE-Meta: U2FsdGVkX1/N0d5gUCTKsyHvxyB1qzxb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Tqdkv9ZU+torHSTNpVM+5D4ZMnlOHgY9Egp3Nb6af7fmjgdVwjSzvoWd2umYIvtHEypHrECfDHhyF86/kwETLoIcC4sfEGdiKQBQNINIbL6e3k1y/YFvNJZoaxRGzowNAeCea6SFzTdyupeZUPSHoJEX4ei2wiQbztaQU5KN/mGTTdn8rO9GMWbffgM9MxgTV/QZAiwyochu4q9uTzpwXn8Zjg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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? > > Suggested-by: Michal Hocko > Signed-off-by: Frederic Weisbecker > Signed-off-by: Michal Hocko > --- > include/linux/sched/isolation.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h > index 8c15abd67aed..fe1a46f30d24 100644 > --- a/include/linux/sched/isolation.h > +++ b/include/linux/sched/isolation.h > @@ -46,6 +46,12 @@ static inline bool housekeeping_enabled(enum hk_type type) > > static inline void housekeeping_affine(struct task_struct *t, > enum hk_type type) { } > + > +static inline bool housekeeping_test_cpu(int cpu, enum hk_type type) > +{ > + return true; > +} > + > static inline void housekeeping_init(void) { } > #endif /* CONFIG_CPU_ISOLATION */ > > @@ -58,4 +64,10 @@ static inline bool housekeeping_cpu(int cpu, enum hk_type type) > return true; > } > > +static inline bool cpu_is_isolated(int cpu) > +{ > + return !housekeeping_test_cpu(cpu, HK_TYPE_DOMAIN) || > + !housekeeping_test_cpu(cpu, HK_TYPE_TICK); > +} > + > #endif /* _LINUX_SCHED_ISOLATION_H */ > -- > 2.30.2 > >