mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Ben Horgan <ben.horgan@arm.com>
Cc: <tony.luck@intel.com>, <reinette.chatre@intel.com>,
	<x86@kernel.org>, <Dave.Martin@arm.com>, <james.morse@arm.com>,
	<babu.moger@amd.com>, <fenghuay@nvidia.com>, <bp@alien8.de>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/3] fs/resctrl: Allocate rmid_ptrs[] using kvzalloc_objs()
Date: Thu, 26 Nov 2026 14:39:39 +0800	[thread overview]
Message-ID: <70b45cc0-b888-4315-8fdd-6d6bc6a4e433@huawei.com> (raw)
In-Reply-To: <20261125164753.3759904-2-ben.horgan@arm.com>



在 2026/11/26 0:47, Ben Horgan 写道:
> On an MPAM system the number of entries in rmid_ptrs[] is the number of PARTIDs
> multiplied by the number of PMGs. The maximum possible number of PARTIDs is
> 0x10000 and the maximum number of PMGs is 0x100. On a system pushing the limits
> of the MPAM specification this can be large enough to consistently fail the
> kzalloc_objs() allocation and hence fail to mount the resctrl filesystem.

Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>

> 
> Switch to allocating rmid_ptrs[] using kvzalloc_objs() so that large allocations
> fall back to vmalloc().
> 
> Fixes: 264c285999fc ("arm_mpam: resctrl: Add monitor initialisation and domain boilerplate")
> Signed-off-by: Ben Horgan <ben.horgan@arm.com>
> Reviewed-by: Tony Luck <tony.luck@intel.com>
> ---
> I found this by testing the extremes of a software model and don't expect this
> to effect real systems.
> ---
>  fs/resctrl/monitor.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
> index 04e4ea612b7c..9c383abfbbe0 100644
> --- a/fs/resctrl/monitor.c
> +++ b/fs/resctrl/monitor.c
> @@ -979,7 +979,7 @@ int setup_rmid_lru_list(void)
>  		return 0;
>  
>  	idx_limit = resctrl_arch_system_num_rmid_idx();
> -	rmid_ptrs = kzalloc_objs(struct rmid_entry, idx_limit);
> +	rmid_ptrs = kvzalloc_objs(struct rmid_entry, idx_limit);
>  	if (!rmid_ptrs)
>  		return -ENOMEM;
>  
> @@ -1010,7 +1010,7 @@ void free_rmid_lru_list(void)
>  		return;
>  
>  	mutex_lock(&rdtgroup_mutex);
> -	kfree(rmid_ptrs);
> +	kvfree(rmid_ptrs);
>  	rmid_ptrs = NULL;
>  	mutex_unlock(&rdtgroup_mutex);
>  }


  reply	other threads:[~2026-11-26  6:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 16:47 [PATCH v3 0/3] fs/resctrl: Use kvzalloc_objs() for large allocations Ben Horgan
2026-11-25 16:47 ` [PATCH v3 1/3] fs/resctrl: Allocate rmid_ptrs[] using kvzalloc_objs() Ben Horgan
2026-11-26  6:39   ` Jinjie Ruan [this message]
2026-11-25 16:47 ` [PATCH v3 2/3] fs/resctrl: Allocate the arrays in struct rdt_l3_mon_domain " Ben Horgan
2026-11-26  6:43   ` Jinjie Ruan
2026-11-25 16:47 ` [PATCH v3 3/3] fs/resctrl: Allocate rdt_l3_mon_domain::rmid_busy_llc " Ben Horgan
2026-11-26  6:45   ` Jinjie Ruan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=70b45cc0-b888-4315-8fdd-6d6bc6a4e433@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=ben.horgan@arm.com \
    --cc=bp@alien8.de \
    --cc=fenghuay@nvidia.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®