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
This commit is contained in:
parent
fcc5c7bb1a
commit
5ce4e6412e
@ -733,7 +733,15 @@ zone_put_bucket(uma_zone_t zone, int domain, uma_bucket_t bucket, void *udata,
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user