From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5CB2368D4B for ; Mon, 13 Jul 2026 09:17:10 +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=1783934233; cv=none; b=nVC7RRvJ16VlUEzGp2H1Uq6r8iLqOcX0ITmUcKGoaWfZm8XEihEta8mvZqk1eOllRtgBRDLgCyriAYlUZMDRJhKlwfrEeFgdjgGFbg3tdDsIx3lZDxcPcW92bQLdoqfukrb2/J8cdVGL5/CyklgV879DnQp4+A6S5QC5gLwfPus= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783934233; c=relaxed/simple; bh=dBT+/z/9BNzPQDTWGAsKVq7Z989nSzTIliUjYN+MG2c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MlFm9wulGES8bTi8tlZ0wncPvD5Vj9I1oKE6qI+KNW/4XvYC2Fu2RH8fMU0vF9RMWstn8C4OEXrqb5Et9NhDFKwftw4MBr/gKGpul8yPy+BB/sWqZ0BgxEuF+yePzMd9uOJiBfU4NTYD6KKvVxBUTO8S3XYblD7TalJf2PHj6gE= 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=aW8Vv9Ui; 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="aW8Vv9Ui" 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 6FCDF1576; Mon, 13 Jul 2026 02:17:05 -0700 (PDT) Received: from [10.2.212.8] (e134344.arm.com [10.2.212.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 73C163F7B4; Mon, 13 Jul 2026 02:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1783934229; bh=dBT+/z/9BNzPQDTWGAsKVq7Z989nSzTIliUjYN+MG2c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=aW8Vv9UitOZVKNj8shEBuHCOxer67fEVje/9B6uLqdyrMYZHHLSPPI2numSJsr5kU YJ2OrAZkgcNQ2yeNjXVH/mrt0LcAt9uJh4/8CQGT4F7KjM//mRrd1KVcjjd4l6cZfV LPdnXvsyhgdfzbMIYMATmn6x1fKCBo8TW6m0xZrY= Message-ID: <7104a4a5-5401-447b-9c98-c920a29a5f02@arm.com> Date: Mon, 13 Jul 2026 10:16:58 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Thunderbird Daily Subject: Re: [PATCH v1] fs/resctrl: Allocate rmid_ptrs[] using kvzalloc_objs() To: "Luck, Tony" Cc: "Chatre, Reinette" , "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" References: <20260710112322.25516-1-ben.horgan@arm.com> Content-Language: en-US From: Ben Horgan In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Tony, On 7/10/26 16:42, Luck, Tony wrote: >> 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. > > Wow!. 16 million RMIDs * 32 byte per structure = 512MB > > I generally don't sweat "big" allocations on servers that have hundreds of Gbytes > of memory. But that seems like a lot. Probably 99.99% of it never used (unless > users regularly use resctrl to create tens of thousands of mon_data directories). > > Your fix is fine. So > > Reviewed-by: Tony Luck Thanks! > > But maybe at some point resctrl needs some sparse, or on-demand, allocator for > RMIDs? Or is this a theoretical issue and nobody is likely to build a system that > implements that many PARTIDs and/or PMGs? It's a theoretical issue; I don't think anyone will build anything even close to the maximum of 'PMG x PARTID'. Until the latest version, systems using CHI were limited to 1 bit of PMG. I was just checking some of the extremes of the MPAM driver with a software model. Ben > > -Tony