svn commit: r310023 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs
Slawa Olhovchenkov
slw at zxy.spb.ru
Fri Dec 16 17:31:54 UTC 2016
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 at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe at freebsd.org"
More information about the svn-src-all
mailing list