Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mempolicy.c Create Date:2022-07-28 15:30:50
Last Modify:2020-03-17 22:28:11 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:This function just creates a new policy, does some check and simple* initialization. You must invoke mpol_set_nodemask() to set nodes.

Proto:static struct mempolicy *mpol_new(unsigned short mode, unsigned short flags, nodemask_t *nodes)

Type:struct mempolicy

Parameter:

TypeParameterName
unsigned shortmode
unsigned shortflags
nodemask_t *nodes
247  pr_debug("setting mode %d flags %d nodes[0] %lx\n", mode, flags, nodes ? nodes_addr( * nodes)[0] : NUMA_NO_NODE)
250  If mode == MPOL_DEFAULT Then
251  If nodes && Not nodes_empty( * nodes) Then Return ERR_PTR( - EINVAL)
253  Return NULL
255  VM_BUG_ON(!nodes)
262  If mode == MPOL_PREFERRED Then
263  If nodes_empty( * nodes) Then
268  Else if mode == MPOL_LOCAL Then
269  If Not nodes_empty( * nodes) || flags & Flags for set_mempolicy || flags & MPOL_F_RELATIVE_NODES Then Return ERR_PTR( - EINVAL)
273  mode = MPOL_PREFERRED
274  Else if nodes_empty( * nodes) Then Return ERR_PTR( - EINVAL)
276  policy = kmem_cache_alloc(policy_cache, GFP_KERNEL)
277  If Not policy Then Return ERR_PTR( - ENOMEM)
279  atomic_set( & refcnt, 1)
280  See MPOL_* above = mode
281  See set_mempolicy() MPOL_F_* above = flags
283  Return policy
Caller
NameDescribe
do_set_mempolicySet the process memory policy
do_mbind
mpol_shared_policy_initmpol_shared_policy_init - initialize shared policy for inode*@sp: pointer to inode shared policy*@mpol: struct mempolicy to install* Install non-NULL @mpol in inode's shared policy rb-tree.* On entry, the current task has a reference on a non-NULL @mpol.