Currently, _GNU_SOURCE is defined in resctrl.h. Defining _GNU_SOURCE
has a large impact on what gets defined when including headers either
before or after it. This can result in compile failures if .c file
decides to include a standard header file before resctrl.h.
It is safer to define _GNU_SOURCE in Makefile so it is always defined
regardless of in which order includes are done.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
---
tools/testing/selftests/resctrl/Makefile | 2 +-
tools/testing/selftests/resctrl/resctrl.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/testing/selftests/resctrl/Makefile b/tools/testing/selftests/resctrl/Makefile
index 5073dbc96125..2deac2031de9 100644
--- a/tools/testing/selftests/resctrl/Makefile
+++ b/tools/testing/selftests/resctrl/Makefile
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
-CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2
+CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
CFLAGS += $(KHDR_INCLUDES)
TEST_GEN_PROGS := resctrl_tests
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
index 838d1a438f33..eff178befe4a 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -1,5 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0 */
-#define _GNU_SOURCE
#ifndef RESCTRL_H
#define RESCTRL_H
#include <stdio.h>
--
2.30.2
The current check for 64-bit architecture is double-bugged.
First of all, %BITS_PER_LONG is not available in the userspace,
the underscored version from <asm/bitsperlong.h> must be used.
The following check:
#if BITS_PER_LONG == 0
#error
#endif
triggers the error in this source file -- the macro is undefined and
thus is implicitly evaluated to 0.
Next, %BITS_PER_LONG means "bits", not "bytes". In the Linux kernel,
it can be 32 or 64, never 8. Given that the tests guarded by that check
are meant to be run on a 64-bit system, the correct value would be 64.
Prefix the macro name and fix the value it's compared to.
Fixes: 60b1af8de8c1 ("tracing/user_events: Add ABI self-test")
Cc: stable(a)vger.kernel.org # 6.4+
Reviewed-by: Ira Weiny <ira.weiny(a)intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin(a)intel.com>
---
tools/testing/selftests/user_events/abi_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/user_events/abi_test.c b/tools/testing/selftests/user_events/abi_test.c
index 5125c42efe65..4b30461fc741 100644
--- a/tools/testing/selftests/user_events/abi_test.c
+++ b/tools/testing/selftests/user_events/abi_test.c
@@ -129,7 +129,7 @@ TEST_F(user, bit_sizes) {
ASSERT_EQ(0, reg_disable(&self->check, 0));
ASSERT_EQ(0, reg_disable(&self->check, 31));
-#if BITS_PER_LONG == 8
+#if __BITS_PER_LONG == 64
/* Allow 0-64 bits for 64-bit */
ASSERT_EQ(0, reg_enable(&self->check, sizeof(long), 63));
ASSERT_NE(0, reg_enable(&self->check, sizeof(long), 64));
--
2.41.0
Replace destruction paths with simple returns before the test cgroup is
created, there is nothing to free or destroy at that point.
Remove pointless check, stored_pages is a size_t and cannot be < 0.
Fixes: a549f9f31561 ("selftests: cgroup: add test_zswap with no kmem bypass test")
Reported-by: Dan Carpenter <dan.carpenter(a)linaro.org>
Signed-off-by: Domenico Cerasuolo <cerasuolodomenico(a)gmail.com>
---
tools/testing/selftests/cgroup/test_zswap.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
index 49def87a909b..5257106776d5 100644
--- a/tools/testing/selftests/cgroup/test_zswap.c
+++ b/tools/testing/selftests/cgroup/test_zswap.c
@@ -178,10 +178,10 @@ static int test_no_kmem_bypass(const char *root)
/* Set up test memcg */
if (cg_write(root, "cgroup.subtree_control", "+memory"))
- goto out;
+ return KSFT_FAIL;
test_group = cg_name(root, "kmem_bypass_test");
if (!test_group)
- goto out;
+ return KSFT_FAIL;
/* Spawn memcg child and wait for it to allocate */
set_min_free_kb(min_free_kb_low);
@@ -208,8 +208,6 @@ static int test_no_kmem_bypass(const char *root)
free(trigger_allocation);
if (get_zswap_stored_pages(&stored_pages))
break;
- if (stored_pages < 0)
- break;
/* If memory was pushed to zswap, verify it belongs to memcg */
if (stored_pages > stored_pages_threshold) {
int zswapped = cg_read_key_long(test_group, "memory.stat", "zswapped ");
--
2.34.1
From: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
Fix to unmount the tracefs if the ftracetest mounted it for recovering
system environment. If the tracefs is already mounted, this does nothing.
Suggested-by: Mark Brown <broonie(a)kernel.org>
Link: https://lore.kernel.org/all/29fce076-746c-4650-8358-b4e0fa215cf7@sirena.org…
Fixes: cbd965bde74c ("ftrace/selftests: Return the skip code when tracing directory not configured in kernel")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
---
Changes in v2:
- use -n option explictly for testing the string is non-zero.
---
tools/testing/selftests/ftrace/ftracetest | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index cb5f18c06593..d68264a5f3f0 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -31,6 +31,9 @@ err_ret=1
# kselftest skip code is 4
err_skip=4
+# umount required
+UMOUNT_DIR=""
+
# cgroup RT scheduling prevents chrt commands from succeeding, which
# induces failures in test wakeup tests. Disable for the duration of
# the tests.
@@ -45,6 +48,9 @@ setup() {
cleanup() {
echo $sched_rt_runtime_orig > $sched_rt_runtime
+ if [ -n "${UMOUNT_DIR}" ]; then
+ umount ${UMOUNT_DIR} ||:
+ fi
}
errexit() { # message
@@ -160,11 +166,13 @@ if [ -z "$TRACING_DIR" ]; then
mount -t tracefs nodev /sys/kernel/tracing ||
errexit "Failed to mount /sys/kernel/tracing"
TRACING_DIR="/sys/kernel/tracing"
+ UMOUNT_DIR=${TRACING_DIR}
# If debugfs exists, then so does /sys/kernel/debug
elif [ -d "/sys/kernel/debug" ]; then
mount -t debugfs nodev /sys/kernel/debug ||
errexit "Failed to mount /sys/kernel/debug"
TRACING_DIR="/sys/kernel/debug/tracing"
+ UMOUNT_DIR=${TRACING_DIR}
else
err_ret=$err_skip
errexit "debugfs and tracefs are not configured in this kernel"
Hi all:
The core frequency is subjected to the process variation in semiconductors.
Not all cores are able to reach the maximum frequency respecting the
infrastructure limits. Consequently, AMD has redefined the concept of
maximum frequency of a part. This means that a fraction of cores can reach
maximum frequency. To find the best process scheduling policy for a given
scenario, OS needs to know the core ordering informed by the platform through
highest performance capability register of the CPPC interface.
Earlier implementations of amd-pstate preferred core only support a static
core ranking and targeted performance. Now it has the ability to dynamically
change the preferred core based on the workload and platform conditions and
accounting for thermals and aging.
Amd-pstate driver utilizes the functions and data structures provided by
the ITMT architecture to enable the scheduler to favor scheduling on cores
which can be get a higher frequency with lower voltage.
We call it amd-pstate preferred core.
Here sched_set_itmt_core_prio() is called to set priorities and
sched_set_itmt_support() is called to enable ITMT feature.
Amd-pstate driver uses the highest performance value to indicate
the priority of CPU. The higher value has a higher priority.
Amd-pstate driver will provide an initial core ordering at boot time.
It relies on the CPPC interface to communicate the core ranking to the
operating system and scheduler to make sure that OS is choosing the cores
with highest performance firstly for scheduling the process. When amd-pstate
driver receives a message with the highest performance change, it will
update the core ranking.
Changes form V5->V6:
- cpufreq: amd-pstate:
- - modify the wrong tag order.
- - modify warning about hw_prefcore sysfs attribute.
- - delete duplicate comments.
- - modify the variable name cppc_highest_perf to prefcore_ranking.
- - modify judgment conditions for setting highest_perf.
- - modify sysfs attribute for CPPC highest perf to pr_debug message.
- Documentation: amd-pstate:
- - modify warning: title underline too short.
Changes form V4->V5:
- cpufreq: amd-pstate:
- - modify sysfs attribute for CPPC highest perf.
- - modify warning about comments
- - rebase linux-next
- cpufreq:
- - Moidfy warning about function declarations.
- Documentation: amd-pstate:
- - align with ``amd-pstat``
Changes form V3->V4:
- Documentation: amd-pstate:
- - Modify inappropriate descriptions.
Changes form V2->V3:
- x86:
- - Modify kconfig and description.
- cpufreq: amd-pstate:
- - Add Co-developed-by tag in commit message.
- cpufreq:
- - Modify commit message.
- Documentation: amd-pstate:
- - Modify inappropriate descriptions.
Changes form V1->V2:
- acpi: cppc:
- - Add reference link.
- cpufreq:
- - Moidfy link error.
- cpufreq: amd-pstate:
- - Init the priorities of all online CPUs
- - Use a single variable to represent the status of preferred core.
- Documentation:
- - Default enabled preferred core.
- Documentation: amd-pstate:
- - Modify inappropriate descriptions.
- - Default enabled preferred core.
- - Use a single variable to represent the status of preferred core.
Meng Li (7):
x86: Drop CPU_SUP_INTEL from SCHED_MC_PRIO for the expansion.
acpi: cppc: Add get the highest performance cppc control
cpufreq: amd-pstate: Enable amd-pstate preferred core supporting.
cpufreq: Add a notification message that the highest perf has changed
cpufreq: amd-pstate: Update amd-pstate preferred core ranking
dynamically
Documentation: amd-pstate: introduce amd-pstate preferred core
Documentation: introduce amd-pstate preferrd core mode kernel command
line options
.../admin-guide/kernel-parameters.txt | 5 +
Documentation/admin-guide/pm/amd-pstate.rst | 58 ++++++-
arch/x86/Kconfig | 5 +-
drivers/acpi/cppc_acpi.c | 13 ++
drivers/acpi/processor_driver.c | 6 +
drivers/cpufreq/amd-pstate.c | 161 ++++++++++++++++--
drivers/cpufreq/cpufreq.c | 13 ++
include/acpi/cppc_acpi.h | 5 +
include/linux/amd-pstate.h | 6 +
include/linux/cpufreq.h | 5 +
10 files changed, 255 insertions(+), 22 deletions(-)
--
2.34.1
Hi Linus,
Please pull the following KUnit fixes update for Linux 6.6-rc2.
This kunit update for Linux 6.6-rc2 consists of important fixes to
possible memory leak, null-ptr-deref, wild-memory-access, and error
path bugs.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 25e324bc9cf2ee956eec1db384c39c1a17b7c44a:
kunit: fix struct kunit_attr header (2023-08-21 08:07:56 -0600)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-kunit-6.6-rc2
for you to fetch changes up to 9076bc476d7ebf0565903c4b048442131825c1c3:
kunit: Fix possible memory leak in kunit_filter_suites() (2023-09-05 12:30:06 -0600)
----------------------------------------------------------------
linux-kselftest-kunit-6.6-rc2
This kunit update for Linux 6.6-rc2 consists of important fixes to
possible memory leak, null-ptr-deref, wild-memory-access, and error
path bugs.
----------------------------------------------------------------
David Gow (1):
kunit: test: Make filter strings in executor_test writable
Jinjie Ruan (4):
kunit: Fix wild-memory-access bug in kunit_free_suite_set()
kunit: Fix the wrong err path and add goto labels in kunit_filter_suites()
kunit: Fix possible null-ptr-deref in kunit_parse_glob_filter()
kunit: Fix possible memory leak in kunit_filter_suites()
lib/kunit/executor.c | 48 ++++++++++++++++++++++++++++++++---------------
lib/kunit/executor_test.c | 13 ++++++++-----
lib/kunit/test.c | 3 ++-
3 files changed, 43 insertions(+), 21 deletions(-)
----------------------------------------------------------------
Hi Linus,
Please pull the following Kselftest fixes update for Linux 6.6-rc2.
This kselftest fixes update for Linux 6.6-rc2 consists of fixes
-- kselftest runner script to propagate SIGTERM to runner child
to avoid kselftest hang.
-- to install symlinks required for test execution to avoid test
failures.
-- kselftest dependency checker script argument parsing.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 9b1db732866bee060b9bca9493e5ebf5e8874c48:
selftests: cachestat: use proper syscall number macro (2023-08-16 11:12:44 -0600)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-next-6.6-rc2
for you to fetch changes up to 3f3f384139ed147c71e1d770accf610133d5309b:
selftests: Keep symlinks, when possible (2023-09-08 10:06:56 -0600)
----------------------------------------------------------------
linux-kselftest-next-6.6-rc2
This kselftest fixes update for Linux 6.6-rc2 consists of fixes
-- kselftest runner script to propagate SIGTERM to runner child
to avoid kselftest hang.
-- to install symlinks required for test execution to avoid test
failures.
-- kselftest dependency checker script argument parsing.
----------------------------------------------------------------
Björn Töpel (2):
kselftest/runner.sh: Propagate SIGTERM to runner child
selftests: Keep symlinks, when possible
Ricardo B. Marliere (1):
selftests: fix dependency checker script
Zheng Yejian (1):
selftests/ftrace: Correctly enable event in instance-event.tc
.../ftrace/test.d/instances/instance-event.tc | 2 +-
tools/testing/selftests/kselftest/runner.sh | 3 +-
tools/testing/selftests/kselftest_deps.sh | 77 ++++++++++++++++++----
tools/testing/selftests/lib.mk | 4 +-
4 files changed, 70 insertions(+), 16 deletions(-)
----------------------------------------------------------------
Hello,
kernel test robot noticed "kernel-selftests.openat2.resolve_test.fail" on:
commit: 58e2847ad2e6322a25dedf8b4549ff924baf8395 ("selftests: line buffer test program's stdout")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
[test failed on linus/master 0bb80ecc33a8fb5a682236443c1e740d5c917d1d]
[test failed on linux-next/master 7bc675554773f09d88101bf1ccfc8537dc7c0be9]
in testcase: kernel-selftests
version: kernel-selftests-x86_64-60acb023-1_20230329
with following parameters:
group: group-02
compiler: gcc-12
test machine: 36 threads 1 sockets Intel(R) Core(TM) i9-10980XE CPU @ 3.00GHz (Cascade Lake) with 32G memory
(please refer to attached dmesg/kmsg for entire log/backtrace)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang(a)intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202309121342.97e2f008-oliver.sang@intel.com
besides kernel-selftests.openat2.resolve_test, we also observed
ea09800bf17561a0 58e2847ad2e6322a25dedf8b454
---------------- ---------------------------
fail:runs %reproduction fail:runs
| | |
:6 100% 6:6 kernel-selftests.openat2.openat2_test.fail
:6 100% 6:6 kernel-selftests.openat2.resolve_test.fail
which pass on parent commit.
however, there are other tests such like below "perf_events: sigtrap_threads"
are not impacted by this commit.
we want to consult with you if there is some special config need to do after
this commit? Thanks a lot!
TAP version 13
1..3
# timeout set to 300
# selftests: openat2: openat2_test
# ==4052==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
not ok 1 selftests: openat2: openat2_test # exit=1
# timeout set to 300
# selftests: openat2: resolve_test
# ==4070==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
not ok 2 selftests: openat2: resolve_test # exit=1
...
TAP version 13
1..2
# timeout set to 120
# selftests: perf_events: sigtrap_threads
# TAP version 13
# 1..5
# # Starting 5 tests from 1 test cases.
# # RUN sigtrap_threads.remain_disabled ...
# # OK sigtrap_threads.remain_disabled
# ok 1 sigtrap_threads.remain_disabled
...
The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20230912/202309121342.97e2f008-oliv…
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki