Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2756388lqp; Mon, 25 Mar 2024 08:23:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/FncZbP7nlow1E8TBo0q5mekrbi/xIzJah0678XgLqDyemdPtOfn/jHeTbSsoZ1PsYPmhZEzQuFSKcLS81QGyI6ZN7ngNC/w4wJ09og== X-Google-Smtp-Source: AGHT+IGJoXaqqhdEwm7nhZp/UGVVGZs7UvCF6PPkbgQpz0SEuzFAzoLheMLY7X8ywUqPIPbdMiT3 X-Received: by 2002:a17:906:c003:b0:a45:b91f:2f95 with SMTP id e3-20020a170906c00300b00a45b91f2f95mr4485061ejz.72.1711380217761; Mon, 25 Mar 2024 08:23:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711380217; cv=pass; d=google.com; s=arc-20160816; b=R8pRWBgmOgnZo/soucYhtFFWsVkqzLyBcAkR1R+9/o0/Rz0xaTJiaiAeqWnzhu23Rq AV1bQyFJRQoXykflZuh9pCJY4b28Wsg0QOIFOVYfJXDoVfLnkbyhLDMk0iVm7mlzhtm4 4XrMDBjS5m+PpcSfNkqzzfML/raydjzVK5t/0YjsHn5mwtQ9g38LGsTUy1DAl9YTja5l 0CQ+WUR15G3vbIH0oDqxAEvVOeo8bFHfn135dQZ6SNxWfZbcMKnvpl1qOvrkSfoBcv5r ZuWLDV9EElxEkC38gTH+5BpACy862/SOEIyrcSa+8YwznulWgZhrKVAiiimyTL3dtbeI Y9eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Fk10yVNmoGI7PxmI946/2yMlfyp9ItfI1/GCHgMQQqo=; fh=TQJHnplnHC3SujFUIJk8wlH//WjBeykbQvE/RhJ1Kqk=; b=FZBdXhAWByoyGy20EH5lvkcihTxKp8icxRyWybMCW3W3H3rp7aM6refbfkR1uSAtxF YyVNJj1BPc5pup5MxWL7PQJ4ejdq/m60VbHw52NAdz3G6ozf22AzRWKM3bsbPyn7edFt 6xg+42tGnL94eFcL4MirRgZPyfzlM/mn0NwM3clRKmb43U5W4Ls+MoeKLR/HpmIcrIit yTxW2Y2eqbULRGakiQLf9174sSibl4Q1TYx3DxO0/ehggTveQdpHd0q2O+ziv+JxPXI/ 5Cx8jG8CT15B3dzwI2LvwHBl3y2lWgpWu6J1oR1AuBA+XdbM7TvvamtbReFWxA6eaVeI 2nfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c1AJXD1u; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117032-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id sh40-20020a1709076ea800b00a4752136a44si1499449ejc.624.2024.03.25.08.23.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 08:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117032-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c1AJXD1u; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117032-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7BDC31F2ACD5 for ; Mon, 25 Mar 2024 15:23:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2C3C6BB51; Mon, 25 Mar 2024 12:45:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c1AJXD1u" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0941D46B9B for ; Mon, 25 Mar 2024 12:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711370745; cv=none; b=PWX32rRlDX9qyMp+uJEj0z4Xfxp70XMWPDxlOLQT4DYbIKcPtqDSHKEhynHipL+xuksO/I9Orhw3yT2g4r9d6XzPCzMnJph7cXNgGyo2ycfh8lPCMEu+jtKXXpp+GjjB37mcQiTNRyRfOdnkZIed3xPIxAm9NynDZPZLkRAeioQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711370745; c=relaxed/simple; bh=6S1jpM8cRjal0ma04kQFc9hgNF7SQSqnoGDvQZoxzUA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=N5wvCrt30RDjm8ARgGUTx6FIBQ9VzYVn9eKxldhq9atvbcWNn+TDxcGw6QO5f8xVn95cOyrnPbblWwib0kQb+3mACm55etNXKa2G8iJ4O2kKNWosEnjalbkvvZ+01xyMKa8yHiG7gQx6hmwIHD5G9lK0uCjUuqqeD2ZuV1bmQew= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c1AJXD1u; arc=none smtp.client-ip=10.30.226.201 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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(-) -- 2.43.0