From patchwork Fri Mar 22 08:37: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: 13599741 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 04D8CC47DD9 for ; Fri, 22 Mar 2024 08:35:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 618CC6B00A8; Fri, 22 Mar 2024 04:35:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A1D66B00AA; Fri, 22 Mar 2024 04:35:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4436E6B00AB; Fri, 22 Mar 2024 04:35:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 23BCF6B00A8 for ; Fri, 22 Mar 2024 04:35:15 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id ED3051A11ED for ; Fri, 22 Mar 2024 08:35:14 +0000 (UTC) X-FDA: 81924015348.02.1894E97 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 606A1180006 for ; Fri, 22 Mar 2024 08:35:13 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=PhuQzHg2; spf=pass (imf06.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 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=1711096513; 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=pmUSpL3QHOSykPGYv4BenNyoClD+UCyO0ng9JAI9eIlYwBUdvSfQWhbknKBfE3v5kwluW4 WHFZ9dKJAutQ+/VVhYbImqwefVeeEb9DsGv5NfRPKGLFvB7ws7ogcsf3vsxUKlGNOVIOU+ LwmjODP/TWXmwUueTGnZ0TQzvi+wn84= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711096513; a=rsa-sha256; cv=none; b=xGm+dAU0u6v+z3/Voiigc8GJMl3c4gThryKTHmVgF7iP0lIpWwngrIm5io8qBaAG+nZADK zB2FWOO899De/mFfWvafwZRE1bvBU4Rb/O4VaAjpkZoiWFOLpS8SwwEz1q1l5Vs9OnpgZB pqzzfgXVTmakzc13ho9HBdvseg80ZY0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=PhuQzHg2; spf=pass (imf06.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A37036142F; Fri, 22 Mar 2024 08:35:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25DC7C43390; Fri, 22 Mar 2024 08:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711096512; bh=S+tu/Us/naajLYwRUmTRqpD4Xo/mrCDuxEPxhqR6e8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PhuQzHg2zIDfH+NNdpucuHBPSFDXUngQkMtXneTPOFB3EXsUgkeeJH4rsslCkfhG5 4wFPvYbHSCE1xnudBCQq/bBl6/P0nYNJuw0bYM9e5eLZxxb+YECPnd20i5Txxb4zKs gGttqYPNlKI/hzAMzVxPjsOAuaBXmXgrApgVatUr4bxEiDjBVgiiVca6abAnh8U2g7 k7CNbcR2g5fpVxGiJbyhueHZGdKDDJIz8FplT+V78W6m8/Vb9yRVw27y5h1+wbwVth M0199e2qvjbnu+xUqBsqOJYP3AyHoE+7ixgaOs8916eariT5tsdciqmT0QRoiDGDPy kyPPjQTt5vogA== 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 Cc: "Alex Shi (tencent)" , Hugh Dickins , Chris Wright Subject: [PATCH v2 14/14] mm/ksm: remove set_page_stable_node Date: Fri, 22 Mar 2024 16:37:01 +0800 Message-ID: <20240322083703.232364-15-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322083703.232364-1-alexs@kernel.org> References: <20240322083703.232364-1-alexs@kernel.org> MIME-Version: 1.0 X-Stat-Signature: 4oai4zfqma6uyf95i434dtj1gffkf393 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 606A1180006 X-Rspam-User: X-HE-Tag: 1711096513-162719 X-HE-Meta: U2FsdGVkX1+PwgMT0S4Ew5iqqcVkd6LTrPnOlvaFOP16ngOc5noOmYDuscGTiwzXtBAGB6DnzumnyknINSKP7Fmd+WWv+YJhYWOJa2s5VwSyXYrIKS0Yv9mGnoWXPA0xNol/xkCg5iBr/L6mHLymqgPPJggWOKZ64YufOVKp/uhtV/cJn9X86h2G5v85dtfECAujQotwoOdlGzsFEs/2gel6EP3aZk2wCTZkA+jSe9VZ4NCVc8hKyoZOVT39JKRYsoXuu6bmyVoa2OQDuGmku1SoSZSGCHZKGuaCvLO0LhoO5cVcfAoYT5A5mVHmG3gV7Lz/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CaLtzWI4BU60IG2bOi+JLhZVzhhpedJ7BR60ZwPOPDZDp6dvu0ToG16kRRF9yhz+kjIEebdKdfQvzx7DoLTVZaLKC3mPQnOxQxelGOtMhBuK5e3lPcm/u2gq63xz9L96mqux/rWcCnmyQrH6vIzPcxRu2q7/auX84vAlaBKOACdQp+QKszKAPELpRp9NpAVLV8B2Yts7qIR/C7OfORNv9ITgy2RS4WymbEBg06vH7g== 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