git: kernel - Implement a more comprehensive low-memory deadlock solution
Matthew Dillon
dillon at crater.dragonflybsd.org
Thu Aug 24 22:32:41 PDT 2017
commit c3feb36a35386093f8f28e8a125eab625bf825d3
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Thu Aug 24 22:25:02 2017 -0700
kernel - Implement a more comprehensive low-memory deadlock solution
* Low memory deadlocks occur when the pageout daemon needs memory
resources that the kernel cannot provide. The pageout daemon itself
is given more of an emergency reserve than other threads, but this
is not sufficient.
The complex nature of VFS's, particularly sohpisticated filesystems,
can create situations where the pageout daemon gets stuck on locks
held by filesystem related threads which themselves are stuck waiting
for memory.
* Try to solve this problem by having two kernel pageout daemons. The
main daemon works as usual. The second daemon monitors the first
one looking for stalls and takes over if it detects one.
The second daemon will skip problematic vnodes and only pageout
anonymous memory. At some point the main daemon will unstick and
be able to resume normal operating.
* Paging anonymous memory is far less resource intensive than paging
through a vnode, so it is far more likely that the emergency daemon
will be able to make progress to resolve the low memory situation
when the primary daemon gets stuck.
Summary of changes:
sys/vm/vm_pageout.c | 201 ++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 181 insertions(+), 20 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c3feb36a35386093f8f28e8a125eab625bf825d3
--
DragonFly BSD source repository
More information about the Commits
mailing list