Commit 591b8d61 authored by James Morse's avatar James Morse Committed by Zeng Heng
Browse files

arm_mpam: resctrl: Tell resctrl about cpu/domain online/offline

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8T2RT

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/log/?h=mpam/snapshot/v6.7-rc2



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

Now that mpam links against resctrl, call the cpu and domain
online/offline calls at the appropriate point.

Signed-off-by: default avatarJames Morse <james.morse@arm.com>
Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
parent 693f9a00
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -824,7 +824,7 @@ int mpam_resctrl_setup(void)
			pr_warn("Number of PMG is not a power of 2! resctrl may misbehave");
		}

		/* TODO: call resctrl_init() */
		err = resctrl_init();
	}

	return err;
@@ -1077,7 +1077,7 @@ struct rdt_domain *resctrl_arch_find_domain(struct rdt_resource *r, int id)

int mpam_resctrl_online_cpu(unsigned int cpu)
{
	int i;
	int i, err;
	struct mpam_resctrl_dom *dom;
	struct mpam_resctrl_res *res;

@@ -1096,8 +1096,12 @@ int mpam_resctrl_online_cpu(unsigned int cpu)
		dom = mpam_resctrl_alloc_domain(cpu, res);
		if (IS_ERR(dom))
			return PTR_ERR(dom);
		err = resctrl_online_domain(&res->resctrl_res, &dom->resctrl_dom);
		if (err)
			return err;
	}

	resctrl_online_cpu(cpu);
	return 0;
}

@@ -1108,6 +1112,8 @@ int mpam_resctrl_offline_cpu(unsigned int cpu)
	struct mpam_resctrl_res *res;
	struct mpam_resctrl_dom *dom;

	resctrl_offline_cpu(cpu);

	for (i = 0; i < RDT_NUM_RESOURCES; i++) {
		res = &mpam_resctrl_exports[i];

@@ -1126,6 +1132,7 @@ int mpam_resctrl_offline_cpu(unsigned int cpu)
		if (!cpumask_empty(&d->cpu_mask))
			continue;

		resctrl_offline_domain(&res->resctrl_res, &dom->resctrl_dom);
		list_del(&d->list);
		kfree(dom);
	}