Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1032883rdb; Tue, 19 Sep 2023 19:12:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdoyjFL7vIHrWl1b4Hw7TFAsq3jNooMVoePHXefUb89zllWuAB3jqfAeow/esMjk4kvsO+ X-Received: by 2002:a05:6a00:190c:b0:68f:e9ce:92a5 with SMTP id y12-20020a056a00190c00b0068fe9ce92a5mr1357637pfi.4.1695175931187; Tue, 19 Sep 2023 19:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695175931; cv=none; d=google.com; s=arc-20160816; b=iz0QNhhRAY6hwqlx3bMLQ46OLp5MpdFfGFlbY0IwG5IChhXkgQkKJRMARALIrSdwvs wCcs1f9bPvTkIXEAgfqX36cs30OqXPWkwk/fHi3nnPmKmpQVpzK7oC+W78zub8encSjF 7y6TlRy5PPrs8GKz08ub7j081+s7ib2NB8fPievmNb+og6vnO+4DgwAoeKwqiN8gEx99 tNivodX12ugyy0hX5aVQnWZZSfWcC45NCi3Uu7/vaCGUDrEdr+Mkd3TGQSyNOMQ9jOwz 0lsxAzAuVEVGFX57OMMA+sBCLtFy66AIbBOwMGKOrHv1DOn0w2C1FGZnRh17KQ5GNsMa HMeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jYQ5NGbJ3f4lxHyFf2d8JCFAgp3oPgsaL6qi0Fij9xg=; fh=PUbzTyHTDtPe3rlvBjqE1ezdgCPUqwew4eM10w6SAYk=; b=jhqF8N/QeeDJrxerxXbBC2bMIigvYB7H2f1DGW0AZYIcNpgq8wSoXVa3T5sciuIhdZ nYOrcgMBGuxz3ft9VZJXMCR7e+bZeKvdOmf0eoasicF+1Z4H4wRqBVpxyqCyjCn4OecU 5uzDQnDtGRHoob3Gh6ImXLma+lNJLRUQMXkXJv478TfDMK7kIYlzc+07Hq9HsSJZmXkq pARo/7aEEVJX5Tm2ls8T/+JMCieM164cPlNiHBhyDsVOUXzS4PzKyRy1IgYDVTLQ0U32 W93/h+/zUautAGXZ8LobXsbTJlrl75OYjIO7htR92B083oMwJHmXAIOSEEvL1vXIaZKK js9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NsHoLw+k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h1-20020a636c01000000b00578666614f1si5766471pgc.63.2023.09.19.19.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 19:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NsHoLw+k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E67FE826E742; Tue, 19 Sep 2023 09:40:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230272AbjISQkX (ORCPT + 99 others); Tue, 19 Sep 2023 12:40:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbjISQkW (ORCPT ); Tue, 19 Sep 2023 12:40:22 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55593D6 for ; Tue, 19 Sep 2023 09:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695141616; x=1726677616; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=lfY3ihQpe+vp9W/f3sSqFtV8Kqn3MUI0fOpKr/I5CB0=; b=NsHoLw+k1G9vGSm7flNHFr4gsJJr90kDm00sRa+dAjH0XO5aFO805sPN sPdcaXuz4AULlJsGei+TvS2Ur011AsmomSzvbZyPeR6jGdf0iYwctBmEx HeMHubSM8FeqI9Vzg+bYq6pGyyMB3mSP0po3ke7f9cnLxg1KHFTy5HsmS b4AzUDRglcWd4da06Zbfz/lxO9thFj+GfQn4vmhG+6dVjssLVsuDZfbCd EVg3K4jPocg/Fma5G9Mgb8w8U3tzIcdl45YRaJfAVnOXOFXB8KoURfzyW JiiVi7uUCltGc6KxqpZb9nppAVDbg/+Hrypxzs6XQM9x0hDWQ8BHKDw1i w==; X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="370306686" X-IronPort-AV: E=Sophos;i="6.02,160,1688454000"; d="scan'208";a="370306686" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 09:40:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="993236303" X-IronPort-AV: E=Sophos;i="6.02,160,1688454000"; d="scan'208";a="993236303" Received: from agluck-desk3.sc.intel.com (HELO agluck-desk3) ([172.25.222.74]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 09:40:15 -0700 Date: Tue, 19 Sep 2023 09:40:13 -0700 From: Tony Luck To: Peter Newman Cc: Reinette Chatre , "james.morse@arm.com" , Babu Moger , Amit Singh Tomar , "Yu, Fenghua" , George Cherian , "robh@kernel.org" , Drew Fustini , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: resctrl2 - status Message-ID: References: <9742f177-a0ce-c5d3-5d92-90dda32f5d07@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 19 Sep 2023 09:40:23 -0700 (PDT) On Tue, Sep 19, 2023 at 02:53:07PM +0200, Peter Newman wrote: > Hi Tony, > > On Wed, Sep 6, 2023 at 8:21 PM Tony Luck wrote: > > I've just pushed an updated set of patches to: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git resctrl_v65 > > I'm trying to understand the purpose of the resctrl_resource struct > defined here: > > https://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git/tree/include/linux/resctrl.h?h=resctrl2_v65#n356 > > >From the common fields, it seems to be something with a name and some > info files that can be divided into domains and should be told when > CPUs are hotplugged. (I skipped the scope field because I couldn't > find any references outside fs/resctrl2/arch). The remaining fields > are explicitly disjoint depending on whether we're talking about > monitoring or allocation. > > >From this I don't get a strong sense that a "resource" is really a > thing and I think James's resctrl_schema struct only for the purpose > of resource allocation was more the right direction for common code. > Outwardly, resctrl groups seem to be the only thing relating > monitoring to allocation. > Peter, It's a good question. I started out with separate control_resource and monitor_resource structures, but combined them early on when it was looking like the overall size wasn't all that big (for a structure that will only have a dozen or so instances) and there were a bunch of common fields. It would be easy to separate them again if consensus is that is cleaner. There are only two places (currently) where code walks resources of all types (mount and unmount). So no big hassle to replace those with separate for_each_control_resource() and for_each_monitor_resource() > I skipped the scope field ... The scope field is for the module to tell the core code the granularity of the control/monitor resource so it can build a custom domain list based on L2 cache scope, L3 cache scope, NUMA ndoe scope, core scope, or anything else that h/w folks dream up. This means only the common code needs to register a CPU hotplug notifier. Note that there is no sharing of domains between modules to allow each module to be fully independent of any other module. This also means that the domain structure can have a common header, with some module specific data allocated directly after ... though the need for that might be going away as I implement James suggestion to keep the common schemata parsing in the generic code. > Is there a good reason for the common code to understand relationships > between monitors and schemas with the same name? If not, I think it > would make more sense to register monitors and control schemata > independently. I'm going back through my code now, breaking it into a patch series that builds a piece at a time. One of many things to become clear as I work through this is that the ".name" field in the resource isn't really useful. It may disappear to be replaced more specific fields based on usage. There's already one for the name of the "info/" directory for the resource. I'm adding a "schemata_name" for control resources. When I get to the monitor section I'll likley add a field that gets used to construct the names of directories under the "mon_data/" directories instead of using ".name". Doing that would remove any apparent relationship between monitors and schemas. There's no reason on X86 for them to be connected. -Tony