Skip to content

ZTS: Optimize KSM on Linux and remove it for FreeBSD #17247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mcmilk
Copy link
Contributor

@mcmilk mcmilk commented Apr 15, 2025

This patchset does:

Optimize KSM settings for Linux and disable it for FreeBSD

I reemoved the "Fix FreeBSD problem" with #16822 ... this should maybe go into a seperat PR.

System Before New latest
almalinux8 3h 25m 47s 3h 17m 23s 3h 18m 9s
almalinux9 3h 1m 9s 2h 48m 18s 2h 46m 41s
debian11 3h 31m 43s 3h 12m 58s 3h 16m 35s
debian12 2h 58m 27s 2h 33m 33s 2h 38m 44s
fedora40 3h 2m 11s 2h 43m 19s 2h 48m 50s
fedora41 3h 0m 8s 2h 41m 21s 2h 37m 37s
fedora42 2h 55m 35s 2h 41m 40s 2h 41m 44s
freebsd13-4r 2h 15m 55s 1h 43m 33s 1h 43m 22s
freebsd14-2r 2h 16m 32s 1h 44m 40s 1h 46m 48s
freebsd15-0c 3h 33m 55s 2h 20m 53s 2h 16m 30s
ubuntu20 3h 9m 18s 2h 58m 12s 2h 58m 33s
ubuntu22 3h 44m 4s 3h 28m 41s 3h 37m 23s
ubuntu24 3h 6m 6s 2h 50m 37s 2h 47m 55s
total 1d 16h 1m 13s 1d 11h 5m 34s 1d 11h 19m 18s

Motivation and Context

Some ZTS test runs fail because of memory pressure. This PR tries to fix this.

Description

All commits have the needed infos ;-)

How Has This Been Tested?

Tried here and there, until the result was stable and the times went down ;)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@tonyhutter
Copy link
Contributor

Free kernel caches on Linux VMs via cron, to get more usable memory on them.

For Linux, you might be better off playing with some of the virtual memory tunables on either the runner or the VMs. For example, have you tried setting vm.min_free_kbytes to higher values?

@mcmilk
Copy link
Contributor Author

mcmilk commented Apr 16, 2025

Free kernel caches on Linux VMs via cron, to get more usable memory on them.

For Linux, you might be better off playing with some of the virtual memory tunables on either the runner or the VMs. For example, have you tried setting vm.min_free_kbytes to higher values?

Yes, I am trying to guess - which screw I should turn.... this is a first try.

Edit: Changing vm.min_free_kbytes didn't work out very well ... :(

@mcmilk mcmilk changed the title ZTS: optimize ksmtuned settings ZTS: Optimize ksm, Update FreeBSD variants and Ubuntu mirror Apr 22, 2025
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we commit the version updates independently before jumping into optimizations? I'd really like to see FreeBSD 15 to finally coming clean, while the VM management changes look less straightforward.

@mcmilk
Copy link
Contributor Author

mcmilk commented Apr 22, 2025

Could we commit the version updates independently before jumping into optimizations? I'd really like to see FreeBSD 15 to finally coming clean, while the VM management changes look less straightforward.

Should I create a seperate PR for this?

@amotin
Copy link
Member

amotin commented Apr 22, 2025

Could we commit the version updates independently before jumping into optimizations? I'd really like to see FreeBSD 15 to finally coming clean, while the VM management changes look less straightforward.

Should I create a seperate PR for this?

Yes, please. I'd be happy to merge it once it reasonably pass CI, hopefully in not too long, and then we could return to this one.

@tonyhutter
Copy link
Contributor

Just want to say that shaving 6 hours off the total run time is really impressive 👍

@mcmilk mcmilk changed the title ZTS: Optimize ksm, Update FreeBSD variants and Ubuntu mirror ZTS: Optimize ksm and limit page cache in test VMs Apr 23, 2025
@mcmilk mcmilk force-pushed the ksm-tuning branch 3 times, most recently from 0e05dfa to 24b9eba Compare April 25, 2025 06:33
@mcmilk mcmilk changed the title ZTS: Optimize ksm and limit page cache in test VMs ZTS: Optimize KSM and limit page cache in test VMs Apr 25, 2025
@mcmilk mcmilk changed the title ZTS: Optimize KSM and limit page cache in test VMs ZTS: Optimize KSM on Linux and remove it for FreeBSD Apr 27, 2025
@mcmilk mcmilk force-pushed the ksm-tuning branch 3 times, most recently from abf57e5 to 467705c Compare April 28, 2025 08:18
Don't use KSM on the FreeBSD VMs and optimize KSM settings for
Linux to have faster run times.

Signed-off-by: Tino Reichardt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants