From a8c87e34b8f3f772311e69fabafd6bcef0c76499 Mon Sep 17 00:00:00 2001 From: Zeng Heng Date: Tue, 12 Mar 2024 10:40:39 +0800 Subject: [PATCH] arm64/mpam: Expand the monitor number of the resctrl root hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I97GSW ----------------------------- Expand the monitor number of the resctrl root to 1023, instead of 255. Fixes: 0b16164dc7a9 ("arm64/mpam: Remap reqpartid,pmg to rmid and intpartid to closid") Signed-off-by: Zeng Heng --- fs/resctrlfs.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/fs/resctrlfs.c b/fs/resctrlfs.c index e02e4769edc0..517a75ece4c9 100644 --- a/fs/resctrlfs.c +++ b/fs/resctrlfs.c @@ -666,26 +666,22 @@ static int find_rdtgrp_allocable_rmid(struct resctrl_group *rdtgrp) struct list_head *head; prgrp = rdtgrp->mon.parent; - if (prgrp == &resctrl_group_default) { - rmid = rmid_alloc(-1); - if (rmid < 0) - return rmid; - } else { - do { - rmid = rmid_alloc(prgrp->closid.reqpartid); + + do { + rmid = rmid_alloc(prgrp->closid.reqpartid); + if (rmid >= 0) + break; + + head = &prgrp->mon.crdtgrp_list; + list_for_each_entry(entry, head, mon.crdtgrp_list) { + if (entry == rdtgrp) + continue; + + rmid = rmid_alloc(entry->closid.reqpartid); if (rmid >= 0) break; - - head = &prgrp->mon.crdtgrp_list; - list_for_each_entry(entry, head, mon.crdtgrp_list) { - if (entry == rdtgrp) - continue; - rmid = rmid_alloc(entry->closid.reqpartid); - if (rmid >= 0) - break; - } - } while (0); - } + } + } while (0); if (rmid < 0) rmid = rmid_alloc(-1); -- Gitee