From owner-svn-src-head@freebsd.org Fri Dec 16 17:31:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75850C81C9B; Fri, 16 Dec 2016 17:31: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 3742C1BE8; Fri, 16 Dec 2016 17:31: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 1cHwMJ-000CgD-Dr; Fri, 16 Dec 2016 20:31:51 +0300 Date: Fri, 16 Dec 2016 20:31:51 +0300 From: Slawa Olhovchenkov To: Andriy Gapon Cc: Alexander Motin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r310023 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs Message-ID: <20161216173151.GC90401@zxy.spb.ru> References: <201612131620.uBDGKAR0007684@repo.freebsd.org> <55217d08-1c39-0d30-58a3-6b3aa48fd79f@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55217d08-1c39-0d30-58a3-6b3aa48fd79f@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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 16 Dec 2016 17:31:54 -0000 On Wed, Dec 14, 2016 at 02:38:11PM +0200, Andriy Gapon wrote: > Alexander, > > I tried to see how the code looks after expanding illumos variables to FreeBSD > variables before and after your change. > > Before: > n = PAGESIZE * ((int64_t)freemem - zfs_arc_free_target); > ==> > n = PAGESIZE * ((int64_t)vm_cnt.v_free_count - zfs_arc_free_target); > > After: > n = PAGESIZE * (freemem - lotsfree - needfree - desfree); > ==> > n = PAGESIZE * ((long)vm_cnt.v_free_count - zfs_arc_free_target - > (long)vm_pageout_deficit - (long)vm_cnt.v_free_target); > > Default value of zfs_arc_free_target is vm_pageout_wakeup_thresh and its default > value is (vm_cnt.v_free_min / 10) * 11. > > vm_pageout_deficit is probably just a noise most of the time. vm_pageout_deficit zeroed at read by vm_pageout_scan(). In illumos case target is "target_free" + "pageout_high_water" + "extra pages here to make sure the scanner doesn't start up while we're freeing memory." As zero-order approximation we can let target_free as v_free_target (desfree) pageout_high_water as zfs_arc_free_target (lotsfree) extra pages as vm_pageout_deficit (needfree) In that case noise in vm_pageout_deficit is not problem. > But v_free_target is a substantial value (even greater than the default > zfs_arc_free_target). > > It seems that now we subtract much more than we did before. Code was totaly broken in FreeBSD case: needfree don't updated in process of reclaim. Mostly reclaim stops only after ARC touch arc_min. > So, this change does not merely reduce diff, it also changes ARC sizing behavior. And this is right way. > I wonder how much testing have you done for this change and if you can qualify > ARC size behavior in various scenarios. I expect that with your change the ARC > would more easily give in to the memory pressure. That may delight some, but it > could be an issue for others. Especially if it forces ARC to its minimum size > for no good reason. > > P.S. > My impression is that the page daemon in illumos has a different algorithm from > our page daemon, so some similarities could be misleading rather than helpful. > > -- > Andriy Gapon > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"