Page MenuHomeFreeBSD

pageout fix
AbandonedPublic

Authored by jeff on Nov 30 2017, 5:42 PM.
Tags
None
Referenced Files
F132954491: D13308.id.diff
Tue, Oct 21, 12:11 PM
F132954488: D13308.id36013.diff
Tue, Oct 21, 12:11 PM
F132901336: D13308.diff
Tue, Oct 21, 12:30 AM
Unknown Object (File)
Tue, Sep 30, 2:14 AM
Unknown Object (File)
Sep 17 2025, 8:23 AM
Unknown Object (File)
Sep 17 2025, 7:48 AM
Unknown Object (File)
Sep 12 2025, 4:49 AM
Unknown Object (File)
Sep 11 2025, 8:26 AM
Subscribers

Details

Reviewers
imp
lm_mcvoy.com
Summary

In a recent numa meeting that Scott called, Jeff suggested a small
patch to the pageout daemon.

It's rather dramatic the difference it makes for me. If I arrange to
thrash the crap out of memory, without this patch the kernel is so
borked with all the processes in disk wait that I can't kill them,
I can't reboot, my only option is to power off.

With the patch there is still some borkage, the kernel is randomly
killing processes because of out of mem, it should kill one of my
processes that is causing the problem but it doesn't, it killed
random stuff like dhclient, getty (logged me out), etc.

But the system is responsive.

What the patch does is say "if we have more than one core, don't sleep
in pageout, just keep running until we freed enough mem".

Test Plan

That's a good question, is there a recipe for making the system thrash with no free memory?

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/vm/vm_pageout.c
1818โ€“1822

This comment needs some work. I'd suggest:

Sleep on a uniprocessor to allow completion threads to run for work we've scheduled. For MP, continue scanning since the other CPUs can complete the work in parallel. This increases our pageout rate, making the system more responsive when memory is being thrashed.

Or something similar.

sys/vm/vm_pageout.c
1825โ€“1826

Style wise this would be better written with && rather than nested conditions.

I'm not certain whether any other time based regulation in pageout will be unhappy with unhindered execution. Briefly looking at it, I don't think so, but Alan should look as well and we should do some testing.

jeff edited reviewers, added: lm_mcvoy.com; removed: jeff.

This has been resolved in current with a more complete fix.

Closing as it is already fixed.