Author: markj Date: Fri Oct 2 19:04:09 2020 New Revision: 366378 URL: https://svnweb.freebsd.org/changeset/base/366378
Log: uma: Use LIFO for non-SMR bucket caches When SMR was introduced, zone_put_bucket() was changed to always place full buckets at the end of the queue. However, it is generally preferable to use recently used buckets since their items are more likely to be resident in cache. So, for buckets that have no constraint on item reuse, use a last-in-first-out ordering as we did before. Reviewed by: rlibby Tested by: dhw, glebius Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26426 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Oct 2 19:03:42 2020 (r366377) +++ head/sys/vm/uma_core.c Fri Oct 2 19:04:09 2020 (r366378) @@ -733,7 +733,15 @@ zone_put_bucket(uma_zone_t zone, int domain, uma_bucke zone_domain_imax_set(zdom, zdom->uzd_nitems); if (STAILQ_EMPTY(&zdom->uzd_buckets)) zdom->uzd_seq = bucket->ub_seq; - STAILQ_INSERT_TAIL(&zdom->uzd_buckets, bucket, ub_link); + + /* + * Try to promote reuse of recently used items. For items + * protected by SMR, try to defer reuse to minimize polling. + */ + if (bucket->ub_seq == SMR_SEQ_INVALID) + STAILQ_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); + else + STAILQ_INSERT_TAIL(&zdom->uzd_buckets, bucket, ub_link); ZDOM_UNLOCK(zdom); return; } _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"