From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (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 524BC2D063E for ; Thu, 23 Jul 2026 03:08:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784776099; cv=none; b=ptfdA05ffWZb9E/aTPTkN7YhJ6m/RAfm6ZgfobkKY5ybG6JI2AKgRYgX5Ww04ufPpMKyULZoXTnIAcgvb3/ArEEze3buueC/PfvX/bfGzSUQaQHbaE4YDdr/D8/bHJCIUYgftLxqCjleEXuute2/bBftXjBSIlFD80JTji8mZ74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784776099; c=relaxed/simple; bh=kCx6gP+H4wNz5wwdp4dPYzSw2Jex2yYPovEwdKMqFpY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fHGooGLgJmELFESaCK3RbcItahBgNQYJaWoMH2pFfFjHDrN5h+3wkdLUMiwyoZjRDrBffN0Oj+C2fUTSdTxvGqeQtxjQ5jxRJrENUendxruA6WE1x9fQHcRjV2zss5qvoelg1sgZpJdxqg+X9Qq7OP2M9oWv1mRW8BPqmeh7CD0= 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=oeTLMO1b; arc=none smtp.client-ip=91.218.175.171 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="oeTLMO1b" 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=1784776096; 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=8Zz05wCKFzzF+ciP95erphYzHKZwgsI/el6LqogE1p4=; b=oeTLMO1bRbRVs/+iyKqBKgZVSEuHswyNHKcHDd9Lwll8hBtHGnpA7xtrxjfhWUq5W7kEFv TzXlW7WeAsfWBWarCzLEKZdqAf+zCWOscARjEieJ++SjRo8tkx2auzYKUysPZa9xSGbgyi aLg3vUqU7A50FrE5qBCDEWtSkZnl0u0= 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 v2 0/2] mm: folio conversion and refactoring in do_swap_page() Date: Thu, 23 Jul 2026 11:07:50 +0800 Message-ID: <20260723030752.16979-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 page handling to do_non_swap_page() mm/memory.c | 119 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 50 deletions(-) --- 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