Message ID | 20230418114506.46788-14-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 b10csp2795221vqo; Tue, 18 Apr 2023 05:11:19 -0700 (PDT) X-Google-Smtp-Source: AKy350YfU/a0sH+dlLyQvwiOUlNgNf5giKkdKVT0oZM1ZdrXycNSeLd67I0/FJ0wmxnmY4DY29Xt X-Received: by 2002:a17:902:ecc4:b0:1a6:c366:1603 with SMTP id a4-20020a170902ecc400b001a6c3661603mr2169257plh.19.1681819879386; Tue, 18 Apr 2023 05:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681819879; cv=none; d=google.com; s=arc-20160816; b=OHw/lP+D7YNPG0OX2cJnxlCHCwGZkHzE1xU5ldY7msYMH9UslHqEy3xFkm89U9htYt XS5nxTdOvVRY1bxnDKw3dtvy+VkE9ON0WtBiNLaet74M0Kt9+xIWhaz+ru0Ounch6SP7 696LrLg8+7br145oIdsVS+ebWK3GbYBatsF3up27T/cqrBDcmy2Je+UcHAdm6b0pF6kC n9ULhAqKydoXQaFUVYONrhIako7WS2nQVfV0wyseUqQNh7M4rfVUxAZChWXH2vBM00+Q tb2W6jQqfTqVtmonnHGZj/ME3PnaiP193Y1WEjafws6y+FDbx3mGzIJA6fN+NtYCH3P9 Tq9w== 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=QKqQX6Dgfm4mjVAEws17fl8wz+B6+EfeYTSByy9yB9E=; b=IBa6F4QKt9cYbItrjYhGqZbdUjnl7CT28bdwwg8L7/t3tZln83s4BNCajnBLo+Tzx/ MfSnDQKY0PuWnGc+eDSh3ERkjolCrHXzgoZzg0N1IakPpzPQnz6OfQwcVfMqlzCatdRp Cy75I0hI3+y5vKctgJWyLGk2a6jnyxBHmCtFxU6rA9fOtGUy0LKE4jgUOl17pUSPHZg+ I5KC05hdwLJKH7KaR5+f0lGKsftX+Qe3167yuxGnwHB7+oQQwgCgkbNmnWK8TMyHgl7j qERVIJX2xOlULTayANU1qqkugvnmu2ryaTnpIJEcu+GhMkb9MYx1Pse2hHftKcKR/xd5 Rngw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=licig384; 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 l6-20020a170902f68600b001a66c369e0fsi13951381plg.510.2023.04.18.05.11.00; Tue, 18 Apr 2023 05:11:19 -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=licig384; 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 S231329AbjDRLrT (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Tue, 18 Apr 2023 07:47:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231195AbjDRLrN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Apr 2023 07:47:13 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E30129023; Tue, 18 Apr 2023 04:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681818400; x=1713354400; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=R9lx3mKsxWCICNzKODU56YjOQHjE2EbrIY9NXu/7ouA=; b=licig3845S1bzRzEzqCsqYnz2iu+UkIYKxS6nuQhgdGIdfsmN1sJto5G I8CzAQtLo1TgPytGMcmk6p9Nous6AOyTi/3ileVkDzoV1HXS3NUVRV2h0 4eKBAH3h8HARGhd/t9OME38mFr3p34zArEa8QjiEyDVTQkZwrH5q/SxZI s5l5YpGPBmPDNYc4JjadLvS/lREyH0Giu/JuyMs/kPQLzqrP4KLVsSfpC 97qLDw2hC45TXMvuM2cbmBmDVUZKxxm/acivgWM7CjyrvQIoHLyXXNc6v NqsAvB70qyjQ+KrJ/gBNgziFH1aeG2OgshzqGUplvVQBetg9QDHNoMeM2 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="346994387" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="346994387" 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:46:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="723601705" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="723601705" 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:46:04 -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 13/24] selftests/resctrl: Add flush_buffer() to fill_buf Date: Tue, 18 Apr 2023 14:44:55 +0300 Message-Id: <20230418114506.46788-14-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?1763515961691206481?= X-GMAIL-MSGID: =?utf-8?q?1763515961691206481?= |
Series |
selftests/resctrl: Fixes, cleanups, and rewritten CAT test
|
|
Commit Message
Ilpo Järvinen
April 18, 2023, 11:44 a.m. UTC
Currently, flushing is only done after allocating and filling the
buffer and cannot be controlled by the test cases.
The new CAT test will want to control flushing within a test so
introduce flush_buffer() for that purpose.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
tools/testing/selftests/resctrl/fill_buf.c | 5 +++++
tools/testing/selftests/resctrl/resctrl.h | 1 +
2 files changed, 6 insertions(+)
Comments
Hi Ilpo, On 4/18/2023 4:44 AM, Ilpo Järvinen wrote: > Currently, flushing is only done after allocating and filling the > buffer and cannot be controlled by the test cases. > > The new CAT test will want to control flushing within a test so > introduce flush_buffer() for that purpose. > > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > --- > tools/testing/selftests/resctrl/fill_buf.c | 5 +++++ > tools/testing/selftests/resctrl/resctrl.h | 1 + > 2 files changed, 6 insertions(+) > > diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c > index 677e1a113629..7e0d3a1ea555 100644 > --- a/tools/testing/selftests/resctrl/fill_buf.c > +++ b/tools/testing/selftests/resctrl/fill_buf.c > @@ -58,6 +58,11 @@ static void mem_flush(void *p, size_t s) > sb(); > } > > +void flush_buffer(unsigned long long span) > +{ > + mem_flush(startptr, span); > +} > + I do not think this indirection is needed. In the same spirit of feedback to previous patches a test can manage its own buffer pointer and flush it by calling mem_flush() directly. Reinette
diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c index 677e1a113629..7e0d3a1ea555 100644 --- a/tools/testing/selftests/resctrl/fill_buf.c +++ b/tools/testing/selftests/resctrl/fill_buf.c @@ -58,6 +58,11 @@ static void mem_flush(void *p, size_t s) sb(); } +void flush_buffer(unsigned long long span) +{ + mem_flush(startptr, span); +} + static void *malloc_and_init_memory(size_t s) { void *p = NULL; diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 8748121345f3..ba36eb5fdf0d 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -97,6 +97,7 @@ 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); +void flush_buffer(unsigned long long span); int use_buffer(unsigned long long buf_size, int op, bool once); int run_fill_buf(unsigned long span, int memflush, int op, bool once); int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param);