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 76B05C4332F for ; Wed, 13 Dec 2023 18:05:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378959AbjLMSFO (ORCPT ); Wed, 13 Dec 2023 13:05:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235091AbjLMSFJ (ORCPT ); Wed, 13 Dec 2023 13:05:09 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D4CC8F3 for ; Wed, 13 Dec 2023 10:05:15 -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 66C35C15; Wed, 13 Dec 2023 10:06:01 -0800 (PST) Received: from [10.1.197.60] (eglon.cambridge.arm.com [10.1.197.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CACCA3F762; Wed, 13 Dec 2023 10:05:12 -0800 (PST) Message-ID: <384a9be4-8123-3b3a-3be7-c549c8126fc8@arm.com> Date: Wed, 13 Dec 2023 18:05:06 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v7 09/24] x86/resctrl: Use __set_bit()/__clear_bit() instead of open coding Content-Language: en-GB To: Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , 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 References: <20231025180345.28061-1-james.morse@arm.com> <20231025180345.28061-10-james.morse@arm.com> <7b6ae291-b1df-4a4a-a415-da1eaeed6775@intel.com> From: James Morse In-Reply-To: <7b6ae291-b1df-4a4a-a415-da1eaeed6775@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Reinette, On 09/11/2023 17:44, Reinette Chatre wrote: > On 10/25/2023 11:03 AM, James Morse wrote: >> The resctrl CLOSID allocator uses a single 32bit word to track which >> CLOSID are free. The setting and clearing of bits is open coded. >> >> A subsequent patch adds closid_allocated(), which adds more open > > (Note use of "A subsequent patch ") Yup, I've dropped this paragraph. >> coded bitmaps operations. These will eventually need changing to use >> the bitops helpers so that a CLOSID bitmap of the correct size can be >> allocated dynamically. >> >> Convert the existing open coded bit manipulations of closid_free_map >> to use __set_bit() and friends. These don't need to be atomic as this >> list is protected by the mutex. >> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> index 9864cb49d58c..f6051a3e7262 100644 >> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> @@ -131,7 +131,7 @@ static void closid_init(void) >> closid_free_map = BIT_MASK(rdt_min_closid) - 1; >> >> /* CLOSID 0 is always reserved for the default group */ > > Seems appropriate for the comment to be updated to the new define also. Sure, > With that addressed you can add: > Reviewed-by: Reinette Chatre Thanks! James