Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp57630lqt; Thu, 18 Apr 2024 08:21:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+wsB1KnvpBmyrrz1AxWOHOVI6IqIMisiHZN0Gt03vCZ2VkhUQB5bf6MKpLs3ghNOTFL3MQRdpg2Mm6nny2OkJv1vQ4hoo26EXtXto/A== X-Google-Smtp-Source: AGHT+IE/6ezPeT+lEfli9/KMYnGXWeWNbYwozJcFv7yg4j/bUF8FZUfiptEXtAPcsm3L0jwndMUF X-Received: by 2002:a17:906:1c10:b0:a47:20c3:7c51 with SMTP id k16-20020a1709061c1000b00a4720c37c51mr1897817ejg.71.1713453686597; Thu, 18 Apr 2024 08:21:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713453686; cv=pass; d=google.com; s=arc-20160816; b=Aw1TeHKk/002VzxVnyX4zRTYAHFql+H/PV0TJ0vp9MpPG+CzVRyW8h6UC9dKXV+AEk Buyqgk3ukDGGmPdTPlZv380iLELKx+xpNCCH/brKrVWu6f6eJEIOJ2MoaisLA0sfd9mW 4Lx7rZGq2liGnyZArWhbfJdBl5EC9yrDpU8GP1mXE/qqMq0/OCoPnthNS8Z7MQ3Rd/2r oScDt7GyON/8d96Z1N659rQjRYCHY/CiYcoKrnrT6x7kczittPzbjViQooJZMqbFhs53 qSrz7341LK20p4xsNEH6hYW5tpfUlK/W0NJB+oz7C0CR5Fdbv5s8CMPWZakJKZi02d8l J7wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=YlnCvrdt60H5UG4xD72PxvYFLtJLPKzceI7uHBdq2xo=; fh=QpfXcl1MWRNwK/PrSFDaf8vyLNOqSjtq+qtJ/l97qlo=; b=u6o7JM95yQ+YbHMuAA8XkojlAhszDDaLrmwVQvWBgJ4JjYBHZLPrUcdRncxcQFaB90 Wf0TXEnW2/rYYVY7S/SCwKrn/IgM2bfDsyl0n0rsETrHwP5iM6fjOAQe61kHHMa2+jHg Qxywg/UpwyHkvgSiD50ETNxHnMmgEjeQIVbPhGBOKylolHlvwFA9gkrvw6RDr8M4Bi87 QOf6xZ/eZgp+SHAt1fi2fXbDMw+nx2DcYFZSMdIIdlxsj5w9nRdh/iOJJo29WrkLjbFM fCWEjF0pdvXGs8KAZIwGbuS3YigvGoYz51nBZI0ivizEeSpTFF9Y0hTx+ujeBuPU87du WI0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-150376-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n23-20020a1709062bd700b00a526e050d71si1021745ejg.511.2024.04.18.08.21.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 08:21:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150376-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-150376-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2B1BD1F220D1 for ; Thu, 18 Apr 2024 15:21:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5786516C693; Thu, 18 Apr 2024 15:21:19 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E60C15FA73 for ; Thu, 18 Apr 2024 15:21:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713453678; cv=none; b=WmDTDGw6O3sVJd/zJev/AI9qPR1PMm+qeg958vJwYQ+n+4/01AjU0Bl3l5o0QV3g4A9iMlzp44Lln7599NPgk100CiNOkZm2eZWUtDZ0+ZBN7ZEAyIGBJFjH3StdhgpPQKUcftBhJp49NzhiCo5hAqOtfIZtlKfa4X25jrKEH2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713453678; c=relaxed/simple; bh=BEQoL8Xy1DfYZX7VkjWLZGPArlBBiN1RTUiQ1OWe6kY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iQ/LaB8NWvdPEunkLhFruHpxu4S51kI98x3WlOkHn2TYMX7ols7oOQX0JFgq3bQJnNub8bhi2AqNY2kyu99xjqUkU4k7fVxjqJQqqMyBrCCnojCqGjVf6Xijgd9o3iHMDETGV5rXgqC7ZVXeoiCHMpjUCnAi/BV99k4YEe8NuBg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D77092F; Thu, 18 Apr 2024 08:21:42 -0700 (PDT) Received: from e133380.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BCC4D3F738; Thu, 18 Apr 2024 08:21:11 -0700 (PDT) Date: Thu, 18 Apr 2024 16:21:03 +0100 From: Dave Martin To: Reinette Chatre Cc: James Morse , x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie Subject: Re: [PATCH v1 05/31] x86/resctrl: Remove rdtgroup from update_cpu_closid_rmid() Message-ID: References: <20240321165106.31602-1-james.morse@arm.com> <20240321165106.31602-6-james.morse@arm.com> <6bbff669-cbe5-4284-b64a-4825a541b35f@intel.com> <0698418a-aede-40d6-90ce-dbf6e8796916@intel.com> <069c0e2e-81e1-4343-8a9f-21f1cb74bde6@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <069c0e2e-81e1-4343-8a9f-21f1cb74bde6@intel.com> On Wed, Apr 17, 2024 at 10:12:35PM -0700, Reinette Chatre wrote: > Hi Dave, > > On 4/16/2024 9:16 AM, Dave Martin wrote: > > On Mon, Apr 15, 2024 at 10:47:55AM -0700, Reinette Chatre wrote: > >> On 4/12/2024 9:12 AM, Dave Martin wrote: > >>> On Mon, Apr 08, 2024 at 08:16:08PM -0700, Reinette Chatre wrote: > >>>> On 3/21/2024 9:50 AM, James Morse wrote: > .. > > >> Do you imply that this would maintain the order in this patch? It does > >> not look to me that it would but I may be looking wrong. > > > > I'm not sure without looking again, but since this discussion is not a > > good use of your time I'll just go ahead and implement the change at > > [*] above, while restoring referse FIR order, if that is good for you. > > > >> > >> sidenote: the "on_each_cpu_mask()" in update_closid_rmid() can be on > >> one line. > > > > I guess that might have been split to stick to the 80-char limit. > > > > Due the the small size of this function, shall I just rename defaults_p to p? > > Alternatively, there are already a few non-printk lines over 80 chars, so > > maybe we can tolerate one more here? > > 80 chars are not enforced so strictly that it impacts readability. You > may refer to how update_task_closid_rmid() looks for more confidence in/ > motivation for placing this on one line. Agreed. (I did in fact rename default_p to p in my fixup, which shortens the affected line as a side-effect anyway.) > > > > >> > >> .. > >> > >>>>> + * struct resctrl_cpu_sync, or NULL. > >>>>> + */ > >>>> > >>>> Updating the CPU's defaults is not the primary goal of this function and because > >>>> of that I do not think this should be the focus with the main goal (updating > >>>> RMID and CLOSID on CPU) ignored. Specifically, this function only updates > >>>> the defaults if *info is set but it _always_ ensures CPU is running with > >>>> appropriate CLOSID/RMID (which may or may not be from a CPU default). > >>>> > >>>> I think resctrl_arch_sync_cpu_closid_rmid() may be more appropriate > >>>> and the comment needs to elaborate what the function does. > >>>> > >>>>> +void resctrl_arch_sync_cpu_defaults(void *info); > >>> > >>> That seems reasonable, and follows the original naming and what the > >>> code does: > >>> > >>> What about: > >>> > >>> /** > >>> * resctrl_arch_sync_cpu_defaults() - Refresh the CPU's CLOSID and RMID. > >>> * Call via IPI. > >> > >> Did you intend to change function name? > > > > Er, yes, I meant to use your suggestion here, so: > > resctrl_arch_sync_cpu_closid_rmid(). > > > > I'm a bit confused here when comparing with your response in [1] mentioning > a change to another name. > > [1] https://lore.kernel.org/lkml/Zh6kgs1%2fbji1P1Hl@e133380.arm.com/ My bad (sorry Babu!). I read that suggestion carelessly and assumed it was aligned with Reinette's. The most important thing seems to be to transfer the "defaults" from the name of the function to the name of the struct, since the struct is about defaults (and only about defaults), while the function is about defaults and the running task. To avoid extra busy-work, I'll stick with resctrl_arch_sync_cpu_closid_rmid() for now, but I don't mind changing it if people prefer. > > Also, Babu Moger's suggestion to rename struct resctrl_cpu_sync > > to resctrl_cpu_defaults seems good, since that accurately describes what > > is specified in the struct (and what is *not* specified if NULL is > > passed). > > Sounds good, yes. > > Reinette > Cheers ---Dave