[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <175551064043.1420.7493176605077418163.tip-bot2@tip-bot2>
Date: Mon, 18 Aug 2025 09:50:38 -0000
From: "tip-bot2 for Shaopeng Tan" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Shaopeng Tan <tan.shaopeng@...fujitsu.com>,
"Borislav Petkov (AMD)" <bp@...en8.de>,
Reinette Chatre <reinette.chatre@...el.com>,
James Morse <james.morse@....com>, Koba Ko <kobak@...dia.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/cache] fs/resctrl: Optimize code in rdt_get_tree()
The following commit has been merged into the x86/cache branch of tip:
Commit-ID: b470929e21393f37cae51a922ef319a753273719
Gitweb: https://git.kernel.org/tip/b470929e21393f37cae51a922ef319a753273719
Author: Shaopeng Tan <tan.shaopeng@...fujitsu.com>
AuthorDate: Mon, 23 Jun 2025 16:50:50 +09:00
Committer: Borislav Petkov (AMD) <bp@...en8.de>
CommitterDate: Mon, 18 Aug 2025 11:34:29 +02:00
fs/resctrl: Optimize code in rdt_get_tree()
schemata_list_destroy() has to be called if schemata_list_create() fails.
rdt_get_tree() calls schemata_list_destroy() in two different ways:
directly if schemata_list_create() itself fails and
on the exit path via the out_schemata_free goto label.
Remove schemata_list_destroy() call on schemata_list_create() failure.
Use existing out_schemata_free goto label instead.
Signed-off-by: Shaopeng Tan <tan.shaopeng@...fujitsu.com>
Signed-off-by: Borislav Petkov (AMD) <bp@...en8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@...el.com>
Reviewed-by: James Morse <james.morse@....com>
Reviewed-by: Koba Ko <kobak@...dia.com>
Link: https://lore.kernel.org/20250623075051.3610592-1-tan.shaopeng@jp.fujitsu.com
---
fs/resctrl/rdtgroup.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 77d0822..5f0b7cf 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2608,10 +2608,8 @@ static int rdt_get_tree(struct fs_context *fc)
goto out_root;
ret = schemata_list_create();
- if (ret) {
- schemata_list_destroy();
- goto out_ctx;
- }
+ if (ret)
+ goto out_schemata_free;
ret = closid_init();
if (ret)
@@ -2683,7 +2681,6 @@ out_closid_exit:
closid_exit();
out_schemata_free:
schemata_list_destroy();
-out_ctx:
rdt_disable_ctx();
out_root:
rdtgroup_destroy_root();
Powered by blists - more mailing lists