Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2896825rwl; Mon, 27 Mar 2023 06:49:13 -0700 (PDT) X-Google-Smtp-Source: AKy350Zi/BNSwcObg/ococ+k3hMY8VeUPdvbHaR3VPrbTLS2l+9u7y1lhyR5z4daePTcmYhVXNxz X-Received: by 2002:a17:907:a0d3:b0:944:308f:b977 with SMTP id hw19-20020a170907a0d300b00944308fb977mr4550796ejc.16.1679924953364; Mon, 27 Mar 2023 06:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679924953; cv=none; d=google.com; s=arc-20160816; b=b/fkfNzyKkCLp0GRd9Xwq3+Q06R2txNDheGfojzYjUz3pdOV+Y5XP422PXbRSKFD+C 3rMpz4AsWueyDxWD3mbameP6xSXCwboJCH3ukLADsPz3+5U3v2eIjoVclzzCjd/zruzG w2HSaTM7Wp9k6IL2wx+gZX6bieqCZ2MhtuMl06+MhjwLs7zvoBYNV//gKKUUXHA7othD CP5Vyxk1XQF5cTYXSRzRazNVJzZfvo9nXJfF45jr6YIByc/XbsFimhA8Eym8+5Mv4e1Z 15GvyvYkb1AeCD6XVSeR9Q5L1CjNVgYcM0NSOLxPn3SD/1uHwzB0+5Ia6/5MFPKwI9HK IwiQ== 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=8d9EBL9G+yB4k+cLBXL6iafPp7ZDhdpIRbLC9bXM/FM=; b=wa/FDF/Y9CMcCVpYCB5kzm65cDa+CMRKI8WGqkF5/uzvi7S2e//jtXw4Pta3x5IfQZ XgJkQ6VwhHQ5phRY5bFt2Uu6RHtoeUomxQzO1AIzf3fAlq0h9gmuK/DVdlCz8IA+zf+s /DWJG8NTOkjrHVcouZcZD5+eECxhMePBe9NqXSSRnMD7z1noXlNgUCHnEKVW9XWmseoB fMOKEryTSTv7Grs4Ll7xM7NPPL9MExSzdHTtNMqWvnabJcxl1C+Rh25NFn97t5HxP2Vx DCGfrZgsDgiSsmQLwAJIkt4gX8x2H15d8M78elbcBzpabu3v0cNDjA/XtT29fSdgij/d 339w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CTjAjcpk; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vk5-20020a170907cbc500b009334be3d5fcsi24903830ejc.296.2023.03.27.06.48.48; Mon, 27 Mar 2023 06:49:13 -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=@redhat.com header.s=mimecast20190719 header.b=CTjAjcpk; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232689AbjC0Nig (ORCPT + 99 others); Mon, 27 Mar 2023 09:38:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232603AbjC0Ni1 (ORCPT ); Mon, 27 Mar 2023 09:38:27 -0400 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 86E77468A for ; Mon, 27 Mar 2023 06:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679924261; 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=CTjAjcpk3leoE+SNxXoCKaY/H65hgfFoUhBbw+VDBHidERyyqkvCCmH7bif+891uH4bu1E EMeYyQIwcP4g2BJoSMPxAuNtLTB6CZ9bxR599S8RaewQM8WiYJol1RN5LtccmcL3v5Wa0P /+gRIWVPwkMvszFeksPD/gl+M89/iMU= 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-Spam-Status: No, score=0.9 required=5.0 tests=DATE_IN_PAST_03_06, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no 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 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).