Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Dec 2017 11:51:17 -0800
From:      Mark Johnston <markj@FreeBSD.org>
To:        Peter Holm <peter@holm.cc>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r327168 - head/sys/vm
Message-ID:  <20171225195117.GA68801@wkstn-mjohnston.west.isilon.com>
In-Reply-To: <20171225174946.GA9941@x2.osted.lan>
References:  <201712241945.vBOJjGV5051696@repo.freebsd.org> <20171225174946.GA9941@x2.osted.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 25, 2017 at 06:49:46PM +0100, Peter Holm wrote:
> On Sun, Dec 24, 2017 at 07:45:16PM +0000, Mark Johnston wrote:
> > Author: markj
> > Date: Sun Dec 24 19:45:16 2017
> > New Revision: 327168
> > URL: https://svnweb.freebsd.org/changeset/base/327168
> > 
> > Log:
> >   Fix two problems with the page daemon control loop.
> >   
> >   Both issues caused the page daemon to erroneously go to sleep when
> >   applications are consuming free pages at a high rate, leaving the
> >   application threads blocked in VM_WAIT.
> >   
> >   1) After completing an inactive queue scan, concurrent allocations may
> >      have prevented the page daemon from meeting the v_free_min threshold.
> >      In this case, the page daemon was going to sleep even when the
> >      inactive queue contained plenty of clean pages.
> >   2) pagedaemon_wakeup() may be called without the free queues lock held.
> >      This can lead to a lost wakeup if a call occurs after the page daemon
> >      clears vm_pageout_wanted but before going to sleep.
> >   
> >   Fix 1) by ensuring that we start a new inactive queue scan immediately
> >   if v_free_count < v_free_min after a prior scan.
> >   
> >   Fix 2) by adding a new subroutine, pagedaemon_wait(), called from
> >   vm_wait() and vm_waitpfault(). It wakes up the page daemon if either
> >   vm_pages_needed or vm_pageout_wanted is false, and atomically sleeps
> >   on v_free_count.
> >   
> >   Reported by:	jeff
> >   Reviewed by:	alc
> >   MFC after:	2 weeks
> >   Differential Revision:	https://reviews.freebsd.org/D13424
> > 
> > Modified:
> >   head/sys/vm/vm_page.c
> >   head/sys/vm/vm_pageout.c
> >   head/sys/vm/vm_pageout.h
> > 
> 
> I now see threads blocked in VM_WAIT?
> 
> https://people.freebsd.org/~pho/stress/log/mark013.txt

Hmm, I don't see anything obviously wrong here. v_free_count is 38, well
below the minimum threshold at which threads will block in VM_WAIT. The
page daemon was running and vm_pages_needed is 1, which is expected.
This just looks like a case of the page daemon failing to keep up with
memory pressure. Do you not see threads entering VM_WAIT with this
revision reverted?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171225195117.GA68801>