Unverified Commit cd8c7a59 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 2582c49d 12f318ee
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -295,6 +295,7 @@ do { \
struct resctrl_staged_config {
	hw_closid_t     hw_closid;
	u32             new_ctrl[SCHEMA_NUM_CTRL_TYPE];
	bool            ctrl_updated[SCHEMA_NUM_CTRL_TYPE];
	bool            have_new_ctrl;
	enum resctrl_conf_type  conf_type;
	enum resctrl_ctrl_type  ctrl_type;
+17 −7
Original line number Diff line number Diff line
@@ -261,7 +261,8 @@ static void resctrl_group_update_domain_ctrls(struct rdtgroup *rdtgrp,
		closid.intpartid = hw_closid_val(cfg[i].hw_closid);
		for_each_ctrl_type(type) {
			/* if ctrl group's config has changed, refresh it first. */
			if (dom->ctrl_val[closid.intpartid] != cfg[i].new_ctrl) {
			if (dom->ctrl_val[type][closid.intpartid] != cfg[i].new_ctrl[type] &&
				cfg[i].ctrl_updated[type] == true) {
				/*
				 * duplicate ctrl group's configuration indexed
				 * by intpartid from domain ctrl_val array.
@@ -396,6 +397,7 @@ ssize_t resctrl_group_schemata_write(struct kernfs_open_file *of,
	struct mpam_resctrl_res *res;
	enum resctrl_conf_type conf_type;
	struct resctrl_staged_config *cfg;
	enum resctrl_ctrl_type t;
	char *tok, *resname;
	u32 closid;
	int ret = 0;
@@ -418,13 +420,17 @@ ssize_t resctrl_group_schemata_write(struct kernfs_open_file *of,
	for_each_supported_resctrl_exports(res) {
		r = &res->resctrl_res;

		if (r->alloc_enabled) {
		if (!r->alloc_enabled)
			continue;

		list_for_each_entry(dom, &r->domains, list) {
			dom->have_new_ctrl = false;
			for_each_conf_type(conf_type) {
				cfg = &dom->staged_cfg[conf_type];
					cfg->have_new_ctrl = false;
				for_each_ctrl_type(t) {
					cfg->ctrl_updated[t] = false;
				}
				cfg->have_new_ctrl = false;
			}
		}
	}
@@ -896,11 +902,13 @@ static void rdtgroup_init_mba(struct resctrl_schema *s, u32 closid)
		cfg = &d->staged_cfg[CDP_BOTH];
		cfg->cdp_both_ctrl = s->cdp_mc_both;
		cfg->new_ctrl[SCHEMA_COMM] = rr->ctrl_features[SCHEMA_COMM].default_ctrl;
		cfg->ctrl_updated[SCHEMA_COMM] = true;
		resctrl_cdp_mpamid_map(closid, CDP_BOTH, cfg->hw_closid);
		cfg->have_new_ctrl = true;
		/* Set extension ctrl default value, e.g. priority/hardlimit */
		for_each_extend_ctrl_type(t) {
			cfg->new_ctrl[t] = rr->ctrl_features[t].default_ctrl;
			cfg->ctrl_updated[t] = true;
		}
	}
}
@@ -953,6 +961,7 @@ static int rdtgroup_init_cat(struct resctrl_schema *s, u32 closid)
		}

		resctrl_cdp_mpamid_map(closid, conf_type, cfg->hw_closid);
		cfg->ctrl_updated[SCHEMA_COMM] = true;
		cfg->have_new_ctrl = true;

		/*
@@ -962,6 +971,7 @@ static int rdtgroup_init_cat(struct resctrl_schema *s, u32 closid)
		for_each_extend_ctrl_type(ctrl_type) {
			cfg->new_ctrl[ctrl_type] =
				rr->ctrl_features[ctrl_type].default_ctrl;
			cfg->ctrl_updated[ctrl_type] = true;
		}
	}

+2 −0
Original line number Diff line number Diff line
@@ -321,6 +321,7 @@ parse_cache(char *buf, struct resctrl_resource *r,
	}

	cfg->new_ctrl[type] = data;
	cfg->ctrl_updated[type] = true;
	cfg->have_new_ctrl = true;

	return 0;
@@ -369,6 +370,7 @@ parse_bw(char *buf, struct resctrl_resource *r,
	}

	cfg->new_ctrl[type] = data;
	cfg->ctrl_updated[type] = true;
	cfg->have_new_ctrl = true;

	return 0;