From owner-svn-src-all@freebsd.org Wed Sep 4 14:50:54 2019 Return-Path: Delivered-To: svn-src-all@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 B407EF4048; Wed, 4 Sep 2019 14:50:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46NmwG3lmxz4PtD; Wed, 4 Sep 2019 14:50:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1i5WcW-000O3S-O9; Wed, 04 Sep 2019 17:50:52 +0300 Date: Wed, 4 Sep 2019 17:50:52 +0300 From: Slawa Olhovchenkov To: Andriy Gapon Cc: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351673 - in head: lib/libmemstat share/man/man9 sys/cddl/compat/opensolaris/kern sys/kern sys/vm Message-ID: <20190904145052.GE3953@zxy.spb.ru> References: <201909012222.x81MMh0F022462@repo.freebsd.org> <79c74018-1329-ee69-3480-e2f99821fa93@FreeBSD.org> <20190903161427.GA38096@zxy.spb.ru> <20190903220106.GB26733@raichu> <8b049a33-e844-1a47-2be1-c267946b8f95@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8b049a33-e844-1a47-2be1-c267946b8f95@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 46NmwG3lmxz4PtD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.988,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Sep 2019 14:50:54 -0000 On Wed, Sep 04, 2019 at 09:27:00AM +0300, Andriy Gapon wrote: > On 04/09/2019 01:01, Mark Johnston wrote: > > Some of the vm_lowmem eventhandlers probably shouldn't be called each > > time the page daemon scans the inactive queue (every 0.1s under memory > > pressure). ufsdirhash_lowmem and mb_reclaim in particular don't seem > > like they need to be invoked very frequently. We could easily define > > multiple eventhandlers to differentiate between these cases, though. > > My proposal is to run uma_reclaim(UMA_RECLAIM_TRIM) before invoking vm_lowmem. > If that reclaims "enough" memory, then do not call vm_lowmem at all. > > Oh, and I have a related question. > Say, a zone has X items in use and Y items in cache. > After running vm_lowmem the composition changes to X - C and Y + C respectively. > Then we run uma_reclaim(UMA_RECLAIM_TRIM). > Question: is that guaranteed to free at least C items? > I am thinking about a possibility that the zone's workset size is estimated to > be at least X (and maybe even more than X + Y). In that case UMA_RECLAIM_TRIM > won't free those C items, they will stay in the cache. So, it seems like > releasing them was in vain, at least for the immediate reclaim. My goal is uma_reclaim(UMA_RECLAIM_TRIM) reclaim from zone cache up to zone cache working set. Idealy in stable run uma_reclaim(UMA_RECLAIM_TRIM) do nothing and all allocation/free from zone go from/to zone cache. As result uma_reclaim(UMA_RECLAIM_TRIM) work only for rebalance memory consume at working profile change.