Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2809197rdb; Mon, 5 Feb 2024 20:17:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFoVj8h5BcYEhhjYWpd07XW8h+mpOVVYLaBxUHqMsb5ASwvUFYPS6z3n4zT/rRtcrD1tdtm X-Received: by 2002:a05:6a21:3981:b0:19e:99be:c53a with SMTP id ad1-20020a056a21398100b0019e99bec53amr674455pzc.4.1707193054716; Mon, 05 Feb 2024 20:17:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXUrqpEW/1zELrPhxP8fkhmmBirVjOdzgrHRYOsL29Icl4QGxja0Q48aKZjMn0MbmZ9AOU6SurOH5vekN3E+PXh0Hb00TBshHuBmI13Yg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id o136-20020a62cd8e000000b006e04639e9c2si932968pfg.330.2024.02.05.20.17.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 20:17:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54292-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; dkim=pass header.i=@intel.com header.s=Intel header.b=VmNr6Pnu; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-54292-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54292-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 089F5B220D9 for ; Tue, 6 Feb 2024 04:17:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19F54745EE; Tue, 6 Feb 2024 04:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VmNr6Pnu" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2983473188; Tue, 6 Feb 2024 04:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.7 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707193044; cv=fail; b=pni/bccaWuFMwp19Dhet9h7tjL8omd3OplUCFfMTpnnMys4I+hzIMemogZxeuD3iBhyk2TzMcDu4ZsRZ9uAjTp8Jg452I0S0LbA/nw/yAlI3iAdTJtBhc1pNCFKbFPkAU/w+nBJTWLyOGFSVea+q3iDpda4Fx+7vPa0khhpWWl0= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707193044; c=relaxed/simple; bh=16d1NejEJbLnDuLJcXNHl+UhZMI465N1e3JS1taQ6/k=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=UrxC5Ib/EQAWM1L4hlm4j5Iieo3o+v5TzMNGj3hFGO4ao5lmQhklN6I3p0oa9oLE0lhfy95ANxI4yYIAWuqbvIU/e+LVlWR1+UjPRdeDsdmGCfzq8H5L/Z3T+wwRaEOeBgL8w1SRKg3z2Ch9nej7yMx0rgfdbQJTYYs5mirpG+0= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VmNr6Pnu; arc=fail smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707193042; x=1738729042; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=16d1NejEJbLnDuLJcXNHl+UhZMI465N1e3JS1taQ6/k=; b=VmNr6PnuiyRxoQ5mQtoiW5T2it5dhqa7rBtEIJ2ZxtUVLERP3Ckg6N5Y bNumSj9ePCH+/gOMdEBfA4Gus8GNpzw/jCW0YfIceAADm6WspcFyhT/xZ iTwaT3bDwVse3o8AVX9o3p8vNUL8gY0A9zvhoJNK00uY5kZkN9H/PJuiV Gu5E9KWV0TiwtAeDvWpA2Cvk+fkh4U9rXljK131SLHfHJ2wBctbJgXqUu DBSXe5tSGEaBzGMYTUctv1uDCYO3o0kGzHAY2/6BzVs0Nf9lmgDPALAbx qIrRuA/wB2XzM2smLUyi8dV3+vVA3Ma7GLoVDARsEA/3P+t7gObjVwoGW w==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="26107066" X-IronPort-AV: E=Sophos;i="6.05,246,1701158400"; d="scan'208";a="26107066" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 20:17:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,246,1701158400"; d="scan'208";a="31717807" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Feb 2024 20:17:21 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 5 Feb 2024 20:17:21 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 5 Feb 2024 20:17:20 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 5 Feb 2024 20:17:20 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.40) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 5 Feb 2024 20:17:20 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F9LOmnfUluMnH6xnIMex1Zdce5zFLYiRjEl0r2Qz8iqrR3XQmimefLFG5wAnRty8v/VXY9s9QNEzYqZzZqm2VTuS38VcxdvaBaRm3jt4plutnVJGLNqR28bBVYRKZ1IkM6nAKgTqB1z5QyM/YjCSZlwD7lS1nO910Bl1Ls1m2qRF7kjVJ/QT/Yg2NIo8/RV/5OsmCZrK8C/+9+qniSeQ8CG3cP6ZxVBRYSg7JRK0qjQEHJK1SEjEElYbWXncRzJy4nqDm4ya9oqMkB90tuJdXJl5iiZbomtmfxf/d+4a+CqzEYQIVavME2YHwVhHleC3i4er05n5UURfMk/o2meoKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+buj99fWYmUg1XPnvBDmxn31OOF0KjD8U1RrCCaT7UY=; b=E+l5kd0vxktmQcAG3Oc53t6WjSAi86fG/v27Iez5kX1seHKAP2AU2sPFH3rQMrvBdtKnVF9cVRSsBzBv7b+7sihQ+vfjavOmjo3hTHQ8T17gNG0evs3uvbDGZ0lFVIfkEbiu+0zuOTwC08JuDbkJPQb8CpSy/8GWDbklWTqscMvso3Nd7OUMM8xI5DF8XsBU2jLI5blv4qIi8EKgnO3BCUIBoyBnyMu00DlfbV4Pzw87jrNxysXvDXLd/GmVhxEbs5rUap7Xp/GY6Ain1xaw56c3R551RJ3qB7hbUp8MfGMSc690dq6YhaQngPd4eugpyqJJnSuzqR9NgM11v3YA0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) by IA0PR11MB7956.namprd11.prod.outlook.com (2603:10b6:208:40b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36; Tue, 6 Feb 2024 04:17:19 +0000 Received: from SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::c903:6ee5:ed69:f4fa]) by SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::c903:6ee5:ed69:f4fa%7]) with mapi id 15.20.7249.032; Tue, 6 Feb 2024 04:17:19 +0000 Message-ID: Date: Mon, 5 Feb 2024 20:17:18 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 3/5] selftests/resctrl: Split validate_resctrl_feature_request() Content-Language: en-US To: Maciej Wieczor-Retman , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= CC: , , , LKML References: <65652533-8333-064a-c446-95232c7da76c@linux.intel.com> From: Reinette Chatre In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MW4PR03CA0008.namprd03.prod.outlook.com (2603:10b6:303:8f::13) To SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|IA0PR11MB7956:EE_ X-MS-Office365-Filtering-Correlation-Id: ee019db8-2d8b-48ce-27cf-08dc26ca8227 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3yw5CfYR4OG6xPEg8RrpaJsBE3EVOyYYUjQKyTMDelkc6Jk49i5xbH7CRRYagBGSwVn+35Uc48Cpd2GKK4MBzL520dvAFt10unQ1LCIYgpcEMeXk9CAJ2nZuJGPohqUPJbCPbrbnFwz+UYRup0ZhNNmtM9CiOYKkmLmxoNf5I1/GPvba4JL+0qHLjjF7CdNmeYFYiIfMJEbDs0pQQucmrelfFpENSj+On0BPAd+UyUpgfejAkOD07OuJ9s6/2ZDsnH4EfalVgamJBQKkYYNfVyYyA044klhJKDmAaf+kPfzt61hcc7imCUsEpBrNFlMPjHav6/TclTd+l+LCdE83fREWH7FPh5qz7qe6yx0Po2By80RIV5RcaJjVz7zhpUM9/JJm9Fs7BIN1YaOD/byShC2+xEpwXSNTxLPQSgUxZuokeA0nI9Tk3mw3QcHKlDGpd1XlIroPx7jZ70hSaaxiLxdJCRJC5+ZNAYYASgjotTaDecRkaq7B0FaeOCCIsDwZbtQU1bCXtTivjJ48QfhIaJ5ToJz+UDUawyCYs3TgIx1JmvGwy/jspRI54WrwdwydvYLXtBC2p3yXO5yIK9cvmYNQJiVvYlEJIsp2xa9ESOGPaY3PVY/W5kGlsI4ACaFm X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(39860400002)(136003)(396003)(366004)(230922051799003)(64100799003)(1800799012)(451199024)(186009)(41300700001)(53546011)(6506007)(6486002)(966005)(478600001)(66574015)(26005)(83380400001)(6512007)(2616005)(5660300002)(44832011)(15650500001)(2906002)(66946007)(66476007)(66556008)(110136005)(316002)(38100700002)(4326008)(8936002)(8676002)(82960400001)(31686004)(36756003)(31696002)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dldqd1YrL0loL0VJaTFPVGhONVo4b3Q0WC9HdGMvb2NiYmdzZUI5cW5pZVN1?= =?utf-8?B?dGFoby81MEhhM3g5QUVZejZpNlgzZDFFT0RJOUhoT2JkTUkyUVdzUXFCVStJ?= =?utf-8?B?NFlwaTkzZ2hpb0gvRzQ0Y09tcFlKQk1sb1Jjbkl1NGJyc1U0L2EyT0lHM1BI?= =?utf-8?B?TjgvZDdFWHdtMldCTy9pb0o2VTJnZzhXREF5SGdZbzAwQmNleC9NbzBiR0JV?= =?utf-8?B?eHNPOGN4bjZVZURCSkIwZnU1TUtSZTVMdGFkRy8xMTFPNFhIcWkyRkVnVzJG?= =?utf-8?B?bVg0em5BU0NDalFuZm1GRHZKMWdIRFlIOEZDQUhWaHVvTG9YUk5JNHlBK2Rl?= =?utf-8?B?cSs3RFZjbks5SlovaTNQNEsyK01SL0MvZ09UOW92bXNyS0VlYW5QT1NMZjRO?= =?utf-8?B?OTRYRWVuZlRpQ3pYU0xQOVpKaHU0a2dqU0d0OEtna2cvQlNhbTVUNEFvd2Fa?= =?utf-8?B?NGRwdlF5Unl1QjFNQUYxRzRt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-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2024 04:17:18.9514 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: riS4prenX9GTPS1rpT2QgYZkU9mCF44Dg1xKD4UgqAxHPp3mKdvO4PBu6+rL0tNyQxT56R1Q5jkLZ/J+AL8121GjW78jlIaKGCf2pc1g/O8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7956 X-OriginatorOrg: intel.com On 2/5/2024 5:24 AM, Maciej Wieczor-Retman wrote: > On 2024-02-05 at 14:41:30 +0200, Ilpo Järvinen wrote: >> On Mon, 5 Feb 2024, Maciej Wieczor-Retman wrote: >> >>> validate_resctrl_feature_request() is used to test both if a resource is >>> present in the info directory, and if a passed monitoring feature is >>> present in the mon_features file. >>> >>> Refactor validate_resctrl_feature_request() into two smaller functions >>> that each accomplish one check to give feature checking more >>> granularity: >>> - Resource directory presence in the /sys/fs/resctrl/info directory. >>> - Feature name presence in the /sys/fs/resctrl/info/L3_MON/mon_features >>> file. >>> >>> Signed-off-by: Maciej Wieczor-Retman >>> --- >>> Changelog v4: >>> - Roll back to using test_resource_feature_check() for CMT and MBA. >>> (Ilpo). >>> >>> Changelog v3: >>> - Move new function to a separate patch. (Reinette) >>> - Rewrite resctrl_mon_feature_exists() only for L3_MON. >>> >>> Changelog v2: >>> - Add this patch. >>> >>> tools/testing/selftests/resctrl/cmt_test.c | 2 +- >>> tools/testing/selftests/resctrl/mba_test.c | 2 +- >>> tools/testing/selftests/resctrl/mbm_test.c | 6 ++-- >>> tools/testing/selftests/resctrl/resctrl.h | 3 +- >>> tools/testing/selftests/resctrl/resctrlfs.c | 33 +++++++++++++-------- >>> 5 files changed, 28 insertions(+), 18 deletions(-) >>> >> >>> diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c >>> index dd5ca343c469..c1157917a814 100644 >>> --- a/tools/testing/selftests/resctrl/cmt_test.c >>> +++ b/tools/testing/selftests/resctrl/cmt_test.c >>> @@ -170,7 +170,7 @@ static int cmt_run_test(const struct resctrl_test *test, const struct user_param >>> static bool cmt_feature_check(const struct resctrl_test *test) >>> { >>> return test_resource_feature_check(test) && >>> - validate_resctrl_feature_request("L3_MON", "llc_occupancy"); >>> + resctrl_resource_exists("L3"); >> >> This not correctly transformed. > > Oops, sorry, I'll fix it for the next version. > >> >>> +/* >>> + * resctrl_mon_feature_exists - Check if requested monitoring L3_MON feature is valid. >>> + * @feature: Required monitor feature (in mon_features file). >>> + * >>> + * Return: True if the feature is supported, else false. >>> + */ >>> +bool resctrl_mon_feature_exists(const char *feature) >>> +{ >>> + char *res; >>> + FILE *inf; >>> + >>> if (!feature) >>> - return true; >>> + return false; >>> >>> - snprintf(res_path, sizeof(res_path), "%s/%s/mon_features", INFO_PATH, resource); >>> - inf = fopen(res_path, "r"); >>> + inf = fopen("/sys/fs/resctrl/info/L3_MON/mon_features", "r"); >> >> This became less generic? Could there be other MON resource besides L3 >> one? Perhaps there aren't today but why remove the ability give it as a >> parameter? This does make the function less generic but the benefit is that four copies of the same hardcoded parameter is no longer needed. In my opinion this patch thus makes the code cleaner but it is not a requirement that I will use to hold this series back. > During v2 discussion [1] Reinette made me realize this functionality only > interfaces with L3_MON/mon_features file and the 'resource' parameter isn't > needed. The 'mon_features' file is only mentioned for L3_MON and I don't know of > any plans for other MON resources so I assumed it doesn't need to be generic. > > But sure, I can make it use a parameter if Reinette doesn't mind. I prefer what is in this patch, but I will not object if the function is changed to take the resource as parameter. > > [1] https://lore.kernel.org/all/2o7adr2cos6qcikcu7oop4ss7vib2n6ue33djgfeds3v6gj53f@uu45lomrp5qv/ > Reinette