From patchwork Wed Dec 20 22:45:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13500650 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 2727AC46CD4 for ; Wed, 20 Dec 2023 22:47:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 164718D0027; Wed, 20 Dec 2023 17:46:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 114B88D0022; Wed, 20 Dec 2023 17:46:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E83B28D0027; Wed, 20 Dec 2023 17:46:51 -0500 (EST) 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 CBFEA8D0022 for ; Wed, 20 Dec 2023 17:46:51 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id AAB69A0250 for ; Wed, 20 Dec 2023 22:46:51 +0000 (UTC) X-FDA: 81588683022.04.A88C282 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf23.hostedemail.com (Postfix) with ESMTP id C136F14000B for ; Wed, 20 Dec 2023 22:46:49 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="FLuJJv/N"; spf=pass (imf23.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703112409; 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=9XkiTziRJNAJJWRX4gshftH/Gk4w9uSE1IPr6jMrvv0=; b=NF2cZbdrwTxVZ+QF71msir70/ivIK7s+u5DGgNx/xlCw0ENa69BEExBAYnozgwwqYgBjRs BqTtooz44S6vhHGxc06chU8nAcmmiGCaFxufZ/flmwHQLTSCpw+VKeMPO6rKHnTmmOZ8jy u6sIzPfD3E212T4CbkFgFDEFY05c8Lg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703112409; a=rsa-sha256; cv=none; b=q4pLoHDrJrl/iXRFxNDIMVRK9VmB1Na0jnRziXa2n0ybE1GV1Gb4xEQTk5IQM/wSlEOoZo XmeB3j69edPeVmzYDV0ShPN0ZtgpwHTcrgeKdaN3VA6IILDQowfMgiGfTuUYXHRN0ETqUd 8ZGHhnFGfyVO0811leJSPQJpUbUqGNU= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="FLuJJv/N"; spf=pass (imf23.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703112409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9XkiTziRJNAJJWRX4gshftH/Gk4w9uSE1IPr6jMrvv0=; b=FLuJJv/NGSs52X47AWDQeItoiey9nMqObOEkxpYx2C2HPw3m0KaTdCHY32HBLIPFR16fSL u4BMFVNsycp809VGV2pFdFqtH2MQ6o8+rohgF3UEy79s16tBxNCAck2wBXmxUK+eInjXIo EzDD9mWpeDI8YQluPGOuitc3fHBD8GA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-451-NmSSg2uJMuaP3fhgO4P08A-1; Wed, 20 Dec 2023 17:46:44 -0500 X-MC-Unique: NmSSg2uJMuaP3fhgO4P08A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 62C1E38425AD; Wed, 20 Dec 2023 22:46:44 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61C2740C6EB9; Wed, 20 Dec 2023 22:46:42 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , "Matthew Wilcox (Oracle)" , Hugh Dickins , Ryan Roberts , Yin Fengwei , Mike Kravetz , Muchun Song , Peter Xu Subject: [PATCH v2 37/40] mm/rmap: remove page_try_dup_anon_rmap() Date: Wed, 20 Dec 2023 23:45:01 +0100 Message-ID: <20231220224504.646757-38-david@redhat.com> In-Reply-To: <20231220224504.646757-1-david@redhat.com> References: <20231220224504.646757-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Stat-Signature: xktjyf3hg7gebdr57y5x8ufumowgrkzi X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: C136F14000B X-Rspam-User: X-HE-Tag: 1703112409-732244 X-HE-Meta: U2FsdGVkX190UOGKlzNYtoCl+QUw8qvozjZbIWr1KfhHIKXp6P1Me3s2vpTKqtD++KjmZDR0WOEX13W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DbkQsaEndB4TtLYE3vFd444A== 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: All users are gone, remove page_try_dup_anon_rmap() and any remaining traces. Signed-off-by: David Hildenbrand --- include/linux/rmap.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 850aa74b6724c..0ad2ea2734e4a 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -253,7 +253,7 @@ void hugetlb_add_anon_rmap(struct folio *, struct vm_area_struct *, void hugetlb_add_new_anon_rmap(struct folio *, struct vm_area_struct *, unsigned long address); -/* See page_try_dup_anon_rmap() */ +/* See folio_try_dup_anon_rmap_*() */ static inline int hugetlb_try_dup_anon_rmap(struct folio *folio, struct vm_area_struct *vma) { @@ -478,16 +478,6 @@ static inline int folio_try_dup_anon_rmap_pmd(struct folio *folio, #endif } -static inline int page_try_dup_anon_rmap(struct page *page, bool compound, - struct vm_area_struct *vma) -{ - struct folio *folio = page_folio(page); - - if (likely(!compound)) - return folio_try_dup_anon_rmap_pte(folio, page, vma); - return folio_try_dup_anon_rmap_pmd(folio, page, vma); -} - /** * page_try_share_anon_rmap - try marking an exclusive anonymous page possibly * shared to prepare for KSM or temporary unmapping @@ -496,8 +486,8 @@ static inline int page_try_dup_anon_rmap(struct page *page, bool compound, * The caller needs to hold the PT lock and has to have the page table entry * cleared/invalidated. * - * This is similar to page_try_dup_anon_rmap(), however, not used during fork() - * to duplicate a mapping, but instead to prepare for KSM or temporarily + * This is similar to folio_try_dup_anon_rmap_*(), however, not used during + * fork() to duplicate a mapping, but instead to prepare for KSM or temporarily * unmapping a page (swap, migration) via folio_remove_rmap_*(). * * Marking the page shared can only fail if the page may be pinned; device