From patchwork Mon Mar 25 12:49:01 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: 13602029 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 A69F7C54E58 for ; Mon, 25 Mar 2024 12:46:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35B4C6B00AF; Mon, 25 Mar 2024 08:46:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30BE66B00B0; Mon, 25 Mar 2024 08:46:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15D7A6B00B1; Mon, 25 Mar 2024 08:46:31 -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 F19AD6B00AF for ; Mon, 25 Mar 2024 08:46:30 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D30B01A016D for ; Mon, 25 Mar 2024 12:46:30 +0000 (UTC) X-FDA: 81935534940.28.4EFB948 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf24.hostedemail.com (Postfix) with ESMTP id C547C18000C for ; Mon, 25 Mar 2024 12:46:28 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YvNscglB; spf=pass (imf24.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711370789; a=rsa-sha256; cv=none; b=GE+9bM205Cv849EfgMSXTmReplUqbYvVA6KPlhjWTb3MuYMYYfAb/fDogWhP78aNcITMZ4 orH2+jvtlM8buKukU6FTiD6FRu1LTzXc7ZBszJDHEDAQrr5Nbl4TAMmG4VN9LJ8rjTzQtL x9Gp61EoAccW8GGEGl/mmZr5rRcx8lc= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YvNscglB; spf=pass (imf24.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711370789; 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:in-reply-to:references:references:dkim-signature; bh=R1OQtnh64xl9MrWkPZdL6QeNOkhw3aaTLSRXVdWp5+8=; b=RAlk+bCFNA2U1Tk3Oa8QcHNgCGpoN/m9aLoW/oLldiOYkXk7mZpG1B2NIwhnp1qY7HmRr1 rj0ekq985ev/XWg3lVkiD7G01ay1dPH2CQjUpnEkmFr4kSeXQN2Pi4TrJk44WuarMIhucm 7mbSlVvCOzg9QrZe48ZJARISDKRUFP0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 1C7D8CE17D2; Mon, 25 Mar 2024 12:46:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9A90C43390; Mon, 25 Mar 2024 12:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711370785; bh=S+tu/Us/naajLYwRUmTRqpD4Xo/mrCDuxEPxhqR6e8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YvNscglBOtArFIziHJISGyWfpSQgvEjzi2V85RJigyMkJAUyjE4z1ReQJ/PIJSSXK fnB7wj6WL/CVS9I7Oeg6UH7+80lg/zNhOGX+YNQlKNlh2LmFzlLW7BkoYIvYvEpQds Uccm1d6RduJh5VK4zvtMgDW9YJKv7K8+0fskz7o1dBrAFz2AGE2B6pjndW+KT6PwEw UTFfg2NyGuFyG20oDXmM0LrLWcuLmLpRPAIPk7dUgiYvCpFV515hW6hEWgKf8Mo1B0 WrSjM/A2arN5eRndkDsjXZTbtHZX7K7WUe9EhnDP6M7JmGydKPrrRDCRq+Tpo236Co Q3B8ZPqKqhPBg== 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)" , Hugh Dickins , Chris Wright Subject: [PATCH v3 14/14] mm/ksm: remove set_page_stable_node Date: Mon, 25 Mar 2024 20:49:01 +0800 Message-ID: <20240325124904.398913-15-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240325124904.398913-1-alexs@kernel.org> References: <20240325124904.398913-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: C547C18000C X-Stat-Signature: bfpq8gsph7uemjb6eg9q9o3e53heqy6c X-Rspam-User: X-HE-Tag: 1711370788-746044 X-HE-Meta: U2FsdGVkX1/Jvlpz+oaz9VCnX6uEeO5qZU+IuJrVoQIxHJHJ++1el6l6ScNiUggr6E7u0eSQRSXHpXrTWquB1rn7v87CpT9NGHpmj+d3de/WAaKcy42hcDeZm9Gzf7Rf7yn4ezZENVgDSS38BMr1XwoC26vug34q9VomJE0rdxcIaUE3gGaWSUWcCCEe8QEPiwBE1Nr+BVaLUAfRYQgqA9GNdrsH3BmqeuxjkHm0o//wGN+NCwue1dXipu7pJc9cPr5fdSkoLC0xq7sf8aqeAjX0wQieY1sqgA0O39LtaxcPy9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1OvZ8MbbHg5khPuvLVL6L0CxYmLBsmR7njQhWoI2btoGVFR3x3FP8HULln5+mrFPy7akmsb6B/cYN//r5s7Sg8GzzKgCDL1rJCe/Ko1MGp9rddm8Iem8m/8kiZDJEhvUiWh0fOWLromXhL9UQw0jZq+KOQ0nNM90xI93gL51CwgCZSIDXR9+TFo5TavvIgyy2nJlFnEwjGC3MFM9+c5QGQ4+ORlDaKpb0sIaEu5ozfZs9Phw== 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)" Remove the func since all caller are gone. Also remove the VM_BUG_ON_PAGE() because it's not applicable for a folio. Signed-off-by: Alex Shi (tencent) To: linux-kernel@vger.kernel.org To: linux-mm@kvack.org To: Andrew Morton Cc: Izik Eidus Cc: Matthew Wilcox Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Chris Wright --- mm/ksm.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index d7c4cc4a0cc1..136909f0c5d5 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1094,17 +1094,10 @@ static inline struct ksm_stable_node *page_stable_node(struct page *page) return folio_stable_node(page_folio(page)); } -static inline void set_page_stable_node(struct page *page, - struct ksm_stable_node *stable_node) -{ - VM_BUG_ON_PAGE(PageAnon(page) && PageAnonExclusive(page), page); - page->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM); -} - static inline void folio_set_stable_node(struct folio *folio, struct ksm_stable_node *stable_node) { - set_page_stable_node(&folio->page, stable_node); + folio->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM); } #ifdef CONFIG_SYSFS