Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4176870rdh; Tue, 28 Nov 2023 14:11:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDCbHrzqysEhD4Y5Ayy65SSFifaBviQZo6Mp8/lkLBs7P5RLaYiUkkJTtNzHk7xwI+37bt X-Received: by 2002:a17:903:228a:b0:1cf:ad1a:60c3 with SMTP id b10-20020a170903228a00b001cfad1a60c3mr17663209plh.53.1701209465522; Tue, 28 Nov 2023 14:11:05 -0800 (PST) Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id jb1-20020a170903258100b001cfdfa28b70si3378975plb.469.2023.11.28.14.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 14:11:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=arQoQ6iC; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 8C9DD80ACCFE; Tue, 28 Nov 2023 14:11:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345414AbjK1WKr (ORCPT + 99 others); Tue, 28 Nov 2023 17:10:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbjK1WKp (ORCPT ); Tue, 28 Nov 2023 17:10:45 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD1A2D5B; Tue, 28 Nov 2023 14:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701209451; x=1732745451; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=vMivPnCxYxf38EMtMSJ5O1kBXrA1GPU3hPZKSFeL2Xw=; b=arQoQ6iC7aAmQpFPNGoVWszNyNieas9klGm+w1ZWw2iHdXzlIpmmfvT+ RFDU+edmpmYxKMEQscNNI0fR5jBRx5WLl8Jrhi9mwKahtqKTN/fg30cEw raudPG7AZLA3jroaMWyDz66fkMOn0Cbwh4oCsYJ4iBsHzwPLs8u3URWKQ ClVWqUb+HcQBvxGfb8N2xK3kO2PXDrq5c2PIhsqsePVVjobHpdV8KUOlf kyaOzx96OSitC8rt3jjL+qh4uC2pZV3aUwr1WsqkJf56vft3Ff9kXEtrz 6kGGgLoUyQCu0LERVX4uxpXN8AWu7ZkAWAr+VpTfH+C3SM4szbABKPX0l w==; X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="459542717" X-IronPort-AV: E=Sophos;i="6.04,234,1695711600"; d="scan'208";a="459542717" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2023 14:10:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="768680146" X-IronPort-AV: E=Sophos;i="6.04,234,1695711600"; d="scan'208";a="768680146" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 28 Nov 2023 14:10:37 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 28 Nov 2023 14:10:36 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 28 Nov 2023 14:10:36 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Tue, 28 Nov 2023 14:10:36 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Tue, 28 Nov 2023 14:10:35 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nktogIzbgm8vEiNf5w3tfW+Ou8Lqe2PLcruIVDOTYCywtMa3+4tHTIUnPBSzlKJmlXSbZdGHMoMYN5XDqPIbIQPx/fNQCH9XtAiqqFXVLcgxlqRpmHiESKaJmUsx1+ypzcCNcv91tyyhyZe1JEUk+JaEc+6u0LnEAe+yqs2gSe8LIA84v8KbgsU0ZZN1OI+DlKacX+BKcQnNG5KzCLST0J6DQdHNHY2VmwVZAFUlH6YCDXOTWA0O2DTUHZbsExRucmVkyh4eIddWeqKfpJEdGrjPlj6K4xj3gq986xtSljMjGriGMXPSDU+isbT4jtQd4TuGkMIoGbvFFkVVysshOw== 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=YImaUthpfoprTzSyGmx0hNvTplQiz3LMlmncPHQbMjw=; b=bVQIDsFSmfzv2+piySx1adWeLv3gBCsMZrPG6kQ7X3qRs6qg5IGSZMJ/4tTvxvhKHFYXxQlq/MPOkbhjksoaDClVo9W44omMQJtG5gDYl2WGOWe1HpYO/rUGmqzxFdNhVofPjHIX17ANCZk6ib5cLUewAhcR+hqYmlDZEwvV0elCvwZihOAfl5q7cH1+qICCAwNeKw/PHiDWv2dX4CEXo98yH61McuX/ylcdYvlK5ZAt3XLeIKK15PqWWWY+4/6aqPxnzavCAL1ky3gCjIDPNWSChq2EwONm/W0tJdLFApZcINyEdy1biCKFYQAvenfvvetcVnplHINMtv1R05KGvw== 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 DS0PR11MB6328.namprd11.prod.outlook.com (2603:10b6:8:cc::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29; Tue, 28 Nov 2023 22:10:34 +0000 Received: from SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::6710:537d:b74:f1e5]) by SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::6710:537d:b74:f1e5%5]) with mapi id 15.20.7025.022; Tue, 28 Nov 2023 22:10:34 +0000 Message-ID: <213df261-03ee-4b13-80ac-236c2dfde09a@intel.com> Date: Tue, 28 Nov 2023 14:10:33 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 03/26] selftests/resctrl: Refactor fill_buf functions Content-Language: en-US To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , , Shuah Khan , "Shaopeng Tan" , =?UTF-8?Q?Maciej_Wiecz=C3=B3r-Retman?= , Fenghua Yu CC: References: <20231120111340.7805-1-ilpo.jarvinen@linux.intel.com> <20231120111340.7805-4-ilpo.jarvinen@linux.intel.com> From: Reinette Chatre In-Reply-To: <20231120111340.7805-4-ilpo.jarvinen@linux.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MW4PR04CA0192.namprd04.prod.outlook.com (2603:10b6:303:86::17) To SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|DS0PR11MB6328:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d18ecdb-d7ed-4635-0bb2-08dbf05ed7e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zjO3zKbMeewqWjmmh1XZiFrr4W6v/YrQiAXdKG1uWPRofOO/ANPeFIVSZSr0JnPs6senJg4eYn1UlbezczkGfswQxkjOlNI0xAPRoN3B6TkoIRU6SXOw8zgtzpTZ3sYhRg+xGTBD7WJH23ReVqDtlJ/L6IwjPksP17V01OpiNH52HcJF/RgxpHMepnloTRz3354cQOo5DdJGtuZ5Et15BB07iwTPkd6In3vOgovnwiJVSrViscfbQ8tXFQa+gA1f/ywu1nm2yBM5OVbeXreOKIy55d2ty+6lgZrCsIph9D0M329vRUGup5CSq8ZAnw3KzTZoAJOT7wM4KjNA6r+NL1B6mt+0/8Z1706dlf0HkOQD+39BU5c/EwK3YLd57dNxLhj2Vl1cQ44l7U2l5H16va9d8DoXU6Obfr9skRE88cLQIM9kkcp9Rxm/tVklEWBKaunRmfMCTZ5kVYyw0oV9d8cPiLStDeaD52nceAy9pIQcydf21GU1UPQUjvIUa9l5zPODPBgWmR99cs7I1Zozvlsx0UeztvBsxL0u/lwj3JaFtbrtPFSpPyhgrKYmUtf3NGmKxDs6cDhzLfnkNDQgqk217IOLKfuZTA4cowQO+0I6y/3nAprSBWfpoWtA8EZX7M7aPqwO5BqnyjLrix12lA== 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)(39860400002)(346002)(396003)(376002)(366004)(136003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(5660300002)(4744005)(44832011)(41300700001)(8936002)(4326008)(8676002)(31686004)(2906002)(110136005)(6636002)(316002)(66556008)(66946007)(66476007)(2616005)(6486002)(478600001)(36756003)(53546011)(6512007)(26005)(6506007)(86362001)(38100700002)(82960400001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZFhQTURuNlNCcXNzZ2poY0RJL2V1RVJRWW5DK2Q1OE9QRCtrK2ZzL09kZkJv?= =?utf-8?B?MUhQYkh2WHh6UHVVZkNtZi8wUkJPQkRZbzNyK1p5RTNvUHhqQ3VscjFhazk1?= =?utf-8?B?VDZjN3B3d0FyOFdIT1JmTTBWbkg4YnFmVi9SM0dEL2t0M0N2V2UzZG5wMzZZ?= =?utf-8?B?MFBqVlJ6MlFCUXBZTEVna1hJaDF6akxpNm1DTFZLSUZVZDlSMzdMN25uL2pu?= =?utf-8?B?Nll6czM3LzVWcEh1alJwU0Y1VnZYQkc2UUtCVUNTendaVndkY1RJRGxFcm1q?= =?utf-8?B?QmYzZ1dtSktsTVBubmthTDA4Q2tWeWE2TjhxVmNuTWJJMHhVSmViSVBPYnFL?= =?utf-8?B?aUV2SVlpa2xNQmdmN0x1Y3YwTEFIMFVYYmxwWXdCQlRzcm5XTkxRcVU1cjZk?= =?utf-8?B?Z0x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exchange-CrossTenant-Network-Message-Id: 0d18ecdb-d7ed-4635-0bb2-08dbf05ed7e4 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 22:10:34.3916 (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: lGsKP7KHX6SRQRzXqz5SSXcUAhZKS7BcWKoNN8qfVn5ZMfPwfQadOuY9vVIBWnxZ9cdQzrg1HlymU2jbTCbu9SPbemeHAb+zGuON501w4GQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB6328 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 14:11:02 -0800 (PST) Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > There are unnecessary nested calls in fill_buf.c: > - run_fill_buf() calls fill_cache() > - alloc_buffer() calls malloc_and_init_memory() > > Simplify the code flow and remove those unnecessary call levels by > moving the called code inside the calling function. > > Resolve the difference in run_fill_buf() and fill_cache() parameter > name into 'buf_size' which is more descriptive than 'span'. Also, while > moving the allocation related code, rename 'p' into 'buf' to be > consistent in naming the variables. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette