From owner-svn-src-head@freebsd.org Sun Mar 1 21:58:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D206524F7B9; Sun, 1 Mar 2020 21:58:19 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Vxwq4hGBz4XrL; Sun, 1 Mar 2020 21:58:19 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 7314C9757; Sun, 1 Mar 2020 21:58:19 +0000 (UTC) From: Jan Beich To: Mark Johnston Cc: Emmanuel Vadot , Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r358363 - head/sys/vm References: <202002270237.01R2bRLJ023799@repo.freebsd.org> <20200229212411.1e6aed2d49d6644937b78452@bidouilliste.com> <20200301212537.GA33873@raichu> Date: Sun, 01 Mar 2020 22:58:17 +0100 In-Reply-To: <20200301212537.GA33873@raichu> (Mark Johnston's message of "Sun, 1 Mar 2020 16:25:37 -0500") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2020 21:58:19 -0000 Mark Johnston writes: > On Sat, Feb 29, 2020 at 09:24:11PM +0100, Emmanuel Vadot wrote: > >> >> Hi Jeff, >> >> On Thu, 27 Feb 2020 02:37:27 +0000 (UTC) >> Jeff Roberson wrote: >> >> > Author: jeff >> > Date: Thu Feb 27 02:37:27 2020 >> > New Revision: 358363 >> > URL: https://svnweb.freebsd.org/changeset/base/358363 >> > >> > Log: >> > Add unlocked grab* function variants that use lockless radix code to >> > lookup pages. These variants will fall back to their locked counterparts >> > if the page is not present. >> > >> > Discussed with: kib, markj >> > Differential Revision: https://reviews.freebsd.org/D23449 >> > >> > Modified: >> > head/sys/vm/vm_page.c >> > head/sys/vm/vm_page.h >> > >> >> We're (jbeich@ and me) seeing wired memory leak since this commit. >> A simple way to reproduce is to have drm-kmod (either 4.16 or 5.0) and >> liba-intel-driver/libva-intel-media-driver and start mpv in a loop : >> >> while mpv --hwdec=vaapi --start=10.0 --end=10.1 /path/to/file ; do >> done >> >> Reverting this commit on one of my test machine shows that this is the >> culprit. >> If you need anymore info/debug let me know. >> >> Thanks. > > Could you give this patch a try? > > diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c > index 9d50881ed27e..41e7a5bb3099 100644 > --- a/sys/vm/vm_page.c > +++ b/sys/vm/vm_page.c > @@ -4535,7 +4535,8 @@ vm_page_grab_valid(vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, int al > (VM_ALLOC_NOWAIT | VM_ALLOC_WAITFAIL | VM_ALLOC_ZERO)) == 0, > ("vm_page_grab_valid: Invalid flags 0x%X", allocflags)); > VM_OBJECT_ASSERT_WLOCKED(object); > - pflags = allocflags & ~(VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY); > + pflags = allocflags & ~(VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY | > + VM_ALLOC_WIRED); > pflags |= VM_ALLOC_WAITFAIL; > > retrylookup: I confirm, the patch fixes the issue. After trying to reproduce for a few minutes Wired doesn't grow several times larger than ARC Total. Mem: 1151M Active, 300M Inact, 41M Laundry, 3417M Wired, 57G Free ARC: 2020M Total, 861M MFU, 992M MRU, 3512K Anon, 23M Header, 140M Other 711M Compressed, 1311M Uncompressed, 1.84:1 Ratio