简体   繁体   中英

what is default memory policy flag for malloc?

In a numa system when malloc is called without using set_mempolicy, what is the default mempolicy flag being used in kernel for this allocation? Is it MPOL_DEFAULT or MPOL_INTERLEAVED ?

In mm/mempolicy.c

/* * run-time system-wide default policy => local allocation */

static struct mempolicy default_policy = {
    .refcnt = ATOMIC_INIT(1), /* never free it */
    .mode = MPOL_PREFERRED,
    .flags = MPOL_F_LOCAL,
};

So default mempolicy is MPOL_PREFERRED.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM