]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Revise the page cache size policy.
authormarkj <markj@FreeBSD.org>
Fri, 22 Nov 2019 16:30:47 +0000 (16:30 +0000)
committermarkj <markj@FreeBSD.org>
Fri, 22 Nov 2019 16:30:47 +0000 (16:30 +0000)
commit58afbd3942ea676edc49ab905bb209d586078a8b
treebb4b34f7018aba4889c1e177aa9ea901c6560fc5
parent64730be2e13562f518e7489b78e9ed03221e5172
Revise the page cache size policy.

In r353734 the use of the page caches was limited to systems with a
relatively large amount of RAM per CPU.  This was to mitigate some
issues reported with the system not able to keep up with memory pressure
in cases where it had been able to do so prior to the addition of the
direct free pool cache.  This change re-enables those caches.

The change modifies uma_zone_set_maxcache(), which was introduced
specifically for the page cache zones.  Rather than using it to limit
only the full bucket cache, have it also set uz_count_max to provide an
upper bound on the per-CPU cache size that is consistent with the number
of items requested.  Remove its return value since it has no use.

Enable the page cache zones unconditionally, and limit them to 0.1% of
the domain's pages.  The limit can be overridden by the
vm.pgcache_zone_max tunable as before.

Change the item size parameter passed to uma_zcache_create() to the
correct size, and stop setting UMA_ZONE_MAXBUCKET.  This allows the page
cache buckets to be adaptively sized, like the rest of UMA's caches.
This also causes the initial bucket size to be small, so only systems
which benefit from large caches will get them.

Reviewed by: gallatin, jeff
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22393
share/man/man9/zone.9
sys/vm/uma.h
sys/vm/uma_core.c
sys/vm/vm_glue.c
sys/vm/vm_page.c