From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 065452F12D4 for ; Tue, 9 Jun 2026 13:54:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781013281; cv=none; b=dCPoQMJyDtQ3fqap2Rh7jfBBORhYK04uC0gCJhUZA4BO56qaxKPgoRDET8V8nH91PETZD5MPFe4nBw4fq9QpGcykEsO2WZM2ZLNU0ivjCV8AtOWzfxRiBDdB9SQCFVLmQAWvfo9q+5fIvmuRUYxj6hfb8h4ldoEfc5M3C64gTd8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781013281; c=relaxed/simple; bh=cM/06ORQMcjfMnmVUGdrD56LJNVnDIKixkPUW1mjg+4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hrCmR2BzTjHIQNVnIHhBZwUa3LDsPx4O4S81ziyCM1NVPlrrcBQ4CspEKHuzUhU0NIjfBOkdF2OK4qE59bhNRrOXmuMPw8TKOquY6bWOLtGqGWpp+hSSfTkEbZrnPW9pROsqLx+lw49MBxGIAKYStWriNY3JlgWDiQMIkgF4FPU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=crpKqVn1; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="crpKqVn1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 612CE1F00893; Tue, 9 Jun 2026 13:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781013280; bh=mgkuRymXgQquqyekcZ0fsD/A7mXWgkkGEwrlai+T3Ys=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=crpKqVn1JWgYYIiLt8y4v0XMABNcx+oc+u28Cu7f6kEwae/cC9sENy69hKtuy4bqV 2afTNlO7RRMw7rUrE2AMYUVuETWhPzE5mfW1LQjUvgNgLwSWpQS97R5PwvN0jf/2+p PQZQBt/2Z0xeyM5lv2+q2Xk/ACPBgincxLhUiZENZiIGceQddsRc0nZueEsWwKs0P9 qRSqWvMCbstOXC7RD3SmmF+p4nrjlGeaFGcP+UlOuRI8ihLvAALCKr8u+hvXDG6MVV 0OZyjvlXmf9NNTbobcyEMw/t8S5Tzeg/rON3AylWffcoMExEfA5pDFozSjEikCZbwF 19eWSe3M3l14g== Message-ID: <78ce28fd-62eb-4197-b167-73be7bd86217@kernel.org> Date: Tue, 9 Jun 2026 22:54:36 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 0/8] mm/slab: enable runtime sheaves tuning To: "Vlastimil Babka (SUSE)" , Pedro Falcato Cc: Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , "Liam R. Howlett" References: <20260516-sheaves-tuning-v1-0-221aa3e1d829@kernel.org> <682945f5-2d00-4bc8-8e23-59189b4472c6@kernel.org> Content-Language: en-US From: Harry Yoo In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------2XWiTgcVnut66LZ1X3d9Xaqq" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------2XWiTgcVnut66LZ1X3d9Xaqq Content-Type: multipart/mixed; boundary="------------TiMeMR5Lo7gpXV0wWewZC1LH"; protected-headers="v1" From: Harry Yoo To: "Vlastimil Babka (SUSE)" , Pedro Falcato Cc: Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , "Liam R. Howlett" Message-ID: <78ce28fd-62eb-4197-b167-73be7bd86217@kernel.org> Subject: Re: [PATCH RFC 0/8] mm/slab: enable runtime sheaves tuning References: <20260516-sheaves-tuning-v1-0-221aa3e1d829@kernel.org> <682945f5-2d00-4bc8-8e23-59189b4472c6@kernel.org> In-Reply-To: --------------TiMeMR5Lo7gpXV0wWewZC1LH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 6/9/26 9:52 PM, Vlastimil Babka (SUSE) wrote: > On 5/20/26 06:35, Harry Yoo wrote: >> >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> >>>> 1. Allocations and frees can happen concurrently at any point betwee= n >>>> these steps, and we cannot introduce heavyweight synchronization= >>>> mechanisms on the fastpath. >>>> >>>> 2. Currently, cache_has_sheaves() checks whether a cache has sheaves= =2E >>>> This works now because sheaves cannot be enabled or disabled onc= e >>>> the cache is created. >>>> >>>> The question "Does this cache has sheaves?" should be split into= >>>> "Does this cache support sheaves?" and "Does this CPU actually h= as >>>> sheaves enabled right now?". >>>> >>>> 3. Once the sheaf capacity update is complete, no sheaf with stale >>>> capacity must remain. >>> >>> Why? I don't see a huge problem with having multiple sheaves with dif= ferent >>> capacities, as long as you adequately, opportunistically kill the she= aves >>> if they don't have the desired size (say, once a sheaf is fully empty= ). >> >> Haha, you got me. >> >> Right, enforcing a single capacity at any given point introduced so mu= ch=20 >> complexity that I started wondering myself about whether this is reall= y=20 >> essential. >> >> My main concern was that the performance characteristics would become = >> too unpredictable, but actually, users can avoid that by disabling=20 >> sheaves, shrinking it, and re-enabling it. So that's not an enough=20 >> justification. >=20 > My concern would have been that we would need to track capacity per she= af if > we allowed sheaves with different capacities to coexist. > But patch 3 here already does that, so it seems it's necessary anyway..= =2E It is challenging to avoid that because, let's say, a CPU releases local lock, goes to sleep to reclaim memory to allocate a sheaf, re-acquire the lock, and install it. But sheaf capacity might change or sheaves can be disabled in the meantime. Probably wrapping the entire alloc/free path with something like SRCU-fast might help avoid that... but that sounds quite ambitious (to me= ). --=20 Cheers, Harry / Hyeonggon --------------TiMeMR5Lo7gpXV0wWewZC1LH-- --------------2XWiTgcVnut66LZ1X3d9Xaqq Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCaigbHAAKCRCGXBN6rc5S 1sTJAQCXB3/zmPYt9ZMQc+w1or2ioE4hbAopvJA0ha8uY+bcqwD/c60gL7CZMR58 ReFwFzstlLLXK7lZVyYwZoe/kx8aRgI= =KobS -----END PGP SIGNATURE----- --------------2XWiTgcVnut66LZ1X3d9Xaqq--