Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4189112pxb; Tue, 17 Nov 2020 13:52:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzt6xoqzQaxna+scyZ93hOZUQR0Vr7kjn2uEaSbbyhEEcEKqVOWgSJnYjVZ+TlKfA/KzIxK X-Received: by 2002:a17:906:9458:: with SMTP id z24mr22192400ejx.318.1605649938783; Tue, 17 Nov 2020 13:52:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605649938; cv=none; d=google.com; s=arc-20160816; b=fKuMw0BIgG/+hE1K2etK6yRNXtpE6jE3iLeMqHgOKJw3+ZmPx9w/5tbjXMn7+dumgF m8fqPSKg+SISs9OD9ZG9Ydt7BZ8EuKhtGh66kpjmPNEmZXOGuyUoBMvZ1NYdmsW701If axbgBv5LjZ2SHX/6GwKLuJHr6qKzBmxlR2PG269xf3rQYDdlNXqpJ/MR4ocp3brXrLP+ EDMwFIEO0C0bogMzoGJ8WEO+9B9AaRhVFi1i4NlBrZ+IVIHFeDBkOa6aLRzJywsyb/FZ n266N8bzH4jd4oXWdvmc+H+umVQatnRc8uug/bVXwvGrlPr4Y9z0KeVAw5xk4pGNU77Y uukw== 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:ironport-sdr:ironport-sdr; bh=TUzXgImMA+q/TnhmlRS2Tuw7Xarrzd791lzcgx4bWm0=; b=HmQtgRw29fLLecsWLb90OhNOgqxQsf4Mi4sFx6JqrtS4TsPnqpK98akAxwQUolgn0Y C8JW2ilJX89pxCmJZ2Hrmt6b2J8KUDUp7M34vaK2MsOqS0DRCz3mSHGv0MOiwT9q03uE ggKndvqYsDOX6NysJVzgjSUdmT+e3rU5RianHG42xo8PyU1tkWLe/xPCYkCabPSW2UU3 To/V7nX5Tok7XEszX1mi9WFHmQxtrIbZP/qBQV+V03637C5zbI63ZtaVD/hnsacc584c Kqr8Tj3ghY5MJNwRm2CJXqIoBYIMtKv8Pt9cMeTyEdioszzNwisaqjy8oBcSRcQYCHl6 nYUw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q23si7695241edb.184.2020.11.17.13.51.55; Tue, 17 Nov 2020 13:52:18 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728184AbgKQVt7 (ORCPT + 99 others); Tue, 17 Nov 2020 16:49:59 -0500 Received: from mga09.intel.com ([134.134.136.24]:13199 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbgKQVt7 (ORCPT ); Tue, 17 Nov 2020 16:49:59 -0500 IronPort-SDR: HkV4DXCwNGLeYbS1lFtBk+kf4yNqabEDRRU8qeHni02Zxs+aDer54qRbBdQ9QWJzmNdLdD6kq6 4FonDhL62O7w== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="171188739" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="171188739" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 13:49:58 -0800 IronPort-SDR: MUd20WUGZZeJjp6AuhQpcd3n/IobUluRO429CzN5vARY7hVDAGJbFVnFP7PVyQJ244X9Cgx27A n94xsVh9qW3w== X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="430599755" Received: from rchatre-mobl3.amr.corp.intel.com (HELO [10.212.24.101]) ([10.212.24.101]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 13:49:57 -0800 Subject: Re: [PATCH 05/24] x86/resctrl: Pass the schema in resdir's private pointer To: James Morse , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , shameerali.kolothum.thodi@huawei.com, Jamie Iles , D Scott Phillips OS References: <20201030161120.227225-1-james.morse@arm.com> <20201030161120.227225-6-james.morse@arm.com> From: Reinette Chatre Message-ID: Date: Tue, 17 Nov 2020 13:49:56 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: <20201030161120.227225-6-james.morse@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, It is not clear what "resdir" mentioned in subject line refers to. Could it be changed to "info dir"? On 10/30/2020 9:11 AM, James Morse wrote: > Moving properties that resctrl exposes to user-space into the core > 'fs' code, (e.g. the name of the schema), means some of the functions > that back the filesystem need the schema struct, but currently take the > resource. I think a simple addition would help to parse the above ... " ... need the schema struct (to where the properties are moved), ..." > > Once the CDP resources are merged, the resource doesn't reflect the > right level of information. > > For the info dirs that represent a control, the information needed > is in the schema, as this is how the resource is being used. For the > monitors, its the resource as L3CODE_MON doesn't make sense, and would > monitor data too. > > This difference means the type of the private pointers varies > between control and monitor info dirs. > > If the flags are RF_MON_INFO, its a struct rdt_resource. If the > flags are RF_CTRL_INFO, its a struct resctrl_schema. Nothing in > res_common_files[] has both flags. > > Signed-off-by: James Morse > > --- > Fake schema for monitors may simplify this if anyone thinks that is > preferable. > --- > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 37 +++++++++++++++++--------- > 1 file changed, 24 insertions(+), 13 deletions(-) > > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index f79a5e548138..cb16454a6b0e 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c ... > @@ -1794,6 +1803,7 @@ static int rdtgroup_mkdir_info_resdir(struct rdt_resource *r, char *name, > > static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn) > { > + struct resctrl_schema *s; > struct rdt_resource *r; > unsigned long fflags; > char name[32]; > @@ -1809,9 +1819,10 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn) > if (ret) > goto out_destroy; > > - for_each_alloc_enabled_rdt_resource(r) { > + list_for_each_entry(s, &resctrl_all_schema, list) { > + r = s->res; > fflags = r->fflags | RF_CTRL_INFO; > - ret = rdtgroup_mkdir_info_resdir(r, r->name, fflags); > + ret = rdtgroup_mkdir_info_resdir(s, r->name, fflags); > if (ret) > goto out_destroy; > } > I think it would be helpful to add a comment here to compensate for the symmetry that is removed ("for_each_alloc_enabled_rdt_resource()" followed by a "for_each_mon_enabled_rdt_resource()"). Reinette