MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zone_domain_highest

Function zone_domain_highest

freebsd/vm/uma_core.c:588–609  ·  view source on GitHub ↗

* Search for the domain with the most cached items and return it or the * preferred domain if it has enough to proceed. */

Source from the content-addressed store, hash-verified

586 * preferred domain if it has enough to proceed.
587 */
588static __noinline int
589zone_domain_highest(uma_zone_t zone, int pref)
590{
591 long most, nitems;
592 int domain;
593 int i;
594
595 if (ZDOM_GET(zone, pref)->uzd_nitems > BUCKET_MAX)
596 return (pref);
597
598 most = 0;
599 domain = 0;
600 for (i = 0; i < vm_ndomains; i++) {
601 nitems = ZDOM_GET(zone, i)->uzd_nitems;
602 if (nitems > most) {
603 domain = i;
604 most = nitems;
605 }
606 }
607
608 return (domain);
609}
610
611/*
612 * Safely subtract cnt from imax.

Callers 1

cache_allocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected