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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE824C433FE for ; Thu, 24 Nov 2022 14:22:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbiKXOWT (ORCPT ); Thu, 24 Nov 2022 09:22:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbiKXOWN (ORCPT ); Thu, 24 Nov 2022 09:22:13 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7325EBC8B for ; Thu, 24 Nov 2022 06:22:11 -0800 (PST) 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 B31A223A; Thu, 24 Nov 2022 06:22:17 -0800 (PST) Received: from [10.1.197.38] (eglon.cambridge.arm.com [10.1.197.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DD3D23F73B; Thu, 24 Nov 2022 06:22:08 -0800 (PST) Message-ID: <39cb8e29-2c04-a316-73d4-2878e98c3625@arm.com> Date: Thu, 24 Nov 2022 14:22:00 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH 14/18] x86/resctrl: Add helpers for system wide mon/alloc capable Content-Language: en-GB To: "Shaopeng Tan (Fujitsu)" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , "shameerali.kolothum.thodi@huawei.com" , D Scott Phillips OS , "carl@os.amperecomputing.com" , "lcherian@marvell.com" , "bobo.shaobowang@huawei.com" , Jamie Iles , Xin Hao , "xingxin.hx@openanolis.org" , "baolin.wang@linux.alibaba.com" , "peternewman@google.com" References: <20221021131204.5581-1-james.morse@arm.com> <20221021131204.5581-15-james.morse@arm.com> From: James Morse In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 10/11/2022 10:51, Shaopeng Tan (Fujitsu) wrote: >> resctrl reads rdt_alloc_capable or rdt_mon_capable to determine whether any >> of the resources support the corresponding features. >> resctrl also uses the static-keys that affect the architecture's context-switch >> code to determine the same thing. >> >> This forces another architecture to have the same static-keys. >> >> As the static-key is enabled based on the capable flag, and none of the >> filesystem uses of these are in the scheduler path, move the capable flags >> behind helpers, and use these in the filesystem code instead of the static-key. >> >> After this change, only the architecture code manages and uses the static-keys >> to ensure __resctrl_sched_in() does not need runtime checks. >> >> This avoids multiple architectures having to define the same static-keys. > arch/x86/kernel/cpu/resctrl/rdtgroup.c > static void mkdir_rdt_prepare_rmid_free(struct rdtgroup *rgrp) > { > if (rdt_mon_capable) > free_rmid(rgrp->closid, rgrp->mon.rmid); > } > I think you forgot to fix rdt_mon_capable here. > if (rdt_mon_capable) => if (resctrl_arch_mon_capable()) Yes - looks like I did. Thanks! James