Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp626548pxj; Thu, 17 Jun 2021 10:05:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlb/zGuVOD6ZsmnFjjmP57jHGbGsZM5+EuSHQIaZS1+3IV9PEbRugf0Yj68nVL9fc04zQB X-Received: by 2002:aa7:d14d:: with SMTP id r13mr8142019edo.212.1623949506732; Thu, 17 Jun 2021 10:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623949506; cv=none; d=google.com; s=arc-20160816; b=hQMInbsTUgJIM4gAZj/hjN0sacNzcaFbIiOWlWUT0Oz8iRnZrA25ZViAM3PmNhaEzV xcCv0t4Uk07rZT4PMOYm6du2//MssMUwf8IAhAlwRTI/xDTzEcSnhemhVr1fjpaeve9d vKq8PUT3hFWawMTuzJTgnHfxLJFeP94Ym+ZZ8Wwhpp9sfS1TWzLvY2dKO1qJJZCdZHet 7S9uvZ99trKrOkDXRA92zEjOEptrjy0ha2ZTh/J9a2fonDS4Wq420NFfRKDU+oI9rK8+ FQhWVGJyYA2Wbt6EWRZpy4Sf6UE+4/ObqWW+FjFmQMgdVitEWZEafaL/qUtmggLNEN0o YHGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=j/+99DXE/hTmXq2qy2E57sg2ue4j0iMr9bx4apguuX8=; b=D6gn/AHp7/6QriW1lz6RWI7nT8jGUWNhiezVZ7XX2MXGlFGVu9guXpcZCsbxoqDXOe M93o3jPNE0HGoaMEspsZJX6MUOn4hUJHcCB4jKJqNjJNGZjAKMP/sZ/J+77hymDKG5Kf I2lnHzb8PwIKYt6+IxgC41wRXYJtZhM+uT3f25LYjtJhCSbziSTfSZyyYp2MzFTVIB5r 2hrv4L6YyedU2X6bRsfXEiOm4LiCB4lHhiPhPQvckIsURjOsKG8JqBIsbx7vZmCGSQv6 l/voA2rZauMWRF+lVU3y/uWlECYmKadd8MtoDA6MnPDqEx/FGTA8USP1lBTA2ZAE54hS F8Bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si5688231eju.463.2021.06.17.10.04.40; Thu, 17 Jun 2021 10:05:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231301AbhFQREb (ORCPT + 99 others); Thu, 17 Jun 2021 13:04:31 -0400 Received: from foss.arm.com ([217.140.110.172]:56698 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230526AbhFQREb (ORCPT ); Thu, 17 Jun 2021 13:04:31 -0400 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 5068613D5; Thu, 17 Jun 2021 10:02:23 -0700 (PDT) Received: from [192.168.0.14] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5C0E23F694; Thu, 17 Jun 2021 10:02:21 -0700 (PDT) Subject: Re: [PATCH v4 02/24] x86/resctrl: Split struct rdt_domain To: Babu Moger , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , shameerali.kolothum.thodi@huawei.com, Jamie Iles , D Scott Phillips OS , lcherian@marvell.com References: <20210614200941.12383-1-james.morse@arm.com> <20210614200941.12383-3-james.morse@arm.com> From: James Morse Message-ID: <707378c3-1ce1-12d7-e35d-8c8d4650340e@arm.com> Date: Thu, 17 Jun 2021 18:02:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Babu, On 15/06/2021 18:51, Babu Moger wrote: > On 6/14/21 3:09 PM, James Morse wrote: >> resctrl is the defacto Linux ABI for SoC resource partitioning features. >> >> To support it on another architecture, it needs to be abstracted from >> the features provided by Intel RDT and AMD PQoS, and moved to /fs/. >> struct rdt_resource contains a mix of architecture private details >> and properties of the filesystem interface user-space users. >> >> Continue by splitting struct rdt_domain, into an architecture private >> 'hw' struct, which contains the common resctrl structure that would be >> used by any architecture. The hardware values in ctrl_val and mbps_val >> need to be accessed via helpers to allow another architecture to convert >> these into a different format if necessary. After this split, filesystem >> code paths touching a 'hw' struct indicates where an abstraction >> is needed. >> >> Splitting this structure only moves types around, and should not lead >> to any change in behaviour. >> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h >> index 43c8cf6b2b12..235cf621c878 100644 >> --- a/arch/x86/kernel/cpu/resctrl/internal.h >> +++ b/arch/x86/kernel/cpu/resctrl/internal.h >> @@ -299,44 +299,25 @@ struct mbm_state { >> -struct rdt_domain { >> - struct list_head list; >> - int id; >> - struct cpumask cpu_mask; >> - unsigned long *rmid_busy_llc; >> - struct mbm_state *mbm_total; >> - struct mbm_state *mbm_local; >> - struct delayed_work mbm_over; >> - struct delayed_work cqm_limbo; >> - int mbm_work_cpu; >> - int cqm_work_cpu; >> +struct rdt_hw_domain { >> + struct rdt_domain resctrl; > Naming is bit confusing here. There is another field with the same > name(patch1). But a totally different type, you'd only access its members via the resource or domain, so its always clear which it is. (and if you get them wrong, it won't build) > +struct rdt_hw_resource { > + struct rdt_resource resctrl; > > I think we should make this bit more clearer. May be or something similar. > > struct rdt_hw_domain { > struct rdt_domain d_resctrl; Sure, I guess it makes it clear when quoting something. Thanks, James