Hello,
The aim of this series is to make resctrl_tests run by using
kselftest framework.
- I modify resctrl_test Makefile and kselftest Makefile,
to enable build/run resctrl_tests by using kselftest framework.
Of course, users can also build/run resctrl_tests without
using framework as before.
- I change the default limited time for resctrl_tests to 120 seconds, to
ensure the resctrl_tests finish in limited time on different environments.
- When resctrl file system is not supported by environment or
resctrl_tests is not run as root, return skip code of kselftest framework.
- If resctrl_tests does not finish in limited time, terminate it as
same as executing ctrl+c that kills parent process and child process.
Difference from v6:
- Fixed the typos.
https://lore.kernel.org/lkml/20220318075807.2921063-1-tan.shaopeng@jp.fujit… [PATCH v6]
This patch series is based on 'next' branch of linux-kselftest.
Note that Patch [4/6] uses KHDR_INCLUDES which is introduced by a patch
on 'next' branch of linux-kselftest (not merged in mainline yet)
linux-kselftest: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git
Shaopeng Tan (6):
selftests/resctrl: Kill child process before parent process terminates
if SIGTERM is received
selftests/resctrl: Change the default limited time to 120 seconds
selftests/resctrl: Fix resctrl_tests' return code to work with
selftest framework
selftests/resctrl: Make resctrl_tests run using kselftest framework
selftests/resctrl: Update README about using kselftest framework to
build/run resctrl_tests
selftests/resctrl: Add missing SPDX license to Makefile
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/resctrl/Makefile | 19 +++------
tools/testing/selftests/resctrl/README | 39 +++++++++++++++----
.../testing/selftests/resctrl/resctrl_tests.c | 4 +-
tools/testing/selftests/resctrl/resctrl_val.c | 1 +
tools/testing/selftests/resctrl/settings | 3 ++
6 files changed, 45 insertions(+), 22 deletions(-)
create mode 100644 tools/testing/selftests/resctrl/settings
--
2.27.0
Changes since V2:
- V2: https://lore.kernel.org/lkml/cover.1647360971.git.reinette.chatre@intel.com/
- Rebased against v5.18-rc4, no functional changes.
- Add text in cover letter and first patch to highlight that
the __cpuid_count() macro provided is not a new implementation but
copied from gcc.
Changes since V1:
- V1: https://lore.kernel.org/lkml/cover.1644000145.git.reinette.chatre@intel.com/
- Change solution to not use __cpuid_count() from compiler's
cpuid.h but instead use a local define of __cpuid_count()
provided in kselftest.h to ensure tests continue working
in all supported environments. (Shuah)
- Rewrite cover letter and changelogs to reflect new solution.
A few tests that require running CPUID do so with a private
implementation of a wrapper for CPUID. This duplication of
the CPUID wrapper should be avoided.
Both gcc and clang/LLVM provide wrappers for CPUID but
the wrappers are not available in the minimal required
version of gcc, v3.2, that the selftests need to be used
in. __cpuid_count() was added to gcc in v4.4, which is ok for
kernels after v4.19 when the gcc minimal required version
was changed to v4.6.
Copy gcc's __cpuid_count() to provide a local define of
__cpuid_count() to kselftest.h to ensure that selftests can
still work in environments with older stable kernels (v4.9
and v4.14 that have the minimal required version of gcc of
v3.2). Update tests with private CPUID wrappers to use the
new macro.
Cc: Dave Hansen <dave.hansen(a)linux.intel.com>
Cc: Sandipan Das <sandipan(a)linux.ibm.com>
Cc: Florian Weimer <fweimer(a)redhat.com>
Cc: "Desnes A. Nunes do Rosario" <desnesn(a)linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo(a)kernel.org>
Cc: Thiago Jung Bauermann <bauerman(a)linux.ibm.com>
Cc: Michael Ellerman <mpe(a)ellerman.id.au>
Cc: Michal Suchanek <msuchanek(a)suse.de>
Cc: linux-mm(a)kvack.org
Cc: Chang S. Bae <chang.seok.bae(a)intel.com>
Cc: Borislav Petkov <bp(a)suse.de>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Ingo Molnar <mingo(a)redhat.com>
Cc: "H. Peter Anvin" <hpa(a)zytor.com>
Cc: x86(a)kernel.org
Cc: Andy Lutomirski <luto(a)kernel.org>
Reinette Chatre (4):
selftests: Provide local define of __cpuid_count()
selftests/vm/pkeys: Use provided __cpuid_count() macro
selftests/x86/amx: Use provided __cpuid_count() macro
selftests/x86/corrupt_xstate_header: Use provided __cpuid_count()
macro
tools/testing/selftests/kselftest.h | 15 ++++++++++++
tools/testing/selftests/vm/pkey-x86.h | 21 ++--------------
tools/testing/selftests/x86/amx.c | 24 ++++++-------------
.../selftests/x86/corrupt_xstate_header.c | 16 ++-----------
4 files changed, 26 insertions(+), 50 deletions(-)
base-commit: af2d861d4cd2a4da5137f795ee3509e6f944a25b
--
2.25.1
Hi,
this is a revised patch set for RFC I posted some time ago (*).
Since the ZSTD usage became much more popular now, it makes sense to
have the consistent (de)compression support in the kernel, also for
the firmware files. This patch set adds the support for ZSTD-
compressed firmware files as well as the extension of selftests, in
addition to a couple of relevant fixes in selftests.
(*) https://lore.kernel.org/r/20210127154939.13288-1-tiwai@suse.de
Takashi
===
Takashi Iwai (5):
firmware: Add the support for ZSTD-compressed firmware files
selftests: firmware: Use smaller dictionary for XZ compression
selftests: firmware: Fix the request_firmware_into_buf() test for XZ
format
selftests: firmware: Simplify test patterns
selftests: firmware: Add ZSTD compressed file tests
drivers/base/firmware_loader/Kconfig | 24 ++-
drivers/base/firmware_loader/main.c | 76 +++++++-
.../selftests/firmware/fw_filesystem.sh | 170 +++++++++---------
tools/testing/selftests/firmware/fw_lib.sh | 12 +-
4 files changed, 182 insertions(+), 100 deletions(-)
--
2.31.1
Currently if opening /dev/null fails to open then file pointer fp
is null and further access to fp via fprintf will cause a null
pointer dereference. Fix this by returning a negative error value
when a null fp is detected.
Fixes: a2561b12fe39 ("selftests/resctrl: Add built in benchmark")
Signed-off-by: Colin Ian King <colin.i.king(a)gmail.com>
---
tools/testing/selftests/resctrl/fill_buf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c
index 51e5cf22632f..56ccbeae0638 100644
--- a/tools/testing/selftests/resctrl/fill_buf.c
+++ b/tools/testing/selftests/resctrl/fill_buf.c
@@ -121,8 +121,10 @@ static int fill_cache_read(unsigned char *start_ptr, unsigned char *end_ptr,
/* Consume read result so that reading memory is not optimized out. */
fp = fopen("/dev/null", "w");
- if (!fp)
+ if (!fp) {
perror("Unable to write to /dev/null");
+ return -1;
+ }
fprintf(fp, "Sum: %d ", ret);
fclose(fp);
--
2.35.1
Currently the binderfs test says what failure it encountered
without saying why it may occurred when it fails to mount
binderfs. So, Warn about enabling CONFIG_ANDROID_BINDERFS in the
running kernel.
Signed-off-by: Karthik Alapati <mail(a)karthek.com>
---
tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c
index 0315955ff0f4..bc1c407651fc 100644
--- a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c
+++ b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c
@@ -412,7 +412,8 @@ TEST(binderfs_stress)
ret = mount(NULL, binderfs_mntpt, "binder", 0, 0);
ASSERT_EQ(ret, 0) {
- TH_LOG("%s - Failed to mount binderfs", strerror(errno));
+ TH_LOG("%s - Failed to mount binderfs, check if CONFIG_ANDROID_BINDERFS is enabled in the running kernel",
+ strerror(errno));
}
for (int i = 0; i < ARRAY_SIZE(fds); i++) {
--
2.35.2
This patch series adds a memory.reclaim proactive reclaim interface.
The rationale behind the interface and how it works are in the first
patch.
---
Changes in V4:
mm/memcontrol.c:
- Return -EINTR on signal_pending().
- On the final retry, drain percpu lru caches hoping that it might
introduce some evictable pages for reclaim.
- Simplified the retry loop as suggested by Dan Schatzberg.
selftests:
- Always return -errno on failure from cg_write() (whether open() or
write() fail), also update cg_read() and read_text() to return -errno
as well for consistency. Also make sure to correctly check that the
whole buffer was written in cg_write().
- Added a maximum number of retries for the reclaim selftest.
Changes in V3:
- Fix cg_write() (in patch 2) to properly return -1 if open() fails
and not fail if len == errno.
- Remove debug printf() in patch 3.
Changes in V2:
- Add the interface to root as well.
- Added a selftest.
- Documented the interface as a nested-keyed interface, which makes
adding optional arguments in the future easier (see doc updates in the
first patch).
- Modified the commit message to reflect changes and added a timeout
argument as a suggested possible extension
- Return -EAGAIN if the kernel fails to reclaim the full requested
amount.
---
Shakeel Butt (1):
memcg: introduce per-memcg reclaim interface
Yosry Ahmed (3):
selftests: cgroup: return -errno from cg_read()/cg_write() on failure
selftests: cgroup: fix alloc_anon_noexit() instantly freeing memory
selftests: cgroup: add a selftest for memory.reclaim
Documentation/admin-guide/cgroup-v2.rst | 21 +++++
mm/memcontrol.c | 44 +++++++++
tools/testing/selftests/cgroup/cgroup_util.c | 44 ++++-----
.../selftests/cgroup/test_memcontrol.c | 94 ++++++++++++++++++-
4 files changed, 176 insertions(+), 27 deletions(-)
--
2.36.0.rc2.479.g8af0fa9b8e-goog