From nobody Sun Jul 26 01:05:48 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFAD54195D2 for ; Fri, 10 Jul 2026 11:23:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783682620; cv=none; b=TXHC0THy276ZdMRH/nycmv3c9VncjAq1LGPgVysbGn8Wx/muVoLU4tj3F4rqtAwTAIyA3ovaXLjBWfWi8F2vWxdIAI8RQqlm3eva50x0e+C6o78p3WykLYC78db47Lx207oY4m9qagLGs98ERCGs+yizUtVIxrHQr6AdCsb9jW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783682620; c=relaxed/simple; bh=A4y+PeGfOCEfLQMDYNRqHEHFbAu6gn6o7WTkZHmiDHo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DjkDKhlcVhcDrv58Zf5jVmAMHpQpJIUy0KiwTBgzxq1GJcmFksV4L4YZKsVC9hjhIEARK+JyY7uvquPvB9rv/z2jsvDI+LlLmn3ZSQWJj88Plqqh59I3gtvDaVfDjXmfXqGq5R+FRoa71896WogcNn2zLDKcmyjItocyQhSQy20= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=I+0LLVmT; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="I+0LLVmT" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F0D161682; Fri, 10 Jul 2026 04:23:30 -0700 (PDT) Received: from e134344.cambridge.arm.com (e134344.arm.com [10.2.212.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 817C33F85F; Fri, 10 Jul 2026 04:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1783682615; bh=A4y+PeGfOCEfLQMDYNRqHEHFbAu6gn6o7WTkZHmiDHo=; h=From:To:Cc:Subject:Date:From; b=I+0LLVmTNdDZXLo9qRaj/xiujIxzZZ7ZO+yC+ZTyjUjzzTPZxA8zVRE0RucERdrui wvlIQKT+OwKbdPwA5U3g4mLWg3lLkNilRbbkCO+BHyBYgl5y831mTkqFqjCjdzwXco JQrIwqBou6orUQiYowGD/3/mZ6yhDZ6/PhjioINc= From: Ben Horgan To: 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: [PATCH v1] fs/resctrl: Allocate rmid_ptrs[] using kvzalloc_objs() Date: Fri, 10 Jul 2026 12:23:22 +0100 Message-ID: <20260710112322.25516-1-ben.horgan@arm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On an MPAM system the number of entries in rmid_ptrs[] is the number of PAR= TIDs 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 li= mits of the MPAM specification this can be large enough to consistently fail the kzalloc_objs() allocation and hence fail to mount the resctrl filesystem. Switch to allocating rmid_ptrs[] using kvzalloc_objs() so that large alloca= tions fall back to vmalloc(). Fixes: 7168ae330e81 ("x86,fs/resctrl: Move the resctrl filesystem code to l= ive in /fs/resctrl") Signed-off-by: Ben Horgan Reviewed-by: Tony Luck --- I found this by testing the extremes of a software model and don't expect t= his 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 a932a1fea818..b0c588f21de8 100644 --- a/fs/resctrl/monitor.c +++ b/fs/resctrl/monitor.c @@ -930,7 +930,7 @@ int setup_rmid_lru_list(void) return 0; =20 idx_limit =3D resctrl_arch_system_num_rmid_idx(); - rmid_ptrs =3D kzalloc_objs(struct rmid_entry, idx_limit); + rmid_ptrs =3D kvzalloc_objs(struct rmid_entry, idx_limit); if (!rmid_ptrs) return -ENOMEM; =20 @@ -961,7 +961,7 @@ void free_rmid_lru_list(void) return; =20 mutex_lock(&rdtgroup_mutex); - kfree(rmid_ptrs); + kvfree(rmid_ptrs); rmid_ptrs =3D NULL; mutex_unlock(&rdtgroup_mutex); } --=20 2.43.0