[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b4b4892-c49b-46bb-8ae4-a3f1c9358c7f@intel.com>
Date: Thu, 23 Oct 2025 10:49:15 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: Tony Luck <tony.luck@...el.com>, Fenghua Yu <fenghuay@...dia.com>, "Maciej
Wieczor-Retman" <maciej.wieczor-retman@...el.com>, Peter Newman
<peternewman@...gle.com>, James Morse <james.morse@....com>, Babu Moger
<babu.moger@....com>, Drew Fustini <dfustini@...libre.com>, Dave Martin
<Dave.Martin@....com>, Chen Yu <yu.c.chen@...el.com>
CC: <x86@...nel.org>, <linux-kernel@...r.kernel.org>,
<patches@...ts.linux.dev>
Subject: Re: [PATCH v12 25/31] fs/resctrl: Move allocation/free of
closid_num_dirty_rmid[]
Hi Tony,
On 10/13/25 3:33 PM, Tony Luck wrote:
> +static int closid_num_dirty_rmid_alloc(struct rdt_resource *r)
> +{
> + if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) {
> + u32 num_closid = resctrl_arch_get_num_closid(r);
> + u32 *tmp;
> +
> + /* For ARM memory ordering access to closid_num_dirty_rmid */
> + mutex_lock(&rdtgroup_mutex);
> +
> + /*
> + * If the architecture hasn't provided a sanitised value here,
> + * this may result in larger arrays than necessary. Resctrl will
> + * use a smaller system wide value based on the resources in
> + * use.
> + */
> + tmp = kcalloc(num_closid, sizeof(*tmp), GFP_KERNEL);
> + if (!tmp)
> + return -ENOMEM;
Drop rdtgroup_mutex before returning here.
> +
> + closid_num_dirty_rmid = tmp;
> +
> + mutex_unlock(&rdtgroup_mutex);
> + }
> +
> + return 0;
> +}
Reinette
Powered by blists - more mailing lists