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

Function zone_domain_lowest

freebsd/vm/uma_core.c:560–582  ·  view source on GitHub ↗

* Search for the domain with the least cached items and return it if it * is out of balance with the preferred domain. */

Source from the content-addressed store, hash-verified

558 * is out of balance with the preferred domain.
559 */
560static __noinline int
561zone_domain_lowest(uma_zone_t zone, int pref)
562{
563 long least, nitems, prefitems;
564 int domain;
565 int i;
566
567 prefitems = least = LONG_MAX;
568 domain = 0;
569 for (i = 0; i < vm_ndomains; i++) {
570 nitems = ZDOM_GET(zone, i)->uzd_nitems;
571 if (nitems < least) {
572 domain = i;
573 least = nitems;
574 }
575 if (domain == pref)
576 prefitems = nitems;
577 }
578 if (prefitems < least * 2)
579 return (pref);
580
581 return (domain);
582}
583
584/*
585 * Search for the domain with the most cached items and return it or the

Callers 1

zone_free_bucketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected