[v2,10/24] selftests/resctrl: Split run_fill_buf() to alloc, work, and dealloc helpers
Message ID | 20230418114506.46788-11-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2794642vqo; Tue, 18 Apr 2023 05:10:36 -0700 (PDT) X-Google-Smtp-Source: AKy350bkF0HSncl1ugi6P1OX/WJC7KiURpHmez9xyIX7iQsyHgspnHtHDP5CE4PsL2OZ40F3BZ1L X-Received: by 2002:a17:90a:f3cf:b0:234:7ccf:3c7c with SMTP id ha15-20020a17090af3cf00b002347ccf3c7cmr2120800pjb.9.1681819835859; Tue, 18 Apr 2023 05:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681819835; cv=none; d=google.com; s=arc-20160816; b=wL9fZeUXi4wz+MyJugT6vcooaoPbIWHRGJhFKXp4FM5Me9hXFr+TKctqqAMwtywxhO HW7W5O6wG67NSkLDOGRdBvKe38UPuI6AFYUipgmxXNzD+pZGHtAFslItz1p4fc80VgJO w0jsETnxIIuZvDI2sr+LrPKheejlGmXOnFcaH8MkHf2XepR9oK9priR2Ih+e5cOJWSQH IAzpGGsCIXfFzMAnzaXR+UY0sVoxK11VU8+VUiXg99AeQR24wlS6dK+td4uirGULG3j6 4HmnANpldWRppCBSE6dEC+Q9Txv8rcz5KeS2BHdw9c6ou+Qqb1F2b0LfWUOMBvgWamvW wxiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x6P3aDbAWcG5VoHayeHDgCJLvOH94KuzPkx1pFZKV5c=; b=CBHVyepKaV4mIsVLKZoMmg3f0V0j5PTOvL3hRSPl7d5lmTmYluV2ZW2Y3hszv58JbZ lZw1Yu5TIu2Ijk+lIK3sJWopbq+OoGdOgyDIZmcRtolKGJSYMFupYKwMwZZBqEZ3VJV+ vCD5EZ1hQuUD1eW/LyPjMBhcDHGttwVG06G2XqBBatOsL96CODsKpwHI0tz5LsyNd6/s cqDCSfZpRiMEnKNTZC93R51laW6csbAaVYd+1GviCJYuFz0o+lTJGA70RY/6X+1s2OqI RHHRY2upluGADHK++iGPHUuKAVrn70blANsLHIkKkhZFQzzQryNwjCJ12Mgy6b4I5GCz +Ncg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FYhv2eg1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a654685000000b0050726756edesi13940746pgr.76.2023.04.18.05.10.21; Tue, 18 Apr 2023 05:10:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FYhv2eg1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231540AbjDRLqv (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Tue, 18 Apr 2023 07:46:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231577AbjDRLqk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Apr 2023 07:46:40 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F45E78; Tue, 18 Apr 2023 04:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681818369; x=1713354369; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UXzBCe+HMFj+CW/PyVKY25ygKi4rEwQRoqZga+3wvGs=; b=FYhv2eg1X7PqtkCadNzc5jdInvhS6rCVmuTzBVq6Q9Smh8gbdK0BzHEH YOsY1hKeyoOGAYi3B8LqWLEsVX2PXU13ZUOchVqlgYVSsibSa+XhQjDfa 6BTK0t8cgDfNgqftqbubh2jJps02X7MJ1IKuhqtnPGK2afqX1x1yRCHy1 7fYjpXtl8KVzkTo5uoC6ORjgbDZHzvbbRNv2SR34bv3tu6lzR4oftbZK+ 2qNcKdMhYBjMsHLrvoUqRB5GHwGcn9Obq2jhE8GbWOqqhpxvGuva0HXAu Lx+SeFOff7XGdPJGL9MO+DUoU4OBRdO8/49jEGCp1qpLq/0TAMoK1Goxc Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="346994352" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="346994352" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2023 04:45:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="723601648" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="723601648" Received: from yvolokit-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.213.103]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2023 04:45:55 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-kselftest@vger.kernel.org, Reinette Chatre <reinette.chatre@intel.com>, Fenghua Yu <fenghua.yu@intel.com>, Shuah Khan <shuah@kernel.org>, linux-kernel@vger.kernel.org Cc: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH v2 10/24] selftests/resctrl: Split run_fill_buf() to alloc, work, and dealloc helpers Date: Tue, 18 Apr 2023 14:44:52 +0300 Message-Id: <20230418114506.46788-11-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230418114506.46788-1-ilpo.jarvinen@linux.intel.com> References: <20230418114506.46788-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763515916123658572?= X-GMAIL-MSGID: =?utf-8?q?1763515916123658572?= |
Series |
selftests/resctrl: Fixes, cleanups, and rewritten CAT test
|
|
Commit Message
Ilpo Järvinen
April 18, 2023, 11:44 a.m. UTC
MBM, MBA and CMT test cases use run_fill_buf() to loop indefinitely loop around the buffer. CAT test case is different and doesn't want to loop around the buffer continuously. Split run_fill_buf() into helpers so that both the use cases are easier to control by creating separate functions for buffer allocation, looping around the buffer and the deallocation. Make those functions available for tests. Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> --- tools/testing/selftests/resctrl/fill_buf.c | 46 ++++++++++++++++------ tools/testing/selftests/resctrl/resctrl.h | 3 ++ 2 files changed, 37 insertions(+), 12 deletions(-)
Comments
Hi Ilpo, On 4/18/2023 4:44 AM, Ilpo Järvinen wrote: > MBM, MBA and CMT test cases use run_fill_buf() to loop indefinitely > loop around the buffer. CAT test case is different and doesn't want to "loop indefinitely loop" -> "loop indefinitely" ? > loop around the buffer continuously. > > Split run_fill_buf() into helpers so that both the use cases are easier > to control by creating separate functions for buffer allocation, > looping around the buffer and the deallocation. Make those functions > available for tests. > > Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > --- > tools/testing/selftests/resctrl/fill_buf.c | 46 ++++++++++++++++------ > tools/testing/selftests/resctrl/resctrl.h | 3 ++ > 2 files changed, 37 insertions(+), 12 deletions(-) > > diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c > index 5cdb421a2f6c..6f0438aa71a6 100644 > --- a/tools/testing/selftests/resctrl/fill_buf.c > +++ b/tools/testing/selftests/resctrl/fill_buf.c > @@ -24,6 +24,11 @@ > > static unsigned char *startptr; > > +void free_buffer(void) > +{ > + free(startptr); > +} > + From what I understand startptr is a global variable because there used to be a signal handler that attempted to free the buffer as part of its cleanup. This was not necessary and this behavior no longer exists, yet the global buffer pointer remains. See commit 73c55fa5ab55 ("selftests/resctrl: Commonize the signal handler register/unregister for all tests") I do not see why a global buffer pointer with all these indirections are needed. Why not just use a local pointer and pass it to functions as needed? In the above case, just call free(pointer) directly from the test. > static void sb(void) > { > #if defined(__i386) || defined(__x86_64) > @@ -138,36 +143,53 @@ static int fill_cache_write(unsigned char *start_ptr, unsigned char *end_ptr, > return 0; > } > > -static int > -fill_cache(unsigned long long buf_size, int memflush, int op, char *resctrl_val) > +int alloc_buffer(unsigned long long buf_size, int memflush) > { This can be an allocation function that returns a pointer to allocated buffer, NULL if error. > - unsigned char *start_ptr, *end_ptr; > - int ret; > + unsigned char *start_ptr; > > start_ptr = malloc_and_init_memory(buf_size); > if (!start_ptr) > return -1; > > startptr = start_ptr; > - end_ptr = start_ptr + buf_size; > > /* Flush the memory before using to avoid "cache hot pages" effect */ > if (memflush) > mem_flush(start_ptr, buf_size); > > + return 0; > +} > + > +int use_buffer(unsigned long long buf_size, int op, char *resctrl_val) > +{ > + unsigned char *end_ptr; > + int ret; > + > + end_ptr = startptr + buf_size; > if (op == 0) > - ret = fill_cache_read(start_ptr, end_ptr, resctrl_val); > + ret = fill_cache_read(startptr, end_ptr, resctrl_val); > else > - ret = fill_cache_write(start_ptr, end_ptr, resctrl_val); > + ret = fill_cache_write(startptr, end_ptr, resctrl_val); > > - if (ret) { > + if (ret) > printf("\n Error in fill cache read/write...\n"); > - return -1; > - } > > - free(startptr); > + return ret; > +} > This seems like an unnecessary level of abstraction to me. Could callers not just call fill_cache_read()/fill_cache_write() directly? I think doing so will make tests easier to understand. Looking ahead at how cat_val() turns out in the final patch I do think a call to fill_cache_read() is easier to follow than this abstraction. > - return 0; > +static int > +fill_cache(unsigned long long buf_size, int memflush, int op, char *resctrl_val) > +{ > + int ret; > + > + ret = alloc_buffer(buf_size, memflush); > + if (ret) > + return ret; > + > + ret = use_buffer(buf_size, op, resctrl_val); > + free_buffer(); > + > + return ret; > } > > int run_fill_buf(unsigned long span, int memflush, int op, char *resctrl_val) > diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h > index 574adac8932d..75bfa2b2746d 100644 > --- a/tools/testing/selftests/resctrl/resctrl.h > +++ b/tools/testing/selftests/resctrl/resctrl.h > @@ -95,6 +95,9 @@ int write_bm_pid_to_resctrl(pid_t bm_pid, char *ctrlgrp, char *mongrp, > char *resctrl_val); > int perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu, > int group_fd, unsigned long flags); > +void free_buffer(void); > +int alloc_buffer(unsigned long long buf_size, int memflush); > +int use_buffer(unsigned long long buf_size, int op, char *resctrl_val); > int run_fill_buf(unsigned long span, int memflush, int op, char *resctrl_val); > int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param); > int mbm_bw_change(unsigned long span, int cpu_no, char *bw_report, char **benchmark_cmd); Reinette
On Fri, 21 Apr 2023, Reinette Chatre wrote: > On 4/18/2023 4:44 AM, Ilpo Järvinen wrote: > > > > diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c > > index 5cdb421a2f6c..6f0438aa71a6 100644 > > --- a/tools/testing/selftests/resctrl/fill_buf.c > > +++ b/tools/testing/selftests/resctrl/fill_buf.c > > @@ -24,6 +24,11 @@ > > > > static unsigned char *startptr; > > > > +void free_buffer(void) > > +{ > > + free(startptr); > > +} > > + > > >From what I understand startptr is a global variable because there used > to be a signal handler that attempted to free the buffer as part of > its cleanup. This was not necessary and this behavior no longer exists, > yet the global buffer pointer remains. > See commit 73c55fa5ab55 ("selftests/resctrl: Commonize the signal handler > register/unregister for all tests") > > I do not see why a global buffer pointer with all these indirections > are needed. Why not just use a local pointer and pass it to functions > as needed? In the above case, just call free(pointer) directly from the > test. OK, I'll try to convert all this into using non-global pointers then. It requires a bit refactoring but, IIRC, it is doable. > > static void sb(void) > > { > > #if defined(__i386) || defined(__x86_64) > > @@ -138,36 +143,53 @@ static int fill_cache_write(unsigned char *start_ptr, unsigned char *end_ptr, > > return 0; > > } > > > > -static int > > -fill_cache(unsigned long long buf_size, int memflush, int op, char *resctrl_val) > > +int alloc_buffer(unsigned long long buf_size, int memflush) > > { > > This can be an allocation function that returns a pointer to > allocated buffer, NULL if error. > > > - unsigned char *start_ptr, *end_ptr; > > - int ret; > > + unsigned char *start_ptr; > > > > start_ptr = malloc_and_init_memory(buf_size); > > if (!start_ptr) > > return -1; > > > > startptr = start_ptr; > > - end_ptr = start_ptr + buf_size; > > > > /* Flush the memory before using to avoid "cache hot pages" effect */ > > if (memflush) > > mem_flush(start_ptr, buf_size); > > > > + return 0; > > +} > > + > > +int use_buffer(unsigned long long buf_size, int op, char *resctrl_val) > > +{ > > + unsigned char *end_ptr; > > + int ret; > > + > > + end_ptr = startptr + buf_size; > > if (op == 0) > > - ret = fill_cache_read(start_ptr, end_ptr, resctrl_val); > > + ret = fill_cache_read(startptr, end_ptr, resctrl_val); > > else > > - ret = fill_cache_write(start_ptr, end_ptr, resctrl_val); > > + ret = fill_cache_write(startptr, end_ptr, resctrl_val); > > > > - if (ret) { > > + if (ret) > > printf("\n Error in fill cache read/write...\n"); > > - return -1; > > - } > > > > - free(startptr); > > + return ret; > > +} > > > > This seems like an unnecessary level of abstraction to me. Could > callers not just call fill_cache_read()/fill_cache_write() directly? > I think doing so will make tests easier to understand. Looking ahead > at how cat_val() turns out in the final patch I do think a call > to fill_cache_read() is easier to follow than this abstraction. Passing a custom benchmark command with -b would lose some functionality if this abstraction is removed. CAT test could make a direct call though as it doesn't care about the benchmark command. How useful that -b functionality is for selftesting is somewhat questionable though.
Hi Ilpo, On 4/24/2023 9:01 AM, Ilpo Järvinen wrote: > On Fri, 21 Apr 2023, Reinette Chatre wrote: >> On 4/18/2023 4:44 AM, Ilpo Järvinen wrote: >>> ... >>> static void sb(void) >>> { >>> #if defined(__i386) || defined(__x86_64) >>> @@ -138,36 +143,53 @@ static int fill_cache_write(unsigned char *start_ptr, unsigned char *end_ptr, >>> return 0; >>> } >>> >>> -static int >>> -fill_cache(unsigned long long buf_size, int memflush, int op, char *resctrl_val) >>> +int alloc_buffer(unsigned long long buf_size, int memflush) >>> { >> >> This can be an allocation function that returns a pointer to >> allocated buffer, NULL if error. >> >>> - unsigned char *start_ptr, *end_ptr; >>> - int ret; >>> + unsigned char *start_ptr; >>> >>> start_ptr = malloc_and_init_memory(buf_size); >>> if (!start_ptr) >>> return -1; >>> >>> startptr = start_ptr; >>> - end_ptr = start_ptr + buf_size; >>> >>> /* Flush the memory before using to avoid "cache hot pages" effect */ >>> if (memflush) >>> mem_flush(start_ptr, buf_size); >>> >>> + return 0; >>> +} >>> + >>> +int use_buffer(unsigned long long buf_size, int op, char *resctrl_val) >>> +{ >>> + unsigned char *end_ptr; >>> + int ret; >>> + >>> + end_ptr = startptr + buf_size; >>> if (op == 0) >>> - ret = fill_cache_read(start_ptr, end_ptr, resctrl_val); >>> + ret = fill_cache_read(startptr, end_ptr, resctrl_val); >>> else >>> - ret = fill_cache_write(start_ptr, end_ptr, resctrl_val); >>> + ret = fill_cache_write(startptr, end_ptr, resctrl_val); >>> >>> - if (ret) { >>> + if (ret) >>> printf("\n Error in fill cache read/write...\n"); >>> - return -1; >>> - } >>> >>> - free(startptr); >>> + return ret; >>> +} >>> >> >> This seems like an unnecessary level of abstraction to me. Could >> callers not just call fill_cache_read()/fill_cache_write() directly? >> I think doing so will make tests easier to understand. Looking ahead >> at how cat_val() turns out in the final patch I do think a call >> to fill_cache_read() is easier to follow than this abstraction. > > Passing a custom benchmark command with -b would lose some functionality > if this abstraction is removed. CAT test could make a direct call though > as it doesn't care about the benchmark command. > > How useful that -b functionality is for selftesting is somewhat > questionable though. I do not think we are speaking about the same thing here. I think that use_buffer() is unnecessary. fill_cache() can just call fill_cache_read() or fill_cache_write() directly, depending on the op value. Could you please elaborate how that impacts the custom benchmark? Looking ahead at patch 24/24: "selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test" I feel more strongly that use_buffer() is unnecessary since it adds an unnecessary layer and makes it harder to see what the test does. Reinette
diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c index 5cdb421a2f6c..6f0438aa71a6 100644 --- a/tools/testing/selftests/resctrl/fill_buf.c +++ b/tools/testing/selftests/resctrl/fill_buf.c @@ -24,6 +24,11 @@ static unsigned char *startptr; +void free_buffer(void) +{ + free(startptr); +} + static void sb(void) { #if defined(__i386) || defined(__x86_64) @@ -138,36 +143,53 @@ static int fill_cache_write(unsigned char *start_ptr, unsigned char *end_ptr, return 0; } -static int -fill_cache(unsigned long long buf_size, int memflush, int op, char *resctrl_val) +int alloc_buffer(unsigned long long buf_size, int memflush) { - unsigned char *start_ptr, *end_ptr; - int ret; + unsigned char *start_ptr; start_ptr = malloc_and_init_memory(buf_size); if (!start_ptr) return -1; startptr = start_ptr; - end_ptr = start_ptr + buf_size; /* Flush the memory before using to avoid "cache hot pages" effect */ if (memflush) mem_flush(start_ptr, buf_size); + return 0; +} + +int use_buffer(unsigned long long buf_size, int op, char *resctrl_val) +{ + unsigned char *end_ptr; + int ret; + + end_ptr = startptr + buf_size; if (op == 0) - ret = fill_cache_read(start_ptr, end_ptr, resctrl_val); + ret = fill_cache_read(startptr, end_ptr, resctrl_val); else - ret = fill_cache_write(start_ptr, end_ptr, resctrl_val); + ret = fill_cache_write(startptr, end_ptr, resctrl_val); - if (ret) { + if (ret) printf("\n Error in fill cache read/write...\n"); - return -1; - } - free(startptr); + return ret; +} - return 0; +static int +fill_cache(unsigned long long buf_size, int memflush, int op, char *resctrl_val) +{ + int ret; + + ret = alloc_buffer(buf_size, memflush); + if (ret) + return ret; + + ret = use_buffer(buf_size, op, resctrl_val); + free_buffer(); + + return ret; } int run_fill_buf(unsigned long span, int memflush, int op, char *resctrl_val) diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 574adac8932d..75bfa2b2746d 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -95,6 +95,9 @@ int write_bm_pid_to_resctrl(pid_t bm_pid, char *ctrlgrp, char *mongrp, char *resctrl_val); int perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu, int group_fd, unsigned long flags); +void free_buffer(void); +int alloc_buffer(unsigned long long buf_size, int memflush); +int use_buffer(unsigned long long buf_size, int op, char *resctrl_val); int run_fill_buf(unsigned long span, int memflush, int op, char *resctrl_val); int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param); int mbm_bw_change(unsigned long span, int cpu_no, char *bw_report, char **benchmark_cmd);