From: Xie XiuQi <xiexiuqi(a)huawei.com>
commit f654d1f36c1f2cf29afd1073731eb275483f1a8b openEuler-1.0
hulk inclusion
category: bugfix
bugzilla: 14212
CVE: NA
The ctrlcon flag should be set only when we sucessful to
enable ctrlmon, or the flag is mismatch with ctrlmon status.
ctrlmon is indicate a group which could moniter the usage
of L3/Memory bandwidth.
Signed-off-by: Xie XiuQi <xiexiuqi(a)huawei.com>
Reviewed-by: Hanjun Guo <guohanjun(a)huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
Signed-off-by: Xin Hao <haoxing990(a)gmail.com>
---
arch/arm64/kernel/mpam.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/mpam.c b/arch/arm64/kernel/mpam.c
index a9dab7eb7b77..dae2303b2449 100644
--- a/arch/arm64/kernel/mpam.c
+++ b/arch/arm64/kernel/mpam.c
@@ -1013,9 +1013,10 @@ static ssize_t resctrl_group_ctrlmon_write(struct kernfs_open_file
*of,
rdtgrp->flags &= ~RDT_CTRLMON;
resctrl_ctrlmon_disable(rdtgrp->mon.mon_data_kn, rdtgrp);
} else if (!(rdtgrp->flags & RDT_CTRLMON) && ctrlmon) {
- rdtgrp->flags |= RDT_CTRLMON;
- resctrl_ctrlmon_enable(rdtgrp->kn, rdtgrp,
- &rdtgrp->mon.mon_data_kn);
+ ret = resctrl_ctrlmon_enable(rdtgrp->kn, rdtgrp,
+ &rdtgrp->mon.mon_data_kn);
+ if (!ret)
+ rdtgrp->flags |= RDT_CTRLMON;
} else {
ret = -ENOENT;
}
--
2.31.0