From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6656EE49A6 for ; Fri, 25 Aug 2023 20:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JmitNa19je+JnICO7jyDfS/oJveq58LxckZC/AzmBVk=; b=O7O6EMiywp8Er+ aqMVBm5jlu8vYwZ1Q6PgOmDRZ5M269+yBpWDyCn0PF7huugkhGAnMVVfMpHDqeMdpWMjLEdNJFYOB mJG2iN9vxGsDxZYJ02E3BMdZsIiDrIzbotE20LxEg9lnU8jbSbwQrYx4matg3AQFrOSi40Cl0cAV8 TH2v2t5vIsSWidlJBBc9RxaEYcFo3O4fdWPuVBLQCMxU4wy5T2Ka/6tvvcHxCQ6kduHOyjgWyeBS9 DjbplB0lH0+UfLeC/LAJOM2tikQ/XGlkrj1imqCM5VmCSic+G1g/ots2WiqLNQ9JJqlE/4ujGIIqT 5qx1VqcbOwG3ddbPrSpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qZdp4-0061Ce-0B; Fri, 25 Aug 2023 20:54:26 +0000 Received: from mgamail.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qZdp0-0061CE-1c for linux-arm-kernel@lists.infradead.org; Fri, 25 Aug 2023 20:54:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692996862; x=1724532862; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3C7JvGr4AJR6/16bCgkeVe12h0cpNID5Jz9uoMUPXLQ=; b=GvXYXOh9S+1APYDs3GnVwIwCOgI5UDUtQJS5oN5Ih8oNYRdlnsdl7uBu HI8YulnoXcdMXDh4UKbcxqioViBIP51MXyzbEmL6+1mXvuvUhAQGOEtu4 IehVqTkdYMy7Uga6tvuZiGDGy2rPvaMWi8p5zebhjPtab/1L89iy3YdjW zaE8/64gYw+4a/Xiqjkgt1KekftndLdjFwnKaMKwsaOlo+18k7PrAksp2 WfFJjnQvaKcIfoYFx+U7ijfeCeAMnAbI1WsuNXpBzpNFxUtCh2B2ryH/g 8W5ObEz4Wks6AKUrPticiRMu6y2QwNY5Xwpi/2KWXI4o9WcwP7rzO5p/z w==; X-IronPort-AV: E=McAfee;i="6600,9927,10813"; a="378582407" X-IronPort-AV: E=Sophos;i="6.02,201,1688454000"; d="scan'208";a="378582407" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2023 13:54:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10813"; a="911398812" X-IronPort-AV: E=Sophos;i="6.02,202,1688454000"; d="scan'208";a="911398812" Received: from agluck-desk3.sc.intel.com (HELO agluck-desk3) ([172.25.222.74]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2023 13:54:18 -0700 Date: Fri, 25 Aug 2023 13:54:17 -0700 From: Tony Luck To: Reinette Chatre Cc: Amit Singh Tomar , "Yu, Fenghua" , "james.morse@arm.com" , George Cherian , "robh@kernel.org" , "peternewman@google.com" , Drew Fustini , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: resctrl2 - status Message-ID: References: <35f05064-a412-ad29-5352-277fb147bbc4@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230825_135422_584948_2DFF38F4 X-CRM114-Status: GOOD ( 45.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 25, 2023 at 01:20:22PM -0700, Reinette Chatre wrote: > Hi Tony, > > On 8/25/2023 12:44 PM, Luck, Tony wrote: > >>>> Alternatively, can user space just take a "load all resctrl modules > >>>> and see what sticks" (even modules of different architectures since > >>>> a user space may want to be generic) approach? > >>> > >>> This mostly works. Except for the cases where different modules access > >>> the same underlying hardware, so can't be loaded together. > >>> > >>> Examples: > >>> > >>> rdt_l3_cat vs. rdt_l3_cdp - user needs to decide whether they want CDP or not. > >>> But this is already true ... they have to decide whether to pass the "-o cdp" option > >>> to mount. > >>> > >>> rdt_l3_mba vs. rdt_l3_mba_MBps - does the user want to control memory bandwidth > >>> with percentages, or with MB/sec values. Again the user already has to make this > >>> decision when choosing mount options. > >>> > >>> > >>> Maybe the "What resctrl options does this machine support?" question would be > >>> best answered with a small utility? > >> > >> A user space utility or a kernel provided utility? If it is a user space utility > >> I think it would end up needing to duplicate what the kernel is required to do > >> to know if a particular feature is supported. It seems appropriate that this > >> could be a kernel utility that can share this existing information with user > >> space. resctrl already supports the interface for this via /sys/fs/resctrl/info. > > > > I was imagining a user space utility. Even though /proc/cpuinfo doesn't show > > all features, a utility has access to all the CPUID leaves that contain the > > details of each feature enumeration. > > For x86 that may work (in some scenarios, see later) for now but as I understand > Arm would need a different solution where I believe the information is obtained > via ACPI. I think it is unnecessary to require user space to have parsers for > CPUID and ACPI if that same information needs to be parsed by the kernel and > there already exists an interface with which the information is communicated > from kernel to user space. Also, just because information CPUID shows a feature > is supported by the hardware does not mean that the kernel has support for that > feature. This could be because of a feature mismatch between user space and > kernel, or even some features disabled for use via the, for example "rdt=!l3cat", > kernel parameter. Agreed this is complex, and my initial resctrl2 proposal lacks functionality in this area. > >> fyi ... as with previous attempts to discuss this work I find it difficult > >> to discuss this work when you are selective about what you want to discuss/answer > >> and just wipe the rest. Through this I understand that I am not your target > >> audience. > > > > Not my intent. I value your input highly. I'm maybe too avid a follower of the > > "trim your replies" school of e-mail etiquette. I thought I'd covered the gist > > of your message. > > > > I'll try to be more thorough in responding in the future. > > Two items from my previous email remain open: > > First, why does making the code modular require everything to be loadable > modules? > I think that it is great that the code is modular. Ideally it will help to > support the other architectures. As you explain this modular design also > has the benefit that "modules" can be loaded and unloaded after resctrl mount. > Considering your example of MBA and MBA_MBps support ... if I understand > correctly with code being modular it enables changes from one to the other > after resctrl mount. User can start with MBA and then switch to MBA_MBps > without needing to unmount resctrl. What I do not understand is why does > the code being modular require everything to be modules? Why, for example, > could a user not interact with a resctrl file that enables the user to make > this switch from, for example, MBA to MBA_MBps? With this the existing > interfaces can remain to be respected, the existing mount parameters need > to remain anyway, while enabling future "more modular" usages. Lots of advantages to modules: 1) Only load what you need. - saves memory - reduces potential attack surface - may avoid periodic timers (e.g. for MBM overflow and for LLC occupancy "limbo" mode). 2) If there is a security fix, can be deployed without a reboot. 3) Isolation between different features. - Makes development and testing simpler Sure some things like switching MBA to MBA_MBps mode by writing to a control file are theoretically possible. But they would be far more complex implementations with many possible oppurtunities for bugs. I think Vikas made a good choice to make this a mount option rather than selectable at run time. > Second, copied from my previous email, what is the plan to deal with current > users that just mount resctrl and expect to learn from it what features are > supported? Do such users exist? Resctrl is a sophisticated system management tool. I'd expect system administrators deploying it are well aware of the capabilities of the different types of systems in their data center. But if I'm wrong, then I have to go back to figure out a way to expose this information in a better way than randomly running "modprobe" to see what sticks. -Tony _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel