#define NO_INTERLEAVE_INDEX (-1UL) /* use task il_prev for interleaving */
#ifdef CONFIG_NUMA
/* * Describe a memory policy. * * A mempolicy can be either associated with a process or with a VMA. * For VMA related allocations the VMA policy is preferred, otherwise * the process policy is used. Interrupts ignore the memory policy * of the current process. * * Locking policy for interleave: * In process context there is no locking because only the process accesses * its own state. All vma manipulation is somewhat protected by a down_read on * mmap_lock. * * Freeing policy: * Mempolicy objects are reference counted. A mempolicy will be freed when * mpol_put() decrements the reference count to zero. * * Duplicating policy objects: * mpol_dup() allocates a new mempolicy and copies the specified mempolicy * to the new storage. The reference count of the new object is initialized * to 1, representing the caller of mpol_dup().
*/ struct mempolicy {
atomic_t refcnt; unsignedshort mode; /* See MPOL_* above */ unsignedshort flags; /* See set_mempolicy() MPOL_F_* above */
nodemask_t nodes; /* interleave/bind/preferred/etc */ int home_node; /* Home node to use for MPOL_BIND and MPOL_PREFERRED_MANY */
union {
nodemask_t cpuset_mems_allowed; /* relative to these nodes */
nodemask_t user_nodemask; /* nodemask passed by user */
} w;
};
/* * Support for managing mempolicy data objects (clone, copy, destroy) * The default fast path of a NULL MPOL_DEFAULT policy is always inlined.
*/
/* * Does mempolicy pol need explicit unref after use? * Currently only needed for shared policies.
*/ staticinlineint mpol_needs_cond_ref(struct mempolicy *pol)
{ return (pol && (pol->flags & MPOL_F_SHARED));
}
staticinlinevoid mpol_cond_put(struct mempolicy *pol)
{ if (mpol_needs_cond_ref(pol))
__mpol_put(pol);
}
externstruct mempolicy *__mpol_dup(struct mempolicy *pol); staticinlinestruct mempolicy *mpol_dup(struct mempolicy *pol)
{ if (pol)
pol = __mpol_dup(pol); return pol;
}
staticinlinevoid mpol_get(struct mempolicy *pol)
{ if (pol)
atomic_inc(&pol->refcnt);
}
externbool __mpol_equal(struct mempolicy *a, struct mempolicy *b); staticinlinebool mpol_equal(struct mempolicy *a, struct mempolicy *b)
{ if (a == b) returntrue; return __mpol_equal(a, b);
}
/* * Tree of shared policies for a shared memory region.
*/ struct shared_policy { struct rb_root root;
rwlock_t lock;
}; struct sp_node { struct rb_node nd;
pgoff_t start, end; struct mempolicy *policy;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.