From patchwork Tue Jun 4 04:24:42 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: 13684605 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 E45EDC27C52 for ; Tue, 4 Jun 2024 04:21:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C32176B0085; Tue, 4 Jun 2024 00:21:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE1386B0089; Tue, 4 Jun 2024 00:21:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 997EF6B0092; Tue, 4 Jun 2024 00:21:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 721C96B0085 for ; Tue, 4 Jun 2024 00:21:38 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 29447A07DC for ; Tue, 4 Jun 2024 04:21:38 +0000 (UTC) X-FDA: 82191907476.24.9A6874B Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf06.hostedemail.com (Postfix) with ESMTP id 3B996180004 for ; Tue, 4 Jun 2024 04:21:35 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UpVI0MWG; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 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=1717474896; 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=yQVhcs7phxLi9XFnQ6bqLciIXvgxkKKJ73UF/BoYhY0=; b=a7vc+1vO6xKpWoxrlU2M/i3hM42EXNc3FWsKUf7U9KEI7XE7fnB8P/hp81MOxFIJAoTvEB PSe3B8y9SxrC0tJoiJckGDFMxxnJkTlaaUDIlnwmk6jxWGatmenGPbg3W/bU0iItN4pMS7 uBkl8zC1mdi4yWBgcbZgDrcyQRV8ojo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717474896; a=rsa-sha256; cv=none; b=hqQpSs2vuKKzlSp90OGgsVgjKea2RBaZ/2U+8KJyIKvPP+wT7iXQ3bKlVrkVXpCskNouzh msWJ6kCU0hcfSXnmAx4FUKnjUYKTlxiwpdDTgTYjFx4kaVspwMHPvXZC5exeSBSi+Je0Z9 JR7vyET+XHP+ieOceb/KnWhH2pFo4XQ= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UpVI0MWG; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id DEFA4CE0FFA; Tue, 4 Jun 2024 04:21:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E65FDC2BBFC; Tue, 4 Jun 2024 04:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717474892; bh=WB96U8psVIt6mbqurUhHZdffu9nyfOCHtJ4CLQlAbng=; h=From:To:Cc:Subject:Date:From; b=UpVI0MWGFrpsXplgU/n2fwK4ELaQ+xo8GHRLZJJzpQiGlCsZ3Am8B/S5R1OhvYTqE qS0bo2QQMWm+bFkuKkvJV3WZRhYPQ5fjr34Q/7UWqc3Y0Ud2ZdCTXa4ezziGs5JyLg ZwwwDAlJC/0fsMkdWh+fDA3xeX+grM2aPQO02UKjzYO0c5j0Hp0lmsymA/lT2t2T8L w4H8ygWBW4dWEMlAkb2QX3RmhavUlH5yvA2Wvju42JJ4aVxk3diICbR6+XO/gQA0Zv 0Rrew7nzYrgVeO39VBYc1Aal+LAlTKMNG/gwsYYF2dyrcpXS92ssxJ+mzUKktRWUex kSDDbQHAR0Ang== From: alexs@kernel.org To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, izik.eidus@ravellosystems.com, willy@infradead.org, aarcange@redhat.com, chrisw@sous-sol.org, hughd@google.com, david@redhat.com Cc: "Alex Shi (tencent)" Subject: [PATCH 00/10] use folio in ksm Date: Tue, 4 Jun 2024 12:24:42 +0800 Message-ID: <20240604042454.2012091-1-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Stat-Signature: e4ug4p1th7ufz38xxqn7dtm3tj49oqt1 X-Rspamd-Queue-Id: 3B996180004 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1717474895-731837 X-HE-Meta: U2FsdGVkX18wGD4nmJ66exvpxOo6aY8RwcDfkCE/clJvWsqF2edLKGWsgDFIrpTwZYebHS5F+45JaxLG+riG46dHX7GgPRyC2mHAtikf91iR1Knyzax19aZ259MlxwoeHxtpTkcZrLBP9Q4QA6GM+bNg4oVDjtbqISXH5g0zh3SVsTedoS1bmtMdMb8Vc9hi2tOZWNKvI45C4xuj88Jcim9JZLdbWOcz7QAO70rJwRwhC5nuHaVuKwAqGf8VSIgta+ir5XDsSvSAGrKFQb9BtpFvzW1BW+5aoEzaMfFj1NXSvR5Rc+vbkOl4ej19isMT4RVGFk4A0tKOkmKPMW5so7Ml4dusKxWj5oAVXC31Al8Dn7Dh3PZmKgIPHwugx6q36r3D1bpp/GwoA6PVlNAJJeW7fVeVtukkGn8+0i7ZX5kCuz/AFGNbGDAOxHI2kPFl7mnCGdXREkt+UlpbWmIkDF5ugbojMS1jxy7kwpxK/sGcHBp+tf7Z2dNCab9EfLpf63CrHPzmpvKKelci67m+0qOvcORvlj79vEA3912sUaVE0DbsC4h+DhvQv7TEoJHGUPzzFnIHKqL4PE8oXuRqF/98azXam5qgLEksLLw1nkZR46kHYPDvtY+4PBRgatN4RuaX4MhHmfZTfX65Wh8FffzUykOeQeYyklNaYYLV58LJpZ0i58CMbA9kZP9fMbt9b6i0z4d8E6UkAoxM6Ujh6k1DoPF8Lw9yO8rXrCmCEQVmSChJ31iK54Y+bM8SB9p5Yh6AIicf7940PTa4HgvoneH+PAwqn0MP3k+8eWD2ANfSgJGfc5ejmPyT/3DC55yvdL4qtVVYCNhqQMakptjlpuWf/tiSwwqiEb+icVmNeuS2gT407spXtwrbH5qPMCIMSFpYFy8cDiMf2lP1sCXTUneluDqJ8cfp79LbU+1YhmnzhFT5Km1Zrm5qBOTf2iAg7WbP+MjRxgbT7nUakff mWQZ7pI+ 7/7Ufi7D/U4gevD/Jo4uAlGI+aavD7kDX+1YwDeWg/+4RoQ7antEw0GoAbjQDNj4kzDKnpONThf0AUhlu/cnCf+pUkD6J2u69G2ujEEHCd4QfjkcK56MmJRk/4CtkHSvXeKgm219EwA3A0HAUF4p7wanIi53hCrzDkOn5H/nJltccwZNDM/N3lRAJULs4DDwYVucCkZ/V7iRryPjmv8QLwplQ9JkTVDt/swK2i+OnsYvHJBLcRvzf3QaIfUq7I/gWK5yP 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 2nd part to use folio in ksm, it saves 82kbytes in ksm.o and passed all ksm testcases in kselftest. KSM still split same folios to single page if they are good to be KSM, but will skip the rest subpage checking if a folio couldn't suit for ksm. Alex Shi (tencent) (10): mm/ksm: reduce the flush action for ksm merging page mm/ksm: skip subpages of compound pages mm/ksm: use folio in try_to_merge_one_page mm/ksm: add identical_folio func mm/ksm: use folio in stable_tree_search mm/ksm: remove page_stable_node mm/ksm: use folio in unstable_tree_search_insert mm/ksm: use folio in try_to_merge_xx serie funcs mm/ksm: calc_checksum for folio m/ksm: use folio in ksm scan path include/linux/mm.h | 17 ++++ mm/ksm.c | 230 +++++++++++++++++++++++---------------------- 2 files changed, 135 insertions(+), 112 deletions(-)