From patchwork Mon Mar 25 12:48:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 13602015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD2B9C54E64 for ; Mon, 25 Mar 2024 12:45:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A8296B0087; Mon, 25 Mar 2024 08:45:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3570C6B0089; Mon, 25 Mar 2024 08:45:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 245A16B0095; Mon, 25 Mar 2024 08:45:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 129046B0087 for ; Mon, 25 Mar 2024 08:45:48 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 87E67404E1 for ; Mon, 25 Mar 2024 12:45:47 +0000 (UTC) X-FDA: 81935533134.22.7E233A8 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id 0F363C0009 for ; Mon, 25 Mar 2024 12:45:45 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=c1AJXD1u; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711370746; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=Fk10yVNmoGI7PxmI946/2yMlfyp9ItfI1/GCHgMQQqo=; b=KOcoUHBaJkPX77GN1N31X+U4gcs33ovbev5G4fZtcAUpNnmzzXpcfoC+cFBmG3m3lCWKUN VyzFrR1k7Vhzfn5cVw8RJdPID18A6d7wy6T2UxzK1X+O0aXAMveIY15qKXZSzGdZdWpzqK 8A+l1zGX+Ix72ZPb7tmaIA2pad4UEDM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=c1AJXD1u; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711370746; a=rsa-sha256; cv=none; b=Vh4Z6Mx1n+hPva12AWFh3TR5u64O3waim7XhKouL3b+5ovWb2+4tm86xh+4zM/f3ePA3Qu 344zvECUxdLIyGt11EL2GexgAnhsBQC4BWDzp+I0FDTotgzfabrpyhi2Y0j78IQ6Tz0Uwx 2m70bgkfAJo8W24VXFvGm5tq+9TImWg= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EEC6260F61; Mon, 25 Mar 2024 12:45:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C154BC43399; Mon, 25 Mar 2024 12:45:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711370744; bh=6S1jpM8cRjal0ma04kQFc9hgNF7SQSqnoGDvQZoxzUA=; h=From:To:Cc:Subject:Date:From; b=c1AJXD1uJxo0/HCChDVUYuM+YaNpjXA5bpAV6DV/h2IDgJpbREmcfv4+oXFnOrFIy d1We1AV3bqL+RhTjJCiDHTH4YfzHWpxd31KIvvGMbVidqh1obvpEPLymxNPIVomFDs Y52v/+fm2dy7E1LHyjNEAnAOLSZkLB1Bj9uNUEVczkKWvEPzKrH4IZJ7wCYvK6MQ3H XeTfFJJk8WKOzOIzaqvFowEJ71Azh6RUdOr7N++V2mYRJGuW4NmvQQ3iRf5M+UwG47 1btU0QcIJjwT0uonQst7dpUcB7I/en2EFPGSIjebAPxJiUtSOc0Yz+vnKEtrGmdwls UFl04zznNZ6CQ== From: alexs@kernel.org To: Matthew Wilcox , Andrea Arcangeli , Izik Eidus , david@redhat.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ryncsn@gmail.com Cc: "Alex Shi (tencent)" Subject: [PATCH v2 00/14] transfer page to folio in KSM Date: Mon, 25 Mar 2024 20:48:47 +0800 Message-ID: <20240325124904.398913-1-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: 0F363C0009 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: k58pudrirckxwg8jtko11qodxgx3iiw8 X-HE-Tag: 1711370745-413853 X-HE-Meta: U2FsdGVkX1+DIGnoyNpYDRLTjb63MtQo79aUEGMmcp3hpererrvrzUlyOJG0mQJbLYncKIDdP/s1TciuffmutYuM1cwyUAB6icmOHCxaN9oHZCD59krX6+CeCCX0z1yrnqPtghbrnO246tfzR+gDWG7YWxhoPy2LOeX86eLof8jgLSAbMwjcYP5COLfN2z0YK6CsncbIKt0Wx9poCotV/3YmR+8R4fBwQQJCxgh2cDhZ+Bzae+ZhuIJO46FTokVMRI7w2tlDpbOx/Qm/YlKFUvVQVjbAWxd4nxJs9OpXpwh5UN+Hfe7dNp/CEZCFKGAyIbNrbdyU1Gn5KwAGthVmvZZ3vMPui05uGPNlL5wk3V1f3Jdthk61TN+BMs5M4U8cHb32C95RH3H77nBKcb+YqyRh0oiTWCk96dJiTlPBnzGwDrtgB6hkFbmzNu4BgtnTVJFeyvjSLugWQwXv0o6m1tm3NwWx7M67qbwIttut/lhuPw2Y0LDrAZ6debF+oAbFnYi8pcNmOmfb6EHw4S6saz1PyN/+8nYkq7sEoUcsNC+hLVHCSMkpoH692JhCNY4YiWEJnfGLG2QooEJo85GZV9p7gbVQUGj0BZwHbrfyy+4jVXg3fH613Ss8x0IIE4VN5AAeGCSNS9Q/PtC5gNUaZBtne685urvNaoU5bSmMiDHP8qiqiZCYmlRWXkh9vnkTHr2pyBM6WGAcN9XLxUbWnAuOqLWRWNoeqHorwFZEsGIFVu8cLZMyZqIhMEZKV/MmJEbhUO2U1OGy5wpZJQB4pQeIqIDGluK0k/cxKpml3BKKAEhBhORGUSTwkGXcE706VG+ZI0hgne3ftfsV9mI1kiCdvXEHAce+vVSuuW9zSxrBGNQDTggAYz7dZ0Ay8Tgeq7UbLUb4i3yP9+TjzAJ8m1nuC8ndtKawBdwxFAqtegiUYqdkPhHfp+MjxQWteJU5SvGHsv/9QQF8UeqgMiw rNQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: "Alex Shi (tencent)" This is the first part of page to folio transfer on KSM. Since only single page could be stored in KSM, we could safely transfer stable tree pages to folios. This patchset could reduce ksm.o 81kbytes from 2570760 bytes on latest akpm/mm-stable branch with CONFIG_DEBUG_VM enabled. It pass the KSM testing in LTP and kernel selftest. Alex Shi (tencent) (14): mm/ksm: add ksm_get_folio mm/ksm: use folio in remove_rmap_item_from_tree mm/ksm: add folio_set_stable_node mm/ksm: use folio in remove_stable_node mm/ksm: use folio in stable_node_dup mm/ksm: use ksm_get_folio in scan_get_next_rmap_item mm/ksm: use folio in write_protect_page mm/ksm: Convert chain series funcs to use folio mm/ksm: Convert stable_tree_insert to use folio mm/ksm: Convert stable_tree_search to use folio mm/ksm: return folio for chain series funcs mm/ksm: remove get_ksm_page and related info mm/ksm: use folio_set_stable_node in try_to_merge_one_page mm/ksm: remove set_page_stable_node mm/ksm.c | 259 ++++++++++++++++++++++++++------------------------- mm/migrate.c | 2 +- 2 files changed, 131 insertions(+), 130 deletions(-)