Commit 50afa875 authored by Ze Zuo's avatar Ze Zuo
Browse files

mm: prepare to support weighted interleaving mempolicy

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9PD4G



----------------------------------------------------------------------

To support weighted interleaving mempolicy, we need to round up two series
of patch sets, patch set one is "mempolicy: cleanups leading to NUMA mpol
without vma" and patch set two is "mm/mempolicy: weighted interleave mempolicy
and sysfs extension", however, where commit ddc1a5cbc05d ("mempolicy:
alloc_pages_mpol() for NUMA policy without vma") for patch set one and
commit fa3bea4e1f82 ("mm/mempolicy: introduce MPOL_ WEIGHTED_INTERLEAVE for
weighted interleaving") will see kabi changes for whitelisted structures,
for which the KABI field needs to be reserved in advance for the mempolicy's
relevant data structures.
v1->v2:
-- fix commit bug.

Signed-off-by: default avatarZe Zuo <zuoze1@huawei.com>
parent 7c6c7d83
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -456,7 +456,7 @@ static int kernfs_vma_set_policy(struct vm_area_struct *vma,
}

static struct mempolicy *kernfs_vma_get_policy(struct vm_area_struct *vma,
					       unsigned long addr)
					       unsigned long addr, pgoff_t *ilx)
{
	struct file *file = vma->vm_file;
	struct kernfs_open_file *of = kernfs_of(file);
@@ -470,7 +470,7 @@ static struct mempolicy *kernfs_vma_get_policy(struct vm_area_struct *vma,

	pol = vma->vm_policy;
	if (of->vm_ops->get_policy)
		pol = of->vm_ops->get_policy(vma, addr);
		pol = of->vm_ops->get_policy(vma, addr, NULL);

	kernfs_put_active(of->kn);
	return pol;
+1 −1
Original line number Diff line number Diff line
@@ -640,7 +640,7 @@ struct vm_operations_struct {
	 * policy.
	 */
	struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
					unsigned long addr);
					unsigned long addr, pgoff_t *ilx);
#endif
	/*
	 * Called by vm_normal_page() for special PTEs to find the
+1 −0
Original line number Diff line number Diff line
@@ -1285,6 +1285,7 @@ struct task_struct {
	/* Protected by alloc_lock: */
	struct mempolicy		*mempolicy;
	short				il_prev;
	u8				il_weight;
	short				pref_node_fork;
#endif
#ifdef CONFIG_NUMA_BALANCING
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ enum {
	MPOL_INTERLEAVE,
	MPOL_LOCAL,
	MPOL_PREFERRED_MANY,
	MPOL_WEIGHTED_INTERLEAVE,
	MPOL_MAX,	/* always last member of enum */
};

+2 −2
Original line number Diff line number Diff line
@@ -574,14 +574,14 @@ static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
}

static struct mempolicy *shm_get_policy(struct vm_area_struct *vma,
					unsigned long addr)
					unsigned long addr, pgoff_t *ilx)
{
	struct file *file = vma->vm_file;
	struct shm_file_data *sfd = shm_file_data(file);
	struct mempolicy *pol = NULL;

	if (sfd->vm_ops->get_policy)
		pol = sfd->vm_ops->get_policy(vma, addr);
		pol = sfd->vm_ops->get_policy(vma, addr, NULL);
	else if (vma->vm_policy)
		pol = vma->vm_policy;

Loading