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 10753C7619A for ; Mon, 27 Mar 2023 13:37:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1216F900003; Mon, 27 Mar 2023 09:37:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0AB09900002; Mon, 27 Mar 2023 09:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6591900003; Mon, 27 Mar 2023 09:37:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D4094900002 for ; Mon, 27 Mar 2023 09:37:41 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 72383C05B1 for ; Mon, 27 Mar 2023 13:37:41 +0000 (UTC) X-FDA: 80614780722.08.78461D0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf23.hostedemail.com (Postfix) with ESMTP id ECC15140022 for ; Mon, 27 Mar 2023 13:37:37 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="fhA7/qVZ"; spf=pass (imf23.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.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=1679924258; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8d9EBL9G+yB4k+cLBXL6iafPp7ZDhdpIRbLC9bXM/FM=; b=dywSe0fBhf888iImO1h6wvhFD6HfnzKpvqQoq6JOBACSDIbCOWRFPbv/HIgyNuSQhlNrxG wl3vjOFuieheZOcvyufvybcQNJYFdTaRnj0i1P3GM9yRUa7Ulj1dQEAtmvMgEhQ1IcSx2i 3hkcyUCXEjZ4Jcx58HhfNR+8eFsJMJE= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="fhA7/qVZ"; spf=pass (imf23.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.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=1679924258; a=rsa-sha256; cv=none; b=dT49KBfFaX3/eFUittOu/330Lvikcfj7FAqeXemv6KKLhGw796NzSP/bKHkMbfphKj1AAx 38GkxS6L6C0DpxVu4SU6BaiZG+0922qsbGZyyQvGUDO5ya6Ib3LHMXehqIrqYJgPj8JddL F066BpXyrIZbA+t+s0CleFE9Z53Jy2g= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679924257; 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=8d9EBL9G+yB4k+cLBXL6iafPp7ZDhdpIRbLC9bXM/FM=; b=fhA7/qVZKeWaglIFs5r678OW1o/w8TzzuqXnjWyeJyN+X81/yeZQ6kgnssskGvc7lFUf6G K0xFeG21HyKbVLM2f3Uyi5lXmIvxoiS5LmdmaD6iE0+sC8shU4Ui7dEv0epF5sgLINY8xW pDN/Vko0c9uredaWBlTPCoJHj9Ob57I= 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-594-KcBeCJvsMWWafjfv-KwpXg-1; Mon, 27 Mar 2023 09:37:36 -0400 X-MC-Unique: KcBeCJvsMWWafjfv-KwpXg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6B3BE3C14841; Mon, 27 Mar 2023 13:37:35 +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 35ED3492C3E; Mon, 27 Mar 2023 13:37:35 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 4DD3F403D16E8; Mon, 27 Mar 2023 07:24:54 -0300 (-03) Date: Mon, 27 Mar 2023 07:24:54 -0300 From: Marcelo Tosatti To: Frederic Weisbecker 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-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: ECC15140022 X-Rspam-User: X-Stat-Signature: 9mdozooxjg6hkh3oragpsmyc6mepqtwf X-HE-Tag: 1679924257-498278 X-HE-Meta: U2FsdGVkX1+OK7rMC6+ZcSNU0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WpZ8zOgPNn87Xf8NDDQsR/PLM/Cw5Bektkg9jD+ZfYw3GkxO4rPjFvXZr6G4h+82pwCNrn14MiCB8aSNZka1U/76BU4AKg5cLdJX+4M/9cYUmutUNoGfFVjht8X5jHI1Hfk/D5mKe8a9Sctw2PuIT3lEEn8/arl9ppXiZTMbGQ== 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 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).