Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp447282lqg; Thu, 11 Apr 2024 07:43:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbE8ihWQXfPb2fA06q0SRA5B5+gW7Ic/Mg/BgzRfJZAVacYP++s1+OfWZ04lN33DhJvJFNXrPwFG0j5vWAapMADg6pkHNFs8vuO2rPfg== X-Google-Smtp-Source: AGHT+IFR2JYlS+QaHkOcMG6AdbGjMrLKephkVKeK++2fierFG+gdoWQFtsY9ozHdT8RjuRZ3U2hd X-Received: by 2002:a17:90b:1e42:b0:2a2:b411:81ae with SMTP id pi2-20020a17090b1e4200b002a2b41181aemr5538155pjb.4.1712846584462; Thu, 11 Apr 2024 07:43:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712846584; cv=pass; d=google.com; s=arc-20160816; b=aM8SHU3B51TQKeUz2SXiiDBiZh8E3Is1n4F4JHKiLcW8rTGtA1qtWqaEmS66G493Nq Xcoq5MH54KVDI2MVAAKp/rA9x3LURZQswPSapA/BfwFBvHUACipZarJMiRqSn2ZDURVw cdkDnVW/3tn4asgycsmVDp79/HHRGQz1nI0ACENpDNhhz82axckotKjp/QAKPwovfkSZ egIkTbjQb7VZxvCJMyvqWPG5fSQI2YXm1P8TaIDRlUOLpdXv3AQwJtw+s4mWF0fLf9zP vn2sfsmgmq0K3JDrl0KD5Y1WvH00+jP/lnqTXsDIY/QdAKj64KqiOYin/330wzWBcGA7 KfOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=5S2siOUQcpk7QxP/dLBi+s85N4+XDhfhVV//Cot3IaQ=; fh=16RTrL4O4dV4wsANasVwHAMOabshasPr7EDWXC+LxOs=; b=zOvsJcPL1hnBFURmQ1MDDshZ2/ZRWYUBN6b9lAPCdi/u3nk9R3sCZl7NPI+ZYIDRiT c53xn/qnQGt+tZTc3UzFnImNuKhHzOpW5OeAvutHvqLmNdcaaVWEJD2u07we+vFoQ6mk 5EN5JsvK4G3YUlYZ3fQtyN3s8SGLjDhEUWmtGGchIhrLqZZPC80z9Ftm+Ir+w3MNvY1a EOfEde1HrhcU7lGDBzRuTekRGosSdyHfLsHv1i1ijvCOQJb0w7X85gNaWHqol2MTUGQ4 8g8yswReI/PJEGrKI8dZKSYL2RVw9/UbtPycxg7pn5ecAbk8w00OHQkrVjaRFymDamn+ FbYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-140608-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e16-20020a17090ac21000b002a5ffe8552csi2279882pjt.150.2024.04.11.07.43.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 07:43:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140608-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-140608-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C4AF8B283C8 for ; Thu, 11 Apr 2024 14:13:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85FB114E2EF; Thu, 11 Apr 2024 14:13:44 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6701622096 for ; Thu, 11 Apr 2024 14:13:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712844824; cv=none; b=EGbYYEj/N2CT3YjqE7J34FNzvgCZAFqag8wWLvkYKcFZeXR9X9r+B2MVC1l7O/+NurNZw3+MvDJUtCAeZB3So6lL8M/lyaN4ZyPepXzxoh5qGglr3ji9TmO+zAsZiOkITcBwsXich9lEX903JPcljgdp+1IZIsjRhKoIaTiUHv8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712844824; c=relaxed/simple; bh=qbLoWnPAg+jsjrOorXMatRQj/0BRkniRfTdxAUDR7s0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=U5nAP5Lso2QqBqBiafNUXa1zHqRXdbyQdtE85xQnyEzGzQRAvMUj4tuCUoNEuMGls9co1wryM8Rq9lYZmyNtys7qhXrhVWZvG+yCJZOsQg2G+8sjwNR8ZE/ZNYqn/8cemEH0X7Pd+OFxT5Pnh/DNgeOR2hN4eFexG1f5kBRQA9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 040F211FB; Thu, 11 Apr 2024 07:14:11 -0700 (PDT) Received: from e133380.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AB1EF3F64C; Thu, 11 Apr 2024 07:13:38 -0700 (PDT) Date: Thu, 11 Apr 2024 15:13:36 +0100 From: Dave Martin To: David Hildenbrand Cc: James Morse , x86@kernel.org, linux-kernel@vger.kernel.org, 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, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, Rex Nie Subject: Re: [PATCH v1 01/31] x86/resctrl: Fix allocation of cleanest CLOSID on platforms with no monitors Message-ID: References: <20240321165106.31602-1-james.morse@arm.com> <20240321165106.31602-2-james.morse@arm.com> <1e19965c-51f2-4f7a-8d29-e40f4e54a72c@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1e19965c-51f2-4f7a-8d29-e40f4e54a72c@redhat.com> On Tue, Apr 09, 2024 at 10:05:33AM +0200, David Hildenbrand wrote: > On 21.03.24 17:50, James Morse wrote: > > commit 6eac36bb9eb0 ("x86/resctrl: Allocate the cleanest CLOSID by > > searching closid_num_dirty_rmid") added a Kconfig option that causes > > resctrl to search for the CLOSID with the fewest dirty cache lines when > > creating a new control group. This depends on the values read from the > > llc_occupancy counters. [...] > It's weird to not see RESCTRL_RMID_DEPENDS_ON_CLOSID appear in any Kconfig file. > I guess it will all make sense once the refactoring is done :) Agreed; a stub Kconfig item could be added, but since the file layout and naming conventions change after this patch, doing this would probably just create noise in the series though. Looking at (yikes!), IS_ENABLED() is designed to do the right thing for non-existing Kconfigs... If nobody is too concerned about the temporarily dangling IS_ENABLED()s in this series, I won't propose any change here. > As Reinette comments, likely we want here: > > Fixes: 6eac36bb9eb0 ("x86/resctrl: Allocate the cleanest CLOSID by searching closid_num_dirty_rmid") Noted for James' attention. > > > Signed-off-by: James Morse > > --- > > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > index 011e17efb1a6..1767c1affa60 100644 > > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > @@ -149,7 +149,8 @@ static int closid_alloc(void) > > lockdep_assert_held(&rdtgroup_mutex); > > - if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) { > > + if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID) && > > + is_llc_occupancy_enabled()) { > > cleanest_closid = resctrl_find_cleanest_closid(); > > if (cleanest_closid < 0) > > return cleanest_closid; > > Reviewed-by: David Hildenbrand > > -- > Cheers, > > David / dhildenb Thanks; noted for James' attention. Cheers ---Dave