Skip to content

Commit 73a2da3

Browse files
committed
mmtests: add support for Mel Gorman's mmtests
The mmtest test suite used for production memory management testing. Add support for it, first with two target workflows to help evaluate memory fragmentation. We add support for the workloads which helped reproduce memory fragmentation easily back in year 2010 when Mel Gorman first added Linux kernel memory compaction support [0] merged on v2.6.35. * thpcompact * thpchallenge Generated-by: Claude AI Link: https://lore.kernel.org/all/1270224168-14775-1-git-send-email-mel@csn.ul.ie/T/#u # [0] Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
1 parent 5fcf2f7 commit 73a2da3

27 files changed

Lines changed: 1533 additions & 0 deletions

File tree

kconfigs/Kconfig.defaults

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ config DEFAULT_MODULES_HTTPS_GOOGLE_URL
116116
string
117117
default "https://kernel.googlesource.com/pub/scm/linux/kernel/git/modules/linux.git"
118118

119+
config DEFAULT_MMTESTS_GITHUB_HTTPS_URL
120+
string
121+
default "https://github.com/gormanm/mmtests.git"
122+
119123
config DEFAULT_MCGROF_LINUS_GIT_URL
120124
string
121125
default "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git"

kconfigs/Kconfig.mirror

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,5 +657,24 @@ config MIRROR_XFSPROGS_URL
657657
string
658658
default DEFAULT_XFSPROGS_URL
659659

660+
choice
661+
prompt "Tools - mmtests.git mirror protocol/source"
662+
default MIRROR_MMTESTS_HTTPS_GITHUB
663+
depends on INSTALL_LOCAL_LINUX_MIRROR
664+
665+
config MIRROR_MMTESTS_HTTPS_GITHUB
666+
bool "HTTPS (GitHub)"
667+
help
668+
If you enable this option then GitHub HTTPS will be used as the
669+
source of the mirror. The URL is:
670+
671+
https://github.com/gormanm/mmtests.git
672+
673+
endchoice
674+
675+
config MIRROR_MMTESTS_URL
676+
string
677+
default DEFAULT_MMTESTS_GITHUB_HTTPS_URL if MIRROR_MMTESTS_HTTPS_GITHUB
678+
660679
endif # ENABLE_LOCAL_LINUX_MIRROR
661680
endif # TERRAFORM

kconfigs/workflows/Kconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ config KDEVOPS_WORKFLOW_DEDICATE_SYSBENCH
182182
This will dedicate your configuration to running only the
183183
sysbench workflow.
184184

185+
config KDEVOPS_WORKFLOW_DEDICATE_MMTESTS
186+
bool "mmtests"
187+
select KDEVOPS_WORKFLOW_ENABLE_MMTESTS
188+
help
189+
This will dedicate your configuration to running only the
190+
mmtests workflow for memory fragmentation testing.
191+
185192
endchoice
186193

187194
config KDEVOPS_WORKFLOW_NAME
@@ -195,6 +202,7 @@ config KDEVOPS_WORKFLOW_NAME
195202
default "ltp" if KDEVOPS_WORKFLOW_DEDICATE_LTP
196203
default "nfstest" if KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
197204
default "sysbench" if KDEVOPS_WORKFLOW_DEDICATE_SYSBENCH
205+
default "mmtests" if KDEVOPS_WORKFLOW_DEDICATE_MMTESTS
198206

199207
endif
200208

@@ -288,6 +296,14 @@ config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_SYSBENCH
288296
Select this option if you want to provision sysbench on a
289297
single target node for by-hand testing.
290298

299+
config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_MMTESTS
300+
bool "mmtests"
301+
select KDEVOPS_WORKFLOW_ENABLE_MMTESTS
302+
depends on LIBVIRT || TERRAFORM_PRIVATE_NET
303+
help
304+
Select this option if you want to provision mmtests on a
305+
single target node for by-hand testing.
306+
291307
endif # !WORKFLOWS_DEDICATED_WORKFLOW
292308

293309
config KDEVOPS_WORKFLOW_ENABLE_FSTESTS
@@ -390,6 +406,17 @@ source "workflows/sysbench/Kconfig"
390406
endmenu
391407
endif # KDEVOPS_WORKFLOW_ENABLE_SYSBENCH
392408

409+
config KDEVOPS_WORKFLOW_ENABLE_MMTESTS
410+
bool
411+
output yaml
412+
default y if KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_MMTESTS || KDEVOPS_WORKFLOW_DEDICATE_MMTESTS
413+
414+
if KDEVOPS_WORKFLOW_ENABLE_MMTESTS
415+
menu "Configure and run the mmtests tests"
416+
source "workflows/mmtests/Kconfig"
417+
endmenu
418+
endif # KDEVOPS_WORKFLOW_ENABLE_MMTESTS
419+
393420
config KDEVOPS_WORKFLOW_ENABLE_SSD_STEADY_STATE
394421
bool "Attain SSD steady state prior to tests"
395422
output yaml

playbooks/mmtests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
- hosts: all
3+
roles:
4+
- role: mmtests

playbooks/roles/gen_hosts/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ kdevops_workflow_enable_gitr: False
2828
kdevops_workflow_enable_ltp: False
2929
kdevops_workflow_enable_nfstest: false
3030
kdevops_workflow_enable_sysbench: false
31+
kdevops_workflow_enable_mmtests: False
3132

3233
is_fstests: False
3334
fstests_fstyp: "bogus"

playbooks/roles/gen_hosts/tasks/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,33 @@
312312
- kdevops_workflow_enable_sysbench
313313
- ansible_hosts_template.stat.exists
314314

315+
- name: Infer enabled mmtests test types
316+
set_fact:
317+
mmtests_enabled_test_types: >-
318+
{{
319+
lookup('file', topdir_path + '/.config')
320+
| regex_findall('^CONFIG_MMTESTS_ENABLE_(.*)=y$', multiline=True)
321+
| map('lower')
322+
| list
323+
}}
324+
when:
325+
- kdevops_workflows_dedicated_workflow
326+
- kdevops_workflow_enable_mmtests
327+
- ansible_hosts_template.stat.exists
328+
329+
- name: Generate the Ansible hosts file for a dedicated mmtests setup
330+
tags: [ 'hosts' ]
331+
template:
332+
src: "{{ kdevops_hosts_template }}"
333+
dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
334+
force: yes
335+
trim_blocks: True
336+
lstrip_blocks: True
337+
when:
338+
- kdevops_workflows_dedicated_workflow
339+
- kdevops_workflow_enable_mmtests
340+
- ansible_hosts_template.stat.exists
341+
315342
- name: Verify if final host file exists
316343
stat:
317344
path: "{{ topdir_path }}/{{ kdevops_hosts }}"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[all]
2+
{% for test_type in mmtests_enabled_test_types %}
3+
{{ kdevops_host_prefix }}-{{ test_type }}
4+
{% if kdevops_baseline_and_dev %}
5+
{{ kdevops_host_prefix }}-{{ test_type }}-dev
6+
{% endif %}
7+
{% endfor %}
8+
[all:vars]
9+
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
10+
[baseline]
11+
{% for test_type in mmtests_enabled_test_types %}
12+
{{ kdevops_host_prefix }}-{{ test_type }}
13+
{% endfor %}
14+
[baseline:vars]
15+
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
16+
[dev]
17+
{% if kdevops_baseline_and_dev %}
18+
{% for test_type in mmtests_enabled_test_types %}
19+
{{ kdevops_host_prefix }}-{{ test_type }}-dev
20+
{% endfor %}
21+
{% endif %}
22+
[dev:vars]
23+
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
@@ -14,6 +14,7 @@ kdevops_workflow_enable_gitr: False
1414
kdevops_workflow_enable_ltp: False
1515
kdevops_workflow_enable_nfstest: false
1616
kdevops_workflow_enable_selftests: False
17+
kdevops_workflow_enable_mmtests: False
1718
kdevops_nfsd_enable: False
1819
kdevops_smbd_enable: False
1920
kdevops_krb5_enable: False

playbooks/roles/gen_nodes/tasks/main.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,56 @@
486486
- kdevops_workflow_enable_sysbench
487487
- ansible_nodes_template.stat.exists
488488

489+
- name: Infer enabled mmtests test section types
490+
set_fact:
491+
mmtests_enabled_test_types: >-
492+
{{
493+
[kdevops_host_prefix + '-']
494+
| product(
495+
lookup('file', topdir_path + '/.config')
496+
| regex_findall('^CONFIG_MMTESTS_ENABLE_(.*)=y$', multiline=True)
497+
| map('lower')
498+
| list
499+
)
500+
| map('join')
501+
| list
502+
}}
503+
when:
504+
- kdevops_workflows_dedicated_workflow
505+
- kdevops_workflow_enable_mmtests
506+
- ansible_nodes_template.stat.exists
507+
- not kdevops_baseline_and_dev
508+
509+
- name: Infer enabled mmtests test section types with dev hosts
510+
vars:
511+
kdevops_config_data: "{{ lookup('file', topdir_path + '/.config') }}"
512+
config_val: "CONFIG_MMTESTS_ENABLE_"
513+
config_mmtests_test_types: "{{ kdevops_config_data | regex_findall('^' + config_val + '(.*)=y$', multiline=True) }}"
514+
config_mmtests_test_type_names: "{{ config_mmtests_test_types | lower }}"
515+
all_nodes: "{{ [kdevops_host_prefix + '-'] | product(config_mmtests_test_type_names) | map('join') | list }}"
516+
set_fact:
517+
mmtests_enabled_test_types: "{{ all_nodes | product(['', '-dev']) | map('join') | list }}"
518+
when:
519+
- kdevops_workflows_dedicated_workflow
520+
- kdevops_workflow_enable_mmtests
521+
- ansible_nodes_template.stat.exists
522+
- kdevops_baseline_and_dev
523+
524+
- name: Generate the mmtests kdevops nodes file using {{ kdevops_nodes_template }} as jinja2 source template
525+
tags: [ 'hosts' ]
526+
vars:
527+
node_template: "{{ kdevops_nodes_template | basename }}"
528+
nodes: "{{ mmtests_enabled_test_types }}"
529+
all_generic_nodes: "{{ mmtests_enabled_test_types }}"
530+
template:
531+
src: "{{ node_template }}"
532+
dest: "{{ topdir_path }}/{{ kdevops_nodes }}"
533+
force: yes
534+
when:
535+
- kdevops_workflows_dedicated_workflow
536+
- kdevops_workflow_enable_mmtests
537+
- ansible_nodes_template.stat.exists
538+
489539
- name: Get the control host's timezone
490540
ansible.builtin.command: "timedatectl show -p Timezone --value"
491541
register: kdevops_host_timezone

playbooks/roles/linux-mirror/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ defaults_dbench_git: "https://github.com/linux-kdevops/dbench.git"
1010
defaults_kdevops_results_archive_git: "https://github.com/linux-kdevops/kdevops-results-archive.git"
1111
defaults_git_git: "https://git.kernel.org/pub/scm/git/git.git"
1212
defaults_ltp_git: "https://github.com/linux-test-project/ltp.git"
13+
defaults_mmtests_git: "https://github.com/gormanm/mmtests.git"
1314
defaults_nfstest_git: "git://git.linux-nfs.org/projects/mora/nfstest.git"
1415
defaults_pynfs_git: "git://git.linux-nfs.org/projects/cdmackay/pynfs.git"
1516
defaults_xfsprogs_git: "https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git"

0 commit comments

Comments
 (0)