Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp205995lqg; Wed, 10 Apr 2024 23:14:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLlzhaoAHVFc8s92d9ON3nlqzvajp4NgiiACehoWvZgaLYeq9CvgjXAugAFJs5jQou4vRXazXewFLQShKI+nFazHHzL/znjCe052YiTw== X-Google-Smtp-Source: AGHT+IEc5wSKxrfCCCXtDkAKclReHdjIVGzZGNHs6LMV6pZTxp+3Z40ewxFFCjDJU84DEadodajf X-Received: by 2002:a17:906:af1b:b0:a52:17f:e693 with SMTP id lx27-20020a170906af1b00b00a52017fe693mr2613387ejb.18.1712816072320; Wed, 10 Apr 2024 23:14:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712816072; cv=pass; d=google.com; s=arc-20160816; b=s20CU3wkzTjfe2FFLdIDQi+FWvFb1TGjMolsVDIUrCJpVVcvP8fQGi3vfN/stXnSE/ YSEqabBx9ibvgdKBPG5u5sRuPEZc16BD+RyboExedyL6Ay0Le56e0spTe1O2Ew+/Mxfc WX3BMMvj8Ef/h1mcfknL9EZAKt3rBwKeVBupVRR4hSPXGphWF7sO/2zDJMHP6+dOw9BH 4B4yCApGtUMbpiP2KKhBq+5+VNL6z3+ecp0/at17fO79bdr4dcFgYnls4aHvTGkNyooD 8R4w0WV6XeaHxEb6/+ohMJcHMAYxnKHbqiFBM8Rwc6HagvzWwxF9rw03EyvGiRA/xSl6 a/5A== 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=8Vr1duL7Y/DzNu5+Ub4+pO7UQTKy93O+Pj9bGilG8FM=; fh=UIvCWTSQqFxvN4+RyuiedJaYtxXF77YdqwYvKO7NqsY=; b=aFkQB7VEsVGVqw2gDei2eaFZl7IuS8BRiI4VA7EYk+MwbHxP72h2dVG++6E/BnFC0R XArWxMJLY0mOShFvtK98jVrEYMejBfx6eouy7o7MCQQOKdiOKUqZFnrJ691jHpLQgSau vHtm5JiVrZK6GXDOmt1VlpsXLSJmlkCHXtG5udQD8AFHBd6npHJdU7PpiuUxZT7t+ELD GDn1peZSzDSlXYNO585x8nFp+Y2+I8wWrVBiUinY4seDIMJ3vb8DLaLQKSvV4Nazpj7h S+eXpBuZnmSUP0bpGE1B/lge/rE7aj8pwuQRM2j8Key1iW/4ZpdPGJqg7NWv09aAXzem v8WA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OVzRFEao; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139823-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139823-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 nc15-20020a1709071c0f00b00a5227c7b48fsi30421ejc.55.2024.04.10.23.14.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 23:14:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139823-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=OVzRFEao; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139823-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139823-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 113841F258D4 for ; Thu, 11 Apr 2024 06:14:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0A6713CF87; Thu, 11 Apr 2024 06:14:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OVzRFEao" 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 BCDA413CABC for ; Thu, 11 Apr 2024 06:14:14 +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=1712816054; cv=none; b=U5S1pHBXbvky/7S/4gPX4v6qJowlSM0TQnRgzDttctm6uS1ZNys7cW/jpYHiRvPYCae2Z+7R6yNhm1ci4fiTygc772xKNN5HgjEkN2trzTDi4oO9UdT36Xe5/lpEMtkzPdWs7mIUtU5ZZXq2TRE4TLkSPmj1ckpZ00WwBLTaQ7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712816054; c=relaxed/simple; bh=+FjVUrA5fdJ/d6cNIYDRyBigkWREtGjUPt3tLRh4HVU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ssZNQUlsiDdaxqtnRw6xr4PCgC2Tqr8BwG4bDuKFMbuHoicgnvxlPk053POl59Z6/XWh7RjB/hElT10ogkPCLnvHJukrGLsh9AEb76G/vQ9hyNkpFx3WtgsogU0KlwRj/0cc9C9tvlr6blZ24Q6uv4dyPPbFBaHN82RLv5J2AAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OVzRFEao; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34306C43394; Thu, 11 Apr 2024 06:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712816054; bh=+FjVUrA5fdJ/d6cNIYDRyBigkWREtGjUPt3tLRh4HVU=; h=From:To:Cc:Subject:Date:From; b=OVzRFEaoSt0A4KVfm5E7VwlmSq2+5A5/TgVy0mvWq75wHhDkSONuQu6HrN9TFeQeK t+gtz2xqgdoxRur0Dgp6NJlpbat/i81CJwJA2L/jynBh8Q1upFfC1DBiDNGaIcOlmM P1pyg7O2zKYgHNz6RrhZ7HUSE9mFjU9JzuKkPGpB8HUvGZRv1AP/lUPVFFqF5UkdOm 0WAQM8PhfJCvDYNTEA+WeoccqM2cJP7Ka8+7ifacsnQ6SsCAIG/yqVZimoeMdacmac H6A06vD7xZwdYhLipEmoJjLG0vNfuTLRdBjMaxXEzqb25mjVaYCZ15N9uTL7vmKhQl kttN088xOQMAA== From: alexs@kernel.org To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, zik.eidus@ravellosystems.com, willy@infradead.org, aarcange@redhat.com, hughd@google.com, chrisw@sous-sol.org, david@redhat.com Cc: "Alex Shi (tencent)" Subject: [PATCH v5 0/10] transfer page to folio in KSM Date: Thu, 11 Apr 2024 14:17:01 +0800 Message-ID: <20240411061713.1847574-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 57kbytes from 2541776 bytes on latest akpm/mm-stable branch with CONFIG_DEBUG_VM enabled. It pass the KSM testing in LTP and kernel selftest. Thanks for Matthew Wilcox and David Hildenbrand's suggestions and comments! Alex Shi (tencent) (9): 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 and replace get_ksm_page mm/ksm: replace set_page_stable_node by folio_set_stable_node David Hildenbrand (1): mm/ksm: rename get_ksm_page_flags() to ksm_get_folio_flags mm/ksm.c | 273 ++++++++++++++++++++++++++------------------------- mm/migrate.c | 2 +- 2 files changed, 139 insertions(+), 136 deletions(-) -- 2.43.0