Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp429323rdf; Fri, 3 Nov 2023 05:12:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiiPCcz6+EfkH6hgUw/ZeFueiWM4p2GlkHmSrFNF4DibORfrsD7kmm+0wqGLWdmOf0dWJy X-Received: by 2002:a17:902:e40a:b0:1cc:3c2d:1289 with SMTP id m10-20020a170902e40a00b001cc3c2d1289mr12096096ple.3.1699013564817; Fri, 03 Nov 2023 05:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699013564; cv=none; d=google.com; s=arc-20160816; b=BGPHK7qH7JMWXRGNK/LwR8RTl7fE/OW58Uv2uHADT3T9qJBdBfqJAWDMEjSHaGuRxZ fVfyYrhrTDbRYtlRQ83x6UiYWhgPS4osC3aLsz1gV1M5wX7Jpj03QMWLNCFypFs52Acf TssTG3Y8INpFognvwZM6k9hNFAQ4eQMv9JaXwKd9zT1roRCgrcyYYGehGo6hUunct5+e /eOJxPwo8CBLRzLgF6OxO6e+3t8obLjjY8ScC09QdxB9Xh1IpPl8xXg9AMrjg6OWa3di GJ7wq1gIeU7fLsgGSVYTxROlf28ytIlDcJ0/vuIKAcsGlMJDh4Auan0LOvpc4EW0/NRz ofiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=N1cFMFJ9FBMLm4r3Q0z89IeTnkSrZnkGOv4rEXaip9U=; fh=XHJC3rNtFqy9NBdwfesynq0dG98cBzq8Qrv2Usg7GS0=; b=WR6kyaVUWEnuKDr2hsFZYL39XoP72jUfDY5l6UBCzlUnfoHp1aNfK9EL6ofy9tXd5E cRHEntdHRzdQmZWgZx1Meqv9ztaIoJN84fG6KntdBoAGnQdW8+w2uRe2FdCtfvmXDNzz B4YxvCbaZsG1yPticfhVUo/HQA72zsLAAN8MUfXrEtFR5H/5/UNmQtqzGd3mzAWKisVs Nj29Su2EIgxee9XO/inou3h+WbgiLVUVouqQPc/2mMqCHRpYmDioZXSGM4Oexg+xksQT r+vq7sbwldQCd3Me+avha2NtkkLGVXXjibPqZriyCjzdZE9B8G0RYjdD6ZDKyAazTK5J lrKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Nya2q8m6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id r17-20020a170902c7d100b001cc2c4fdbecsi1322999pla.649.2023.11.03.05.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 05:12:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Nya2q8m6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 925408297684; Fri, 3 Nov 2023 05:12:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346709AbjKCMKE (ORCPT + 99 others); Fri, 3 Nov 2023 08:10:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346673AbjKCMKC (ORCPT ); Fri, 3 Nov 2023 08:10:02 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D74C5A2; Fri, 3 Nov 2023 05:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699013396; x=1730549396; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=ZyAO1NfYqvuM2pcUqTrAtWeSTSyLXfDA+sye3MrCqIk=; b=Nya2q8m6VseUzuM38zhzMU7HtaRKpetlbsUDVKlwcTJFX+/PVxKuEZVn S/IloHECatZD7eiJY6vnkHek006d5BgDAJ/DAjgFOX6BnH5GPlWLcwVI9 /65YVHt7gSiWRqYy3Zph0BfOVJBcuyyVVpDeSz9MzOtgLRS12CX3y9/dm +r27E8eruKMd0Vu39j9Wh+15Ets1Dn60okkU5f7L+DziItsf2pLah5NT9 wIAghL4I6M4b8Oc+M/0TrCnfONv88DCYaUw+2VFzJwZ4K+Xtn04+zUBNJ +eBpqn3tqehwL1VR8l4piB3mqsqaYMwFisi++VTJoGGMN2NWzFZDMR3zn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="388761204" X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="388761204" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 05:09:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="761597682" X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="761597682" Received: from pors-mobl3.ger.corp.intel.com ([10.252.35.38]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 05:09:53 -0700 Date: Fri, 3 Nov 2023 14:09:50 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Reinette Chatre cc: linux-kselftest@vger.kernel.org, Shuah Khan , Shaopeng Tan , =?ISO-8859-15?Q?Maciej_Wiecz=F3r-Retman?= , Fenghua Yu , LKML Subject: Re: [PATCH 03/24] selftests/resctrl: Refactor get_cbm_mask() In-Reply-To: <575b4c53-34c4-48ed-906d-b9dedb80e0ef@intel.com> Message-ID: <964f1078-7e36-7e39-9bbe-687d5b2458de@linux.intel.com> References: <20231024092634.7122-1-ilpo.jarvinen@linux.intel.com> <20231024092634.7122-4-ilpo.jarvinen@linux.intel.com> <575b4c53-34c4-48ed-906d-b9dedb80e0ef@intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1072741397-1699013395=:1725" X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 05:12:41 -0700 (PDT) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1072741397-1699013395=:1725 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Thu, 2 Nov 2023, Reinette Chatre wrote: > On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > > > @@ -229,6 +228,31 @@ int get_cbm_mask(char *cache_type, char *cbm_mask) > > return 0; > > } > > > > +/* > > + * get_cbm_mask - Get cbm bit mask > > I know you just copied code here but please keep an eye out for acronyms > to be written in caps. Yeah, Maciej also commented on this. I've already made some changes but I'll incorporate some of your suggestions too. > This needs not be named to reflect verbatim what the function does. > Looking ahead I wonder if "get_full_mask()/get_max_mask()" may not be a > clear indication of what this does? > > Something like: > get_full_mask()/get_max_mask() Get maximum Cache Bit Mask (CBM) Having max in the name sounds useful. Also related to this, the local variables called long_mask should be renamed but perhaps not in this series to not block Maciej's work with neverending stream of cleanups :-). > @cache_type: Cache level(? or should this be "type") as "L2" or L3". > @mask: Full/Maximum portion of cache available for > allocation represented by bit mask > returned as unsigned long. > > > > + * @cache_type: Cache level L2/L3 > > + * @mask: cbm_mask returned as unsigned long > > + * > > + * Return: = 0 on success, < 0 on failure. > > + */ > > +int get_cbm_mask(const char *cache_type, unsigned long *mask) > > +{ > > + char cbm_mask_path[1024]; > > + int ret; > > + > > + if (!cache_type) > > + return -1; > > Just to confirm ... error checking on mask is intentionally deferred > until get_bit_mask()? I tried to put as much as possible into get_bit_mask() since every caller will have to do the same things anyway. I cannot avoid checking cache_type here because snprintf() is using it. Once again, very superb review of the whole series, thank you very much for all the effort! It's really appreciated! -- i. --8323329-1072741397-1699013395=:1725--