Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp80452lqb; Tue, 16 Apr 2024 09:17:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXA6u34j76228dan/kXTVc6DmgN0VFr59Qbj7RgLD61b4OCrnCF6xv67Fw0bLI/IovDCNcRtBZukMFkBm/7p0UA+Rn0DrbzfN4trnd3qA== X-Google-Smtp-Source: AGHT+IGCR3XfirXam3Tzc+chfKA9uujYmLdk+R5OE4B2AgxX3XiuUMuJabLCvTKGYn3tkZlDD3PC X-Received: by 2002:a50:9b1a:0:b0:56d:eb1e:17be with SMTP id o26-20020a509b1a000000b0056deb1e17bemr2470967edi.1.1713284269835; Tue, 16 Apr 2024 09:17:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713284269; cv=pass; d=google.com; s=arc-20160816; b=zX6J2Qfegnkup7f3WME8zr2rShYDPZw+28bj3obO2rl+euOvri2IjDJRu8dZFYrXNL nGU+5jbfnZ5A5T8uNN2h3mSRgi0cRJi8uNj2GgKRwECrgxSyfBbtbKkmijXyNthj/mB5 lDI6I6W44dEFgv+VJidh/iIYfNtMxuesNTvpjKn4/uEiy/Sz4/x2QsS7L449e77bE/Er ltYewrr7C1+bULWTGCkgY9dd61Y4vYzcJ/lxPTSp5HDxCMYbkopwBXHwoeZuxIDICBsn zilb7gvdyLy9bJv5tdiRPIPPCMQfYh2vEfhQ6JjSNUGFE1AEW6ef4q16AbTusgjpPwfn OEEA== 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=u965GCsIr/gSVcrgli0AtqAd6/9r3SGxkcekxz/F68s=; fh=L6oQMsqStS2+GypcEamznIi2La9bk6Ty8v+876JmcVU=; b=K5MdE2hYuhj4zKCdMtu7+uQNu7H354NtkP9Uhe+rU0vpbDea1ZlHfgFoO/ZZ4f9QrT 0Gkehwn0THxFbehee2ideVfTjrin0jEwPFWhmIcW79Yoekjt8ERNEAYqechCi/xFzFOL ur5gZi2JDFamB74p2Cht4LvyiiIUF0+nHp6dyPfSMsooTZNrFIBiEBRhdAGdTDm+3NDI pgHtFXROws0K1tvUyym0/5jmJkPJs1gxmSDZP8wOMH2mFm2sPV/FCJFWgZa++qBNmyxG xEcUBLItfm4MrHvBivKnc60dwkLAwHota7zI13PswB8jk/MdMFwmGemnWUwdQ512+zBP TPdw==; 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-147216-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147216-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g12-20020a0564021ecc00b0057000ee9f9dsi4545250edg.54.2024.04.16.09.17.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 09:17:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147216-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-147216-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147216-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 6AD461F21523 for ; Tue, 16 Apr 2024 16:17:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CFDB131BA1; Tue, 16 Apr 2024 16:17:14 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72C4585644 for ; Tue, 16 Apr 2024 16:17:12 +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=1713284233; cv=none; b=eNDbp11EgpB9Hbq/59k1AgftDW6N43xa7E9s+OJ9dgCAsCDhkwM7AN6QLJ3ij+eob0r1kDT8vPM63TBG08A+pc8HgB0p/4/7r//XtDJwAnz2I2N1H8O+1yUHY13+7V/S56tCkEXdRQZDfONXaoFrXIPXAW9n4PcihC5Z/rHoOSs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713284233; c=relaxed/simple; bh=HrJiUGIsotWmaJtFYrXhbeTckCCT/Ww05vzENfwm8Vo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OMRhxVTPrjsuMPncFpeb4u5mbbn+oqxPe2dvoRmsSjC34TYKaNzLGfoiMUrDe04w8hftIeXphc1QXrZVzYpBgGFzwq8oOE4X+2wjyUwcGRXPTL3EvIfwqi50wUejjTp28Id4QIen/GIpOwqK/XMvqNv/VvdzAeZ5VThnePGM2dE= 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 EA5C1339; Tue, 16 Apr 2024 09:17:39 -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 0E45C3F792; Tue, 16 Apr 2024 09:17:08 -0700 (PDT) Date: Tue, 16 Apr 2024 17:17:06 +0100 From: Dave Martin To: "Moger, Babu" Cc: James Morse , x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , 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> 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: On Mon, Apr 15, 2024 at 03:40:46PM -0500, Moger, Babu wrote: > Hi James/Dave, > > On 3/21/24 11:50, James Morse wrote: > > update_cpu_closid_rmid() takes a struct rdtgroup as an argument, which > > it uses to update the local CPUs default pqr values. This is a problem > > once the resctrl parts move out to /fs/, as the arch code cannot > > poke around inside struct rdtgroup. > > > > Rename update_cpu_closid_rmid() as resctrl_arch_sync_cpus_defaults() > > to be used as the target of an IPI, and pass the effective CLOSID > > and RMID in a new struct. > > > > Signed-off-by: James Morse > > --- > > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 19 +++++++++++++++---- > > include/linux/resctrl.h | 11 +++++++++++ > > 2 files changed, 26 insertions(+), 4 deletions(-) > > > > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > index 5d2c1ce5b6b1..18f097fce51e 100644 > > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > @@ -341,13 +341,13 @@ static int rdtgroup_cpus_show(struct kernfs_open_file *of, > > * from update_closid_rmid() is protected against __switch_to() because > > * preemption is disabled. > > */ > > -static void update_cpu_closid_rmid(void *info) > > +void resctrl_arch_sync_cpu_defaults(void *info) > > How about keeping the name similar to the old name? > > resctrl_arch_update_cpu_defaults Ack (Reinette made a similar comment.) > > > { > > - struct rdtgroup *r = info; > > + struct resctrl_cpu_sync *r = info; > > > > if (r) { > > this_cpu_write(pqr_state.default_closid, r->closid); > > - this_cpu_write(pqr_state.default_rmid, r->mon.rmid); > > + this_cpu_write(pqr_state.default_rmid, r->rmid); > > } > > > > /* [...] > > diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h > > index 6e87bc95f5ea..2b79e4159507 100644 > > --- a/include/linux/resctrl.h > > +++ b/include/linux/resctrl.h > > @@ -220,6 +220,17 @@ struct resctrl_schema { > > u32 num_closid; > > }; > > > > +struct resctrl_cpu_sync { > > How about changing it to resctrl_cpu_defaults? > > > + u32 closid; > > + u32 rmid; > > +}; [...] > -- > Thanks > Babu Moger > Yes, your name describes what the struct means, so renaming it as per your suggestion does make sense. I'll make a note. Cheers ---Dave