| DOMAINSET(9) | Kernel Developer's Manual | DOMAINSET(9) | 
domainset(9) —
    domainset functions and operation
#include
    <sys/_domainset.h>
  
  #include <sys/domainset.h>
struct domainset {
        domainset_t     ds_mask;
        uint16_t        ds_policy;
        domainid_t      ds_prefer;
	...
};
  
  struct domainset *
  
  DOMAINSET_FIXED(domain);
struct domainset *
  
  DOMAINSET_RR();
struct domainset *
  
  DOMAINSET_PREF(domain);
struct domainset *
  
  domainset_create(const
    struct domainset *key);
int
  
  sysctl_handle_domainset(SYSCTL_HANDLER_ARGS);
The domainset(9) API provides memory
    domain allocation policy for NUMA machines. Each
    domainset contains a bitmask of allowed domains, an
    integer policy, and an optional preferred domain. Together, these specify a
    search order for memory allocations as well as the ability to restrict
    threads and objects to a subset of available memory domains for system
    partitioning and resource management.
Every thread in the system and optionally every vm_object_t, which is used to represent files and other memory sources, has a reference to a struct domainset. The domainset associated with the object is consulted first and the system falls back to the thread policy if none exists.
The allocation policy has the following possible values:
DOMAINSET_POLICY_ROUNDROBINDOMAINSET_POLICY_FIRSTTOUCHDOMAINSET_POLICY_PREFERDOMAINSET_POLICY_INTERLEAVEThe
    DOMAINSET_FIXED(),
    DOMAINSET_RR()
    and
    DOMAINSET_PREF()
    macros provide pointers to global pre-defined policies for use when the
    desired policy is known at compile time.
    DOMAINSET_FIXED() is a policy which only permits
    allocations from the specified domain.
    DOMAINSET_RR() provides round-robin selection among
    all domains in the system. The DOMAINSET_PREF()
    policies attempt allocation from the specified domain, but unlike
    DOMAINSET_FIXED() will fall back to other domains to
    satisfy the request. These policies should be used in preference to
    DOMAINSET_FIXED() to avoid blocking indefinitely on
    a M_WAITOK request. The
    domainset_create()
    function takes a partially filled in domainset as a key and returns a valid
    domainset or NULL. It is critical that consumers not use domainsets that
    have not been returned by this function. domainset is an immutable type that
    is shared among all matching keys and must not be modified after return.
The
    sysctl_handle_domainset()
    function is provided as a convenience for modifying or viewing domainsets
    that are not accessible via cpuset(2). It is intended for
    use with sysctl(9).
<sys/domainset.h>
    first appeared in FreeBSD 12.0.
| October 30, 2018 | Debian |