Skip to content

Commit 1d49e8c

Browse files
committed
reboot-limit: add kexec comparison feature
Add comprehensive support for comparing regular reboots vs kexec reboots in the reboot-limit workflow. This enables users to test both reboot types sequentially and compare their performance characteristics. New defconfigs: - reboot-limit-kexec: Configure for kexec-only testing - reboot-limit-compare: Configure for comparison mode testing New Kconfig options: - REBOOT_LIMIT_TYPE_COMPARE_BOTH: Test both regular and kexec reboots - REBOOT_LIMIT_DATA_REGULAR/KEXEC: Separate data paths for comparison Workflow enhancements: - Sequential testing: regular reboot first, then kexec - Separate statistics collection for each reboot type - Enhanced data organization with regular/ and kexec/ subdirectories Analysis improvements: - Automatic comparison mode detection - Side-by-side performance analysis - Speedup calculation and visualization - Comprehensive comparative graphs showing both boot types Usage: make defconfig-reboot-limit-compare make bringup make reboot-limit-tests make reboot-limit-graph Generated-by: Claude AI Reviewed-by: Chuck Lever <[email protected]> Signed-off-by: Claude AI <[email protected]>
1 parent 32b7305 commit 1d49e8c

File tree

14 files changed

+830
-30
lines changed

14 files changed

+830
-30
lines changed

defconfigs/reboot-limit-compare

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Demo defconfig for reboot-limit workflow with comparison testing
2+
#
3+
# This enables the reboot-limit workflow to compare regular reboots
4+
# vs kexec reboots with separate performance monitoring and analysis.
5+
6+
# Enable workflows and reboot-limit workflow
7+
CONFIG_WORKFLOWS=y
8+
CONFIG_WORKFLOWS_TESTS=y
9+
CONFIG_WORKFLOWS_TESTS_DEMOS=y
10+
CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
11+
CONFIG_WORKFLOWS_REBOOT_LIMIT=y
12+
13+
# Enable baseline and dev testing
14+
CONFIG_KDEVOPS_BASELINE_AND_DEV=y
15+
16+
# Enable data collection for analysis
17+
CONFIG_REBOOT_LIMIT_ENABLE_DATA_COLLECTION=y
18+
CONFIG_REBOOT_LIMIT_ENABLE_SYSTEMD_ANALYZE=y
19+
20+
# Enable loop testing for continuous operation
21+
CONFIG_REBOOT_LIMIT_ENABLE_LOOP=y
22+
CONFIG_REBOOT_LIMIT_LOOP_STEADY_STATE_GOAL=100
23+
24+
# Set a reasonable number of reboots per test run
25+
CONFIG_REBOOT_LIMIT_BOOT_MAX=100
26+
27+
# Use comparison mode to test both regular and kexec reboots
28+
CONFIG_REBOOT_LIMIT_TYPE_COMPARE_BOTH=y
29+
30+
# We'll build our kernel
31+
CONFIG_WORKFLOW_LINUX_CUSTOM=y
32+
CONFIG_BOOTLINUX=y
33+
CONFIG_BOOTLINUX_9P=y
34+
35+
# Enable A/B testing with different kernel references
36+
CONFIG_BOOTLINUX_AB_DIFFERENT_REF=y

defconfigs/reboot-limit-kexec

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Demo defconfig for reboot-limit workflow with kexec
2+
#
3+
# This enables the reboot-limit workflow for system stability testing
4+
# through continuous kexec reboots with performance monitoring.
5+
6+
# Enable workflows and reboot-limit workflow
7+
CONFIG_WORKFLOWS=y
8+
CONFIG_WORKFLOWS_TESTS=y
9+
CONFIG_WORKFLOWS_TESTS_DEMOS=y
10+
CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
11+
CONFIG_WORKFLOWS_REBOOT_LIMIT=y
12+
13+
# Enable data collection for analysis
14+
CONFIG_REBOOT_LIMIT_ENABLE_DATA_COLLECTION=y
15+
CONFIG_REBOOT_LIMIT_ENABLE_SYSTEMD_ANALYZE=y
16+
17+
# Enable loop testing for continuous operation
18+
CONFIG_REBOOT_LIMIT_ENABLE_LOOP=y
19+
CONFIG_REBOOT_LIMIT_LOOP_STEADY_STATE_GOAL=100
20+
21+
# Set a reasonable number of reboots per test run
22+
CONFIG_REBOOT_LIMIT_BOOT_MAX=100
23+
24+
# Use kexec reboot method for faster rebooting
25+
CONFIG_REBOOT_LIMIT_TYPE_SYSTEMD_KEXEC=y
26+
27+
# Enable baseline and development nodes for A/B testing
28+
CONFIG_KDEVOPS_BASELINE_AND_DEV=y
29+
30+
# Storage configuration
31+
CONFIG_LIBVIRT_EXTRA_STORAGE_DRIVE_SIZE_SET_CUSTOM=y
32+
CONFIG_LIBVIRT_EXTRA_STORAGE_DRIVE_SIZE=20

playbooks/roles/gen_hosts/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ kdevops_workflow_enable_nfstest: false
2929
kdevops_workflow_enable_sysbench: false
3030
kdevops_workflow_enable_fio_tests: false
3131
kdevops_workflow_enable_mmtests: False
32+
workflows_reboot_limit: False
3233

3334
is_fstests: False
3435
fstests_fstyp: "bogus"

playbooks/roles/gen_hosts/tasks/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,19 @@
351351
- kdevops_workflow_enable_mmtests
352352
- ansible_hosts_template.stat.exists
353353

354+
- name: Generate the Ansible hosts file for a dedicated reboot-limit setup
355+
tags: [ 'hosts' ]
356+
template:
357+
src: "{{ kdevops_hosts_template }}"
358+
dest: "{{ ansible_cfg_inventory }}"
359+
force: yes
360+
trim_blocks: True
361+
lstrip_blocks: True
362+
when:
363+
- kdevops_workflows_dedicated_workflow
364+
- workflows_reboot_limit
365+
- ansible_hosts_template.stat.exists
366+
354367
- name: Verify if final host file exists
355368
stat:
356369
path: "{{ ansible_cfg_inventory }}"

playbooks/roles/gen_hosts/templates/hosts.j2

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,87 @@ Each workflow which has its own custom ansible host file generated should use
66
its own jinja2 template file and define its own ansible task for its generation.
77
#}
88
{% if kdevops_workflows_dedicated_workflow %}
9+
{% if workflows_reboot_limit %}
10+
[all]
11+
localhost ansible_connection=local
12+
{{ kdevops_host_prefix }}-reboot-limit
13+
{% if kdevops_baseline_and_dev %}
14+
{{ kdevops_host_prefix }}-reboot-limit-dev
15+
{% endif %}
16+
17+
[all:vars]
18+
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
19+
20+
[baseline]
21+
{{ kdevops_host_prefix }}-reboot-limit
22+
23+
[baseline:vars]
24+
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
25+
26+
{% if kdevops_baseline_and_dev %}
27+
[dev]
28+
{{ kdevops_host_prefix }}-reboot-limit-dev
29+
30+
[dev:vars]
31+
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
32+
33+
{% endif %}
34+
[reboot-limit]
35+
{{ kdevops_host_prefix }}-reboot-limit
36+
{% if kdevops_baseline_and_dev %}
37+
{{ kdevops_host_prefix }}-reboot-limit-dev
38+
{% endif %}
39+
40+
[reboot-limit:vars]
41+
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
42+
{% else %}
943
[all]
1044
localhost ansible_connection=local
1145
write-your-own-template-for-your-workflow-and-task
46+
{% endif %}
1247
{% else %}
1348
[all]
1449
localhost ansible_connection=local
15-
{{ kdevops_hosts_prefix }}
50+
{{ kdevops_host_prefix }}
1651
{% if kdevops_baseline_and_dev == True %}
17-
{{ kdevops_hosts_prefix }}-dev
52+
{{ kdevops_host_prefix }}-dev
1853
{% endif %}
1954
{% if kdevops_enable_iscsi %}
20-
{{ kdevops_hosts_prefix }}-iscsi
55+
{{ kdevops_host_prefix }}-iscsi
2156
{% endif %}
2257
{% if kdevops_nfsd_enable %}
23-
{{ kdevops_hosts_prefix }}-nfsd
58+
{{ kdevops_host_prefix }}-nfsd
2459
{% endif %}
2560
[all:vars]
2661
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
2762
[baseline]
28-
{{ kdevops_hosts_prefix }}
63+
{{ kdevops_host_prefix }}
2964
[baseline:vars]
3065
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
3166
[dev]
3267
{% if kdevops_baseline_and_dev %}
33-
{{ kdevops_hosts_prefix }}-dev
68+
{{ kdevops_host_prefix }}-dev
3469
{% endif %}
3570
[dev:vars]
3671
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
3772
{% if kdevops_enable_iscsi %}
3873
[iscsi]
39-
{{ kdevops_hosts_prefix }}-iscsi
74+
{{ kdevops_host_prefix }}-iscsi
4075
[iscsi:vars]
4176
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
4277
{% endif %}
4378
{% if kdevops_nfsd_enable %}
4479
[nfsd]
45-
{{ kdevops_hosts_prefix }}-nfsd
80+
{{ kdevops_host_prefix }}-nfsd
4681
[nfsd:vars]
4782
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
4883
{% endif %}
4984
[service]
5085
{% if kdevops_enable_iscsi %}
51-
{{ kdevops_hosts_prefix }}-iscsi
86+
{{ kdevops_host_prefix }}-iscsi
5287
{% endif %}
5388
{% if kdevops_nfsd_enable %}
54-
{{ kdevops_hosts_prefix }}-nfsd
89+
{{ kdevops_host_prefix }}-nfsd
5590
{% endif %}
5691
[service:vars]
5792
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"

playbooks/roles/gen_nodes/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ kdevops_nfsd_enable: False
1616
kdevops_smbd_enable: False
1717
kdevops_krb5_enable: False
1818
kdevops_enable_iscsi: false
19+
workflows_reboot_limit: False
1920

2021
virtualbox_provider: False
2122
libvirt_provider: False

playbooks/roles/gen_nodes/tasks/main.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,38 @@
558558
- kdevops_workflow_enable_mmtests
559559
- ansible_nodes_template.stat.exists
560560

561+
- name: Generate the reboot-limit kdevops nodes file using {{ kdevops_nodes_template }} as jinja2 source template
562+
tags: [ 'hosts' ]
563+
vars:
564+
node_template: "{{ kdevops_nodes_template | basename }}"
565+
nodes: "{{ [kdevops_host_prefix + '-reboot-limit'] }}"
566+
all_generic_nodes: "{{ [kdevops_host_prefix + '-reboot-limit'] }}"
567+
template:
568+
src: "{{ node_template }}"
569+
dest: "{{ topdir_path }}/{{ kdevops_nodes }}"
570+
force: yes
571+
when:
572+
- kdevops_workflows_dedicated_workflow
573+
- workflows_reboot_limit
574+
- ansible_nodes_template.stat.exists
575+
- not kdevops_baseline_and_dev
576+
577+
- name: Generate the reboot-limit kdevops nodes file with dev hosts using {{ kdevops_nodes_template }} as jinja2 source template
578+
tags: [ 'hosts' ]
579+
vars:
580+
node_template: "{{ kdevops_nodes_template | basename }}"
581+
nodes: "{{ [kdevops_host_prefix + '-reboot-limit', kdevops_host_prefix + '-reboot-limit-dev'] }}"
582+
all_generic_nodes: "{{ [kdevops_host_prefix + '-reboot-limit', kdevops_host_prefix + '-reboot-limit-dev'] }}"
583+
template:
584+
src: "{{ node_template }}"
585+
dest: "{{ topdir_path }}/{{ kdevops_nodes }}"
586+
force: yes
587+
when:
588+
- kdevops_workflows_dedicated_workflow
589+
- workflows_reboot_limit
590+
- ansible_nodes_template.stat.exists
591+
- kdevops_baseline_and_dev
592+
561593
- name: Get the control host's timezone
562594
ansible.builtin.command: "timedatectl show -p Timezone --value"
563595
register: kdevops_host_timezone
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
# This task performs both regular and kexec reboots sequentially for comparison
3+
- name: Print uname for each host
4+
tags: [ 'run_tests' ]
5+
debug: var=ansible_kernel
6+
7+
- name: Hint to our watchdog our reboot-limit comparison tests are about to kick off
8+
local_action: file path="{{ reboot_limit_local_results_dir }}/.begin" state=touch
9+
tags: [ 'run_tests' ]
10+
run_once: true
11+
12+
# Phase 1: Regular reboot test
13+
- name: Starting Phase 1 - Regular reboot test ({{ reboot_num }} of {{ reboot_limit_max }})
14+
debug:
15+
msg: "Starting regular reboot test - reboot {{ reboot_num }} of {{ reboot_limit_max }}"
16+
tags: [ 'run_tests' ]
17+
18+
- name: Run the regular reboot test using the ansible reboot module
19+
become: yes
20+
become_method: sudo
21+
reboot:
22+
post_reboot_delay: 10
23+
tags: [ 'run_tests' ]
24+
25+
- name: Handle regular reboot count and data collection
26+
include_tasks: handle-reboot-data.yml
27+
vars:
28+
reboot_type: "regular"
29+
data_path: "{{ reboot_limit_data_regular }}"
30+
tags: [ 'run_tests' ]
31+
32+
# Phase 2: Kexec reboot test
33+
- name: Starting Phase 2 - Kexec reboot test ({{ reboot_num }} of {{ reboot_limit_max }})
34+
debug:
35+
msg: "Starting kexec reboot test - reboot {{ reboot_num }} of {{ reboot_limit_max }}"
36+
tags: [ 'run_tests' ]
37+
38+
# Kexec preparation tasks
39+
- name: Get current kernel version for kexec
40+
command: uname -r
41+
register: current_kernel_version
42+
tags: [ 'run_tests' ]
43+
44+
- name: Check for kernel image locations for kexec
45+
stat:
46+
path: "{{ kernel_path }}"
47+
register: kernel_stat
48+
loop:
49+
- "/boot/vmlinuz-{{ current_kernel_version.stdout }}"
50+
- "/boot/vmlinux-{{ current_kernel_version.stdout }}"
51+
- "/boot/kernel-{{ current_kernel_version.stdout }}"
52+
loop_control:
53+
loop_var: kernel_path
54+
when:
55+
- current_kernel_version is defined
56+
tags: [ 'run_tests' ]
57+
58+
- name: Set kernel path for kexec
59+
set_fact:
60+
kexec_kernel_path: "{{ kernel_item.stat.path }}"
61+
loop: "{{ kernel_stat.results }}"
62+
loop_control:
63+
loop_var: kernel_item
64+
when:
65+
- kernel_item.stat.exists
66+
tags: [ 'run_tests' ]
67+
68+
- name: Check for initrd/initramfs locations for kexec
69+
stat:
70+
path: "{{ initrd_path }}"
71+
register: initrd_stat
72+
loop:
73+
- "/boot/initrd.img-{{ current_kernel_version.stdout }}"
74+
- "/boot/initramfs-{{ current_kernel_version.stdout }}.img"
75+
- "/boot/initrd-{{ current_kernel_version.stdout }}"
76+
- "/boot/initrd-{{ current_kernel_version.stdout }}.img"
77+
loop_control:
78+
loop_var: initrd_path
79+
when:
80+
- current_kernel_version is defined
81+
tags: [ 'run_tests' ]
82+
83+
- name: Set initrd path for kexec
84+
set_fact:
85+
kexec_initrd_path: "{{ initrd_item.stat.path }}"
86+
loop: "{{ initrd_stat.results }}"
87+
loop_control:
88+
loop_var: initrd_item
89+
when:
90+
- initrd_item.stat.exists
91+
tags: [ 'run_tests' ]
92+
93+
- name: Read current kernel command line for kexec
94+
slurp:
95+
src: /proc/cmdline
96+
register: cmdline_content
97+
tags: [ 'run_tests' ]
98+
99+
- name: Load kernel into kexec
100+
become: yes
101+
become_method: sudo
102+
command: >
103+
kexec -l {{ kexec_kernel_path }}
104+
--initrd={{ kexec_initrd_path }}
105+
--command-line="{{ cmdline_content.content | b64decode | trim }}"
106+
when:
107+
- kexec_kernel_path is defined
108+
- kexec_initrd_path is defined
109+
tags: [ 'run_tests' ]
110+
111+
- name: Run the kexec reboot test using systemctl kexec
112+
become: yes
113+
become_method: sudo
114+
reboot:
115+
msg: "Rebooting system via systemctl kexec for reboot-limit comparison test"
116+
reboot_command: "systemctl kexec"
117+
post_reboot_delay: 10
118+
reboot_timeout: 300
119+
tags: [ 'run_tests' ]
120+
121+
- name: Handle kexec reboot count and data collection
122+
include_tasks: handle-reboot-data.yml
123+
vars:
124+
reboot_type: "kexec"
125+
data_path: "{{ reboot_limit_data_kexec }}"
126+
tags: [ 'run_tests' ]

0 commit comments

Comments
 (0)