Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mpol_set_nodemask is called after mpol_new() to set up the nodemask, if* any, for the new policy. mpol_new() has already validated the nodes* parameter with respect to the policy mode and flags. But, we need to

Proto:static int mpol_set_nodemask(struct mempolicy *pol, const nodemask_t *nodes, struct nodemask_scratch *nsc)

Type:int

Parameter:

TypeParameterName
struct mempolicy *pol
const nodemask_t *nodes
struct nodemask_scratch *nsc
209  If (pol == NULL) Then Return 0
212  nodes_and(mask1, cpuset_current_mems_allowed, Array of node states.[N_MEMORY])
215  VM_BUG_ON(!nodes)
216  If See MPOL_* above == MPOL_PREFERRED && nodes_empty( * nodes) Then nodes = NULL
218  Else
219  If See set_mempolicy() MPOL_F_* above & MPOL_F_RELATIVE_NODES Then mpol_relative_nodemask( & mask2, nodes, & mask1)
221  Else nodes_and(mask2, * nodes, mask1)
224  If mpol_store_user_nodemask(pol) Then user_nodemask = nodes
226  Else relative to these nodes = cpuset_current_mems_allowed
231  If nodes Then ret = create(pol, & mask2)
233  Else ret = create(pol, NULL)
235  Return ret
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.