From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from flow-b5-smtp.messagingengine.com (flow-b5-smtp.messagingengine.com [202.12.124.140]) (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 6742C23ED6A for ; Mon, 12 Jan 2026 16:18:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.140 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768234682; cv=none; b=O1MEW5y0UTT6O9rD6ax8bU2/py3q4No/4nlmimPgKTM0ql+xchHPJw3eV3FFsSueWtfXhG03J7xr5Po3PrIcDNaKAfYsLirXWcn8ggHGe4bA70uCZG49Xn9JGx6w9E/Kd5vSwZUttL7EYOTYtjcgOkuD0BA2CT2iXmAWtjoDNcY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768234682; c=relaxed/simple; bh=9RJ9kSSm3xp3fQVzd/yX12OVUuNkzD43m9d1ahRrhGo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MvpiADdxhDfE0ZA4hC6UBqeq5ZzpNNxGiTvk7TfwStmdJIp5ucHUTXjt2nxBLccYOb32sh9m3PzBt/iHc6RHdlEgCUnO1etY75m/AvrzzjbaD68RcA1FAriQQhICdvepdpHodUGl5S5H1S5y7Xtnz3Cb4NYIx+sOfRWsa3ncBWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name; spf=pass smtp.mailfrom=shutemov.name; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b=i5ey/lMS; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ScyZpglJ; arc=none smtp.client-ip=202.12.124.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shutemov.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b="i5ey/lMS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ScyZpglJ" Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailflow.stl.internal (Postfix) with ESMTP id AF3B413003B7; Mon, 12 Jan 2026 11:17:57 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 12 Jan 2026 11:17:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1768234677; x= 1768241877; bh=BxagfD+pocrF1KsIMzuZEdccFWJZvdf3BM7nAN0GhJ8=; b=i 5ey/lMS4YFIFUGI+mKZAUoTWL+6TdJqjcNgk+iNLnCpev492coPtuD3C+kixY532 MvSIPbBkj4p05uTh8k5TuVdR8WBXavKCn17t9CSHw5u1EuWF7zr9Z/VQ+PfC7cTa 09D2Od1j3UgaBdfBbxZ00pZfw4qo/1b5wudPZOpVgasMqu4sYMZd/W6Ujl/jcMV2 fvobRZdTu5hJt+uYhgsA+OK6yHRJz3K21OgK1b0ryldp+cnKJjBxAZ1D219ajaGA Kd6LU3QYU3MyxQ4ifgF4w5UDRPgpZbCkWJKxG4sz/Qwvw8p0h39RBtAQpaJlsUkj HX2zAl6oqfip1Uc+h4cFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1768234677; x=1768241877; bh=BxagfD+pocrF1KsIMzuZEdccFWJZvdf3BM7 nAN0GhJ8=; b=ScyZpglJMB3T8ym26saJTTpNpq9hEGLTZsAI0bVeJdkt/CqDqeT O+o1+cQshCbHsZo25RAL0BHSliy2Gvk8maKIPrWbExjy0ar5KZA/XLbLwFPEXkXo 2PbbicSMo5emH6wJTEhObztwRDiwOZUOSJnIV/7PZbQ8lXgTsGMQIdjWAWpOk4Bz Bk9MD27nKSHuwr+H4h+M9EvF/8IymiKEZriqYrVylJfIAUJXD9YtyayVPJXhGhWA Hc+D+oRYrtEcSifovAAipHWTZxDbrToRj+k1q6rOESl3yqddJCN5dwpd6wuCw1JO 7VofoPVglhPNTTd/QfCyS7twN4W1FQyUObw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduudejleduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepmfhirhihlhcu ufhhuhhtshgvmhgruhcuoehkihhrihhllhesshhhuhhtvghmohhvrdhnrghmvgeqnecugg ftrfgrthhtvghrnhepfeetheejudeujeeikeetudelvdevkeefuddtkedvtdehtdetieeu ieetjeeugedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepkhhirhhilhhlsehshhhuthgvmhhovhdrnhgrmhgvpdhnsggprhgtphhtthhopeeh vddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhlrgguhihshhgvvhdrihhlhi grudeshhdqphgrrhhtnhgvrhhsrdgtohhmpdhrtghpthhtohepghhuohhhrghnjhhunhes hhhurgifvghirdgtohhmpdhrtghpthhtohepfigrnhhgkhgvfhgvnhhgrdifrghngheshh hurgifvghirdgtohhmpdhrtghpthhtohepfigvihihohhnghhjuhhnudeshhhurgifvghi rdgtohhmpdhrtghpthhtohephihushhonhhgphhinhhgsehhuhgrfigvihdrtghomhdprh gtphhtthhopehlvghijhhithgrnhhgsehhuhgrfigvihdrtghomhdprhgtphhtthhopegr rhhtvghmrdhkuhiiihhnsehhuhgrfigvihdrtghomhdprhgtphhtthhopehsthgvphgrnh hovhdrrghnrghtohhlhieshhhurgifvghirdgtohhmpdhrtghpthhtoheprghlvgigrghn uggvrhdrghhruhgsnhhikhhovheshhhurgifvghirdgtohhm X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 12 Jan 2026 11:17:54 -0500 (EST) Date: Mon, 12 Jan 2026 16:17:49 +0000 From: Kiryl Shutsemau To: Gladyshev Ilya Cc: guohanjun@huawei.com, wangkefeng.wang@huawei.com, weiyongjun1@huawei.com, yusongping@huawei.com, leijitang@huawei.com, artem.kuzin@huawei.com, stepanov.anatoly@huawei.com, alexander.grubnikov@huawei.com, gorbunov.ivan@h-partners.com, akpm@linux-foundation.org, david@kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, ziy@nvidia.com, harry.yoo@oracle.com, willy@infradead.org, yuzhao@google.com, baolin.wang@linux.alibaba.com, muchun.song@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/2] mm: improve folio refcount scalability Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Jan 12, 2026 at 05:32:10PM +0300, Gladyshev Ilya wrote: > On 1/12/2026 2:49 PM, Kiryl Shutsemau wrote: > > On Mon, Jan 12, 2026 at 11:30:38AM +0300, Gladyshev Ilya wrote: > > > Gentle ping on this proposal > > > > I generally like the idea, but I would like to hear from folks who > > actually understand serialization. > > > > Also, do you have number for "a full CAS loop when the counter is > > approaching overflow" thing? > > > I am not sure that overflow is a real problem because you need a very > specific race condition over a long time to achieve it... Yes. But if the page is popular for pinning, GUP_PIN_COUNTING_BIAS can cut the "very long time" substantially. > But as a safeguard, everything lower than 2^31 - #max concurrent > accesses (~#num cpu) should work, so let's say 2^30 What I meant is when we put a branch/loop in the hot path, your performance numbers will likely not look as attractive. Am I wrong? -- Kiryl Shutsemau / Kirill A. Shutemov