From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 EB4983B1EC6 for ; Mon, 27 Jul 2026 16:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785168904; cv=none; b=ROJieezo9lnHeDYuMaOwdZeytHaJq7Pt2XXL9Eh32KHJD76JsoYSPzs6BvScma2VMSZl12q3CX5wukD2iyXMadn0MVZHJTVx6J9K965yk5jYakaWhzWgMU68YfmDLh7HziJsI0sGWakYbFOn/K7hXjIB7uA/+uMuw9V3mOcW4vk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785168904; c=relaxed/simple; bh=wxlItv8t4PdiEGB8eFidrKaCzV8EgkDRBxP5ie6zQmI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VY93V9xe8NbrKq6CFYiIDl+gOiHsmRhtkHq7pDiKGTVQBY62neyzwaSjxvGOoboxs02Nmhkk+G5DidBhRWV0C0IytmMUCNxMFLMDrZvRLeA9dBwsOL8MCpSTV7B8qBIxRrQjhBKbtBgdcjGlxr/ONH8jYaZc6uk7mdJLdUQz2LU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=xoEYGI25; arc=none smtp.client-ip=95.215.58.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xoEYGI25" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1785168897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=355dbbQDuZC4L5P9i/hhchYqs7B7Z47N1yGrWyl5gBk=; b=xoEYGI25zNZeAjYWq9jaMm7XTBfNUuwUCYptdSklnWVimTPRaUo0XW8TGY6pXV9omKrL15 zigtMYpd3o7O1e/YrzNa8JqLm5/5K+oXByhpgnHZMZ9gAm7w9GGFvFcaRmrQ5I3q0xQauw ZtIF+5CsITufc8XjbcVv7F+TzkiK4rE= From: Hongfu Li To: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, hongfu.li@linux.dev, Hongfu Li Subject: [PATCH v3 0/2] mm: folio conversion and refactoring in do_swap_page() Date: Tue, 28 Jul 2026 00:14:29 +0800 Message-ID: <20260727161431.13455-1-hongfu.li@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Hongfu Li Convert the device-private migration path in do_swap_page() to use folio APIs, then extract all non-swap entry handling into a new do_non_swap_page() helper to improve readability and reduce the size of the main swap fault function. Hongfu Li (2): mm: Use a folio in the softleaf_is_device_private path mm: Extract non-swap entry handling to do_nonswap_softleaf() mm/memory.c | 118 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 68 insertions(+), 50 deletions(-) --- v3: - Rename do_non_swap_page() to do_nonswap_softleaf(). - Update the commit subject and body of patch 2/2 accordingly. - Drop a blank line after the device_private condition in do_nonswap_softleaf(). v2: - Drop fault_folio, reuse the existing folio variable instead - Refresh commit messages - Update comment to use "folio" instead of "page" in the device_private path - Add Acked-by: David Hildenbrand - Add patch 2/2 to extract do_non_swap_page() from do_swap_page() - Link to v1: https://lore.kernel.org/all/20260721013347.65698-1-hongfu.li@linux.dev/ -- 2.54.0