From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from flow-a6-smtp.messagingengine.com (flow-a6-smtp.messagingengine.com [103.168.172.141]) (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 29DF9359A90 for ; Thu, 27 Aug 2026 15:15:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787843739; cv=none; b=Ik/57BR82iS9UdFS0oD/38eRbDzBzXnxNcRalINi4Y/pp3xoek/6Cpu4Pda3EW/SUKsqiW6ZD8XsR1H7QhYkV9DbUEPOwmlkZojbTVLLCVL+M/xusAbmdg8DUTeXyv7HG4shAotyOj9z8vVEDwpYKY67jG2npxDqD1k49TBWN7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787843739; c=relaxed/simple; bh=FLQ6GILkFwLfKND/7MjEdZkSy48ZgDTKejDD3W8N1/4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EsOYl+Y8egv+cXTwJg15UHx/iZMaRLLElg5lh9uYqNmpztkIT0n50c8BAavPS39R84PZNpuGGSwNBpqs3zzHe6OBKxlfb0FDSW1CfTPJsiin5C02LZKXKAXtAAuEIyAaoWbIkynlW2ViM+YUqF4H8fjfhiobeDygut6lXao5nnQ= 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=Vh8rLUYA; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=elE2WPi0; arc=none smtp.client-ip=103.168.172.141 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="Vh8rLUYA"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="elE2WPi0" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailflow.phl.internal (Postfix) with ESMTP id 32CEA1380023; Thu, 27 Aug 2026 11:15:37 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Thu, 27 Aug 2026 11:15:37 -0400 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=fm2; t=1787843737; x= 1787850937; bh=w7v3jZKyW5YM/dZvPHiNitrQbB/s0Wrf3eO5lZfLNvo=; b=V h8rLUYAEp6IBdGqRDW3bR20Q8yA7ENN7eqrmvHy0PDCFf90onNqb9+wGJYTa3Cft wskH2UNXDnn3ybOY4l86B301cTdxVJspQ6zQFuFErdpHz0oRbW2ouu65RAJ2LIeO jumFfgyaZIRX3SrRcR5O1N40P1xcCzQzelzwaalbdFEJBS4Ppafs3RVwMjhfQweY WIZ76jBo6ZuXnPmX/yNytavQ7yFVAy+e0gZiZ/hu5Q//VOWPKsxwq8ObkiadMO9x rQH71Ga95PAQwrBhIvdT3CqKQrftcKV8kav2GYcS+egAlx5Ds9WFOeRY68RgbiS/ laZfB5eHrVKubPhvphQTA== 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=fm3; t= 1787843737; x=1787850937; bh=w7v3jZKyW5Y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ji4XuwSKcsi8Lg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 27 Aug 2026 11:15:34 -0400 (EDT) Date: Thu, 27 Aug 2026 16:15:33 +0100 From: Kiryl Shutsemau To: kasong@tencent.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Zi Yan , Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Lance Yang , Usama Arif , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Chris Li , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Youngjun Park , Shivam Kalra , Kairui Song Subject: Re: [PATCH v3 06/18] mm/huge_memory: consolidate irq and locking for folio split Message-ID: References: <20260821-swap-thp-cleanup-v3-0-9b43f5163238@tencent.com> <20260821-swap-thp-cleanup-v3-6-9b43f5163238@tencent.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: <20260821-swap-thp-cleanup-v3-6-9b43f5163238@tencent.com> On Fri, Aug 21, 2026 at 02:55:19AM +0800, Kairui Song via B4 Relay wrote: > From: Kairui Song > > Let each split helper handle its own locking instead of relying on > the caller, so both helpers manage their own irq and locking state. > This lets __folio_split() drop its local irq handling and fail label, > preparing for further cleanup. > > The file path now uses xas_lock_irq() instead of local_irq_disable() > with xas_lock(). The two are equivalent on non-RT, and > TRANSPARENT_HUGEPAGE cannot be enabled on RT anyway. This conversion > also buys consistency: every other place in mm/ that freezes a folio > while it is still reachable through the page cache already takes the > lock this way. This was actually the last plain xas_lock() on > mapping->i_pages left in mm. If we are going to support RT, spinning > on frozen folio refs could be a problem, but it already exists in > many places and should be fixed generically. > > The anon helper keeps a single local_irq_disable() as before, because > it has to cover several plain spinlocks at once. > > The dropped xas_reset() was a no-op as the xa_state is not walked > before the xas_load() under the lock. > > Reviewed-by: Zi Yan > Signed-off-by: Kairui Song Reviewed-by: Kiryl Shutsemau (Meta) -- Kiryl Shutsemau / Kirill A. Shutemov