From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 734E6270545 for ; Thu, 23 Apr 2026 18:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776968712; cv=none; b=fnw6a3AOFft2WIjzYrwcM+8A52xiSbTRDL5gVP5eyK/amV/I6lObvn6aQiQstYFT1gspeoOEjku/hCR6Xa3vBa7nOqW21eZqvy1lOaNoLtsC31TQBQk3rtM9MuCkdQVKEKeUWxgkU1LMFZ6xDmm4z35HP2Avbay+DTwxP3gLl/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776968712; c=relaxed/simple; bh=tuztsZg6j+uKWf5g7I+kM6WSvEjSsUwygj9J4JO1AcU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H7ULcmdUUx4C4us1AqK+5FFJLRJu2MM8YjOeEv28rMWdFCjJCHAHn6ktMDMLyYvIc9CYO7kJSZGfhK84wjf+uKKAek7EMTdl65KIjuec8YQb4qFtlvuH+CO9hTaEYfQAWa8EjEAyN0pLYMvp06ZJphTPXMi4jes0rnVIYB+SQdc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=VupDhkN7; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="VupDhkN7" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=K1v7YXfUKlUQLu//wZ3hNgODosNPo4KQOWQbzpNH9LY=; b=VupDhkN7jh55tw/v8z1nCQCRtS a5rwRuyMoi1qLtCB7d4TSwscdnJ5nvfS9mMSjZ/FyucE5+1iUyz8Ueo71f/HvhUlhrHs3ln86lrtn nAAu0Vl/sXw3Kx6k839tg5cjhSw4541i9GY9sSZMqsEraACEjvO4Xy7e1Z+8Eh0Lvw9mc0lESdqp2 FxMzFPxOACahRKO19r4gRtqvUQkikjVEazmEaQDYSGuFrhfQXZwUi4UE/8NAlDgVbms64vtH34yXY oTPsioBtZVjBVZcUS09vF9dwJCBKcZZPT0aA5EmiIuupEearHCjcO/VBELR+1DFHrxVqscPsEFO9I OtLPloZA==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1wFyjP-0000000DrUt-3u9E; Thu, 23 Apr 2026 18:24:56 +0000 Date: Thu, 23 Apr 2026 19:24:55 +0100 From: Matthew Wilcox To: Gorbunov Ivan Cc: david@kernel.org, Liam.Howlett@oracle.com, akpm@linux-foundation.org, apopple@nvidia.com, baolin.wang@linux.alibaba.com, gladyshev.ilya1@h-partners.com, harry.yoo@oracle.com, kirill@shutemov.name, linux-kernel@vger.kernel.org, linux-mm@kvack.org, lorenzo.stoakes@oracle.com, mhocko@suse.com, muchun.song@linux.dev, rppt@kernel.org, surenb@google.com, torvalds@linuxfoundation.org, vbabka@suse.cz, yuzhao@google.com, ziy@nvidia.com, artem.kuzin@huawei.com Subject: Re: [PATCH v2 2/2] mm: implement page refcount locking via dedicated bit Message-ID: References: <9936cc799ac8b637ee58ae3bf6ec0e5eeb5306e9.1776350895.git.gorbunov.ivan@h-partners.com> 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: <9936cc799ac8b637ee58ae3bf6ec0e5eeb5306e9.1776350895.git.gorbunov.ivan@h-partners.com> On Mon, Apr 20, 2026 at 08:01:19AM +0000, Gorbunov Ivan wrote: > The current atomic-based page refcount implementation treats zero > counter as dead and requires a compare-and-swap loop in folio_try_get() > to prevent incrementing a dead refcount. This CAS loop acts as a > serialization point and can become a significant bottleneck during > high-frequency file read operations. If the file read is high-frequency, then for the page refcount to be the bottleneck, they must be small reads? Have you looked at this patch? https://lore.kernel.org/all/20251017141536.577466-1-kirill@shutemov.name/