Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Dec 2016 20:31:51 +0300
From:      Slawa Olhovchenkov <slw@zxy.spb.ru>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        Alexander Motin <mav@FreeBSD.org>, 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>
In-Reply-To: <55217d08-1c39-0d30-58a3-6b3aa48fd79f@FreeBSD.org>
References:  <201612131620.uBDGKAR0007684@repo.freebsd.org> <55217d08-1c39-0d30-58a3-6b3aa48fd79f@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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"



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