[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f37b0dfa-ae59-4693-b10f-79868e093e80@nvidia.com>
Date: Tue, 24 Jun 2025 11:51:51 +0800
From: Koba Ko <kobak@...dia.com>
To: Shaopeng Tan <tan.shaopeng@...fujitsu.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Cc: Reinette Chatre <reinette.chatre@...el.com>,
James Morse <james.morse@....com>, Yury Norov <yury.norov@...il.com>,
Dave Martin <dave.martin@....com>, fenghuay@...dia.com,
peternewman@...gle.com, Babu Moger <Babu.Moger@....com>,
Borislav Petkov <bp@...en8.de>, shameerali.kolothum.thodi@...wei.com,
bobo.shaobowang@...wei.com,
D Scott Phillips OS <scott@...amperecomputing.com>,
carl@...amperecomputing.com, Shanker Donthineni <sdonthineni@...dia.com>,
Xin Hao <xhao@...ux.alibaba.com>, baolin.wang@...ux.alibaba.com,
lcherian@...vell.com, amitsinght@...vell.com, Ingo Molnar
<mingo@...hat.com>, David Hildenbrand <david@...hat.com>,
H Peter Anvin <hpa@...or.com>, Rex Nie <rex.nie@...uarmicro.com>,
Jamie Iles <quic_jiles@...cinc.com>, dfustini@...libre.com,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v2] fs/resctrl: Optimize code in rdt_get_tree()
Thanks
Reviewed-by: Koba Ko <kobak@...dia.com>
On 6/23/25 15:50, Shaopeng Tan wrote:
> External email: Use caution opening links or attachments
>
>
> 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>
> Reviewed-by: Reinette Chatre <reinette.chatre@...el.com>
> Reviewed-by: James Morse <james.morse@....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 77d08229d855..5f0b7cfa1cc2 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 @@ static int rdt_get_tree(struct fs_context *fc)
> closid_exit();
> out_schemata_free:
> schemata_list_destroy();
> -out_ctx:
> rdt_disable_ctx();
> out_root:
> rdtgroup_destroy_root();
> --
> 2.43.5
>
Powered by blists - more mailing lists