Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp579796lql; Mon, 11 Mar 2024 10:55:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPygP38wqZ3dCDIZrQ2rBjWT43+UTevMDRHA3hfDRKvgYEObcaFELIdiBl9wPZg9GfpHkkVzHSRZSUgoH5QRctKMPzdAqqqVGzCXUNDA== X-Google-Smtp-Source: AGHT+IF54f7LcTsOjiQDEaOzw5VGHVCwWUGcylvHW3Wos10xPWa9XOAqU1WdXT1buMAe3lpMzoFq X-Received: by 2002:a05:6808:2e85:b0:3c2:355c:e68 with SMTP id gt5-20020a0568082e8500b003c2355c0e68mr11844719oib.5.1710179714182; Mon, 11 Mar 2024 10:55:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710179714; cv=pass; d=google.com; s=arc-20160816; b=inKPcv9DPl+y+EunI1aR5I1GNU+ISNFwNgQa3wbDh9maPdHtfwz5LpGfaS8zpL0q80 5jP2TENvdDP0MUGM2+tvpE1AONb0/Ik0EB/Ome0zoxz1Aw07T2I5jzVtSoM1i1jFxTm+ 9erKRup+xFbKiDgb9uuo/YEzPUYJNXAlN/dqDxx4gzv4V50xSpEdBVB/QfqKM1TbrJLX MI1B1QY8MNh/guRbth/Fh5e6iZcGq1k1Ly3VC0HsdS6BBARK5cwJVIgH4Y/EBBE0ql6L NBhgGW9bGMu2BYuav9M8b22ET6K6uppP4rMz8bqZnWxG6dLQMx58pL1ReZHW0gPBNyVS k5Yg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=ixDe9I9AUVYXCtDd3EvX9S2TrmG1eYMoyw486QJaxuI=; fh=ZSepl6sOSGb3dOMgqJ9Dn+vZmKSeTK/ca2G3Sifm3XA=; b=trPNcmIvSn6Xa2Sbdkj+EvSbV4zbPLYL+XUIqteoAJKdd+u9/L7ft9ZW2s4evhX88G h47OWF3PmSnnkmsPoqE3MwZ7fT2yDok+d6nV/yOBOlcZddRxGoV/Oe0kEY6CJ9SUwLDz 2coAU1TWsCLQ6z6UHiJQlCmN8d/sssI6FIB6ywFHnYDlb9yazjlelEpWgGtO51Rribda cCK7tsofsaWHuVjpXarNC1/pvlYep2KVa4G+5jccAL5Eueev5hyZ8os8g0GIbNpm64tt g0Mx4D4FFDkLzKpHgaUD8xvc5KiqS+D5uuPTogHlN/o7X/Auwgv3IizgD7BM0ShiygNZ jIhQ==; 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-99333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g16-20020a63fa50000000b005e438e94d31si5429934pgk.385.2024.03.11.10.55.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 10:55:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-99333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99333-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C26A2280E8D for ; Mon, 11 Mar 2024 17:55:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24AFE5472A; Mon, 11 Mar 2024 17:55:00 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D80F5466C for ; Mon, 11 Mar 2024 17:54:57 +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=1710179699; cv=none; b=GWRoGQf8L8WFmPpa397S7greh+lWujoNMhzLx6jzkEmUTmLb5Xv27W4hIZN7UiUX9vYPGExjkZhBYEriQQ9z6YjjY4JVF/d9cx1RUQuVVMkIrZreGOwsrElR7bdj5YUsMtqjicCkvGo2+nRJf8aQxW5TqWYLOIIKKwKY91enOeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710179699; c=relaxed/simple; bh=LrLIuqYmgtYw0Pf1y+c/lSOuQYABIIK/vkLDl8q4yTc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=avPswGu0a1oUw3JmvJSOunxDHTwAaK2UOFQM2Q3Sygl3PQJwsgjA5tsPLWE5/NvhhQ4oY1r4CrjgMGNo2ArOKN/j4Hjs4dogql2PXh5N+KDV9EiuBviPltcItiVzuh20EjLiR0k+qSytGCJq7ECN6QNsaL9V4XVcNqndQmLfkY4= 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 767C3FEC; Mon, 11 Mar 2024 10:55:33 -0700 (PDT) Received: from [10.1.197.60] (eglon.cambridge.arm.com [10.1.197.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4E7BF3F762; Mon, 11 Mar 2024 10:54:55 -0700 (PDT) Message-ID: Date: Mon, 11 Mar 2024 17:54:52 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] fs/resctrl: Uniform data type of component_id/domid/id/cache_id Content-Language: en-GB To: Rex Nie Cc: fenghua.yu@intel.com, reinette.chatre@intel.com, rohit.mathew@arm.com, linux-kernel@vger.kernel.org References: <20240311081839.937-1-rex.nie@jaguarmicro.com> From: James Morse In-Reply-To: <20240311081839.937-1-rex.nie@jaguarmicro.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Rex Nie, (for those following along at home - this is a patch against the MPAM tree, not mainline) On 11/03/2024 08:18, Rex Nie wrote: > This patch uniform data type of component_id/domid/id/cache_id to > u32 to avoid type confusion. According to ACPI for mpam, cache id > is used as locator for cache MSC. Reference to RD_PPTT_CACHE_ID > definition from edk2-platforms, u32 is enough for cache_id. > > ( \ > (((PackageId) & 0xF) << 20) | (((ClusterId) & 0xFF) << 12) | \ > (((CoreId) & 0xFF) << 4) | ((CacheType) & 0xF) \ > ) Aha, this is where those numbers are coming from! Thanks for digging that out. > refs: > 1. ACPI for mpam: https://developer.arm.com/documentation/den0065/latest/ > 2. RD_PPTT_CACHE_ID from edk2-platforms: https://github.com/tianocore/edk2-platforms/blob/master/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h#L202 Just to check - you don't see any side effects from doing this, its just cleaner. I agree - today this is only an int because that's what it is in struct rdt_domain. > diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h > index dd34523469a5..b00a89addf91 100644 > --- a/include/linux/resctrl.h > +++ b/include/linux/resctrl.h > @@ -108,7 +108,7 @@ struct resctrl_staged_config { > */ > struct rdt_domain { > struct list_head list; > - int id; > + u32 id; > struct cpumask cpu_mask; > unsigned long *rmid_busy_llc; > struct mbm_state *mbm_total; We should probably only make this change if we clean this up in restrl, not just the MPAM driver. I'll pick the MPAM bits of this up for the MPAM tree. This will eventually get merged with the patch that adds the original code as there is no point preserving the history of code that isn't merged yet. I'll add you to 'CC' of those patches. (The joke is 'CC' also stands for Celebrate Contribution!) Thanks! James