Cleaning up after tests is implemented separately for individual tests
and called at the end of each test execution. Since these functions are
very similar and a more generalized test framework was introduced a
function pointer in the resctrl_test struct can be used to reduce the
amount of function calls.
These functions are also all called in the ctrl-c handler because the
handler isn't aware which test is currently running. Since the handler
is implemented with a sigaction no function parameters can be passed
there but information about what test is currently running can be passed
with a global variable.
Changelog v2:
- Make current_test a const pointer limited in scope to resctrl_val
file.
- Remove tests_cleanup from resctrl.h.
- Cleanup 'goto out' path and labels in individual test functions.
Older versions of this series:
[v1] https://lore.kernel.org/all/cover.1708434017.git.maciej.wieczor-retman@inte…
Maciej Wieczor-Retman (3):
selftests/resctrl: Add cleanup function to test framework
selftests/resctrl: Simplify cleanup in ctrl-c handler
selftests/resctrl: Move cleanups out of individual tests
tools/testing/selftests/resctrl/cat_test.c | 8 +++-----
tools/testing/selftests/resctrl/cmt_test.c | 4 ++--
tools/testing/selftests/resctrl/mba_test.c | 8 +++-----
tools/testing/selftests/resctrl/mbm_test.c | 8 +++-----
tools/testing/selftests/resctrl/resctrl.h | 9 +++------
tools/testing/selftests/resctrl/resctrl_tests.c | 16 +++++-----------
tools/testing/selftests/resctrl/resctrl_val.c | 6 ++++--
7 files changed, 23 insertions(+), 36 deletions(-)
--
2.43.2
On 2/21/24 07:44, Nicolai Stange wrote:
> Shresth Prasad <shresthprasad7(a)gmail.com> writes:
>
>> I checked the source code and yes I am on the latest Linux next repo.
>>
>> Here's the warning:
>> /home/shresthp/dev/linux_work/linux_next/tools/testing/selftests/livepatch/test_modules/test_klp_state.c:38:24: warning: assignment to ‘struct klp_state *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>> 38 | loglevel_state = klp_get_state(&patch, CONSOLE_LOGLEVEL_STATE);
>> | ^
>
>
> Is the declaration of klp_get_state() visible at that point, i.e. is
> there perhaps any warning about missing declarations above that?
>
> Otherwise C rules would default to assume an 'int' return type.
>
This is an interesting clue. I thought I might be able to reproduce the
build error by modifying include/livepatch.h and running `make -j15 -C
tools/testing/selftests/livepatch` ... but that seemed to work fine on
my system. I even removed the entire include/ subdir from my tree and
it still built the test module. Huh?
Then I moved /lib/modules/$(uname -r)/build out of the way and saw that
the compilation failed. Ah hah -- that's right, it's using the system
build tree. That version of livepatch.h may have a missing or
completely different definition of klp_get_state().
How does this sequence work for you, Shresth:
# Verify that kernel livepatching is turned on
$ grep LIVEPATCH .config
CONFIG_HAVE_LIVEPATCH=y
CONFIG_LIVEPATCH=y
# Build linux-next kernel tree and then the livepatch selftests,
# pointing KDIR to this tree
$ make -j$(nproc) vmlinux && \
make -j$(nproc) KDIR=$(pwd) -C tools/testing/selftests/livepatch
--
Joe
Changelog:
v3:
* More cleanup (patch 3) (suggested by Yosry Ahmed).
* Check swap peak in swapin test
v2:
* Make the swapin test also checks for zswap usage (patch 3)
(suggested by Yosry Ahmed)
* Some test simplifications/cleanups (patch 3)
(suggested by Yosry Ahmed).
Fix a broken zswap kselftest due to cgroup zswap writeback counter
renaming, and add 2 zswap kselftests, one to cover the (z)swapin case,
and another to check that no zswapping happens when the cgroup limit is
0.
Also, add the zswap kselftest file to zswap maintainer entry so that
get_maintainers script can find zswap maintainers.
Nhat Pham (3):
selftests: zswap: add zswap selftest file to zswap maintainer entry
selftests: fix the zswap invasive shrink test
selftests: add zswapin and no zswap tests
MAINTAINERS | 1 +
tools/testing/selftests/cgroup/test_zswap.c | 122 +++++++++++++++++++-
2 files changed, 121 insertions(+), 2 deletions(-)
base-commit: 91f3daa1765ee4e0c89987dc25f72c40f07af34d
--
2.39.3
There are multiple bugs in tls_sw_recvmsg's handling of record types
when MSG_PEEK flag is used, which can lead to incorrectly merging two
records:
- consecutive non-DATA records shouldn't be merged, even if they're
the same type (partly handled by the test at the end of the main
loop)
- records of the same type (even DATA) shouldn't be merged if one
record of a different type comes in between
Sabrina Dubroca (5):
tls: break out of main loop when PEEK gets a non-data record
tls: stop recv() if initial process_rx_list gave us non-DATA
tls: don't skip over different type records from the rx_list
selftests: tls: add test for merging of same-type control messages
selftests: tls: add test for peeking past a record of a different type
net/tls/tls_sw.c | 24 +++++++++++------
tools/testing/selftests/net/tls.c | 45 +++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 8 deletions(-)
--
2.43.0
Resending misc fixes for DAMON selftets on behalf of the original
authors for more visibility and inclusion on mm tree.
The patches are same to their original versions, except added Links: for
the original posts, and Signed-off-by: of mine.
Javier Carrasco (1):
selftests: damon: add access_memory to .gitignore
Vincenzo Mezzela (1):
selftest: damon: fix minor typos in test logs
tools/testing/selftests/damon/.gitignore | 1 +
.../selftests/damon/sysfs_update_schemes_tried_regions_hang.py | 2 +-
.../damon/sysfs_update_schemes_tried_regions_wss_estimation.py | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
--
2.39.2
The series is a host of cleanups to the openvswitch selftest suite
which should be ready to run under the netdev selftest runners using
vng. For now, the testing has been done with RW directories, but
additional testing will be done to try and keep it all as RO to be
more friendly.
There is one more test case I plan which will print the debug log
details when a test case fails so that a developer can get a clear
picture why the test case failed. That will be done for the proper
submission as another patch in this series.
Additionally, the timeout setting was just an arbitrary number that
I picked, but needs more testing to tune it properly (since 5
minutes may be a bit too long).
Tested on fedora 38 using virtme-ng with the following commandline:
../virtme-ng/vng -v --run . --user root --cpus 4 \
--rwdir=/home/aconole/git/linux/tools/testing/selftests/net/openvswitch/ \
-- \
make -C tools/testing/selftests/net/openvswitch \
TARGETS=openvswitch TEST_PROGS=openvswitch.sh run_tests
Aaron Conole (7):
selftests: openvswitch: add test case error directories to clean list
selftests: openvswitch: be more verbose with selftest debugging
selftests: openvswitch: use non-graceful kills when needed
selftests: openvswitch: delete previously allocated netns
selftests: openvswitch: make arping test a bit 'slower'
selftests: openvswitch: insert module when running the tests
selftests: openvswitch: add config and timeout settings
.../selftests/net/openvswitch/Makefile | 12 ++++-
.../testing/selftests/net/openvswitch/config | 50 +++++++++++++++++++
.../selftests/net/openvswitch/openvswitch.sh | 33 +++++++++---
.../selftests/net/openvswitch/settings | 1 +
4 files changed, 89 insertions(+), 7 deletions(-)
create mode 100644 tools/testing/selftests/net/openvswitch/config
create mode 100644 tools/testing/selftests/net/openvswitch/settings
--
2.41.0
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 from V13->V14:
- cpufreq:
- - fix build error without CONFIG_CPU_FREQ
- ACPI: CPPC:
Changes from V12->V13:
- ACPI: CPPC:
- - modify commit message.
- - modify handle function of the notify(0x85).
- cpufreq: amd-pstate:
- - implement update_limits() callback function.
- x86:
- - pick up Acked-By flag added by Petkov.
Changes from V11->V12:
- all:
- - pick up Reviewed-By flag added by Perry.
- cpufreq: amd-pstate:
- - rebase the latest linux-next and fixed conflicts.
- - fixed the issue about cpudata without init in amd_pstate_update_highest_perf().
Changes from V10->V11:
- cpufreq: amd-pstate:
- - according Perry's commnts, I replace the string with str_enabled_disable().
Changes from V9->V10:
- cpufreq: amd-pstate:
- - add judgement for highest_perf. When it is less than 255, the
preferred core feature is enabled. And it will set the priority.
- - deleset "static u32 max_highest_perf" etc, because amd p-state
perferred coe does not require specail process for hotpulg.
Changes form V8->V9:
- all:
- - pick up Tested-By flag added by Oleksandr.
- cpufreq: amd-pstate:
- - pick up Review-By flag added by Wyes.
- - ignore modification of bug.
- - add a attribute of prefcore_ranking.
- - modify data type conversion from u32 to int.
- Documentation: amd-pstate:
- - pick up Review-By flag added by Wyes.
Changes form V7->V8:
- all:
- - pick up Review-By flag added by Mario and Ray.
- cpufreq: amd-pstate:
- - use hw_prefcore embeds into cpudata structure.
- - delete preferred core init from cpu online/off.
Changes form V6->V7:
- x86:
- - Modify kconfig about X86_AMD_PSTATE.
- cpufreq: amd-pstate:
- - modify incorrect comments about scheduler_work().
- - convert highest_perf data type.
- - modify preferred core init when cpu init and online.
- ACPI: CPPC:
- - modify link of CPPC highest performance.
- cpufreq:
- - modify link of CPPC highest performance changed.
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 | 59 +++++-
arch/x86/Kconfig | 5 +-
drivers/acpi/cppc_acpi.c | 13 ++
drivers/acpi/processor_driver.c | 6 +
drivers/cpufreq/amd-pstate.c | 183 +++++++++++++++++-
include/acpi/cppc_acpi.h | 5 +
include/linux/amd-pstate.h | 10 +
include/linux/cpufreq.h | 1 +
9 files changed, 275 insertions(+), 12 deletions(-)
--
2.34.1