From nobody Mon Dec 29 00:37:54 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D575C4167B for ; Mon, 4 Dec 2023 14:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233616AbjLDO4y (ORCPT ); Mon, 4 Dec 2023 09:56:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235947AbjLDOYl (ORCPT ); Mon, 4 Dec 2023 09:24:41 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDFAB2130 for ; Mon, 4 Dec 2023 06:23:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701699782; 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=v4HAiul36EO+vclRiaij572sHtWWM/DwfWC2VtVH9HE=; b=a76vBY38PqDSwobO96nI3/5poYp/A9ihfLT48/Y7WQS+BVYdwy3pozrFyougVaFzQN88D9 Jwv8YvIgN5AX91Mk/4ZeQAmHOecPBlZqbYp+8JZO6Ev63LRvRXkncO19PM1eMDnudLqQbx LnMM4vxKYFOhjecZ7cCkntwEGgOWwG8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-38-f9IMTYTNM3mqQeNw2EDP9A-1; Mon, 04 Dec 2023 09:22:59 -0500 X-MC-Unique: f9IMTYTNM3mqQeNw2EDP9A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 0378589CA00; Mon, 4 Dec 2023 14:22:59 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.195.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 661192026D4C; Mon, 4 Dec 2023 14:22:57 +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 RFC 37/39] mm/rmap: remove page_try_dup_anon_rmap() Date: Mon, 4 Dec 2023 15:21:44 +0100 Message-ID: <20231204142146.91437-38-david@redhat.com> In-Reply-To: <20231204142146.91437-1-david@redhat.com> References: <20231204142146.91437-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 84439f7720c62..3c1df8e020188 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -251,7 +251,7 @@ void hugetlb_add_anon_rmap(struct folio *, struct vm_ar= ea_struct *, void hugetlb_add_new_anon_rmap(struct folio *, struct vm_area_struct *, unsigned long address); =20 -/* 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) { @@ -463,16 +463,6 @@ static inline int folio_try_dup_anon_rmap_pmd(struct f= olio *folio, #endif } =20 -static inline int page_try_dup_anon_rmap(struct page *page, bool compound, - struct vm_area_struct *vma) -{ - struct folio *folio =3D 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 poss= ibly * shared to prepare for KSM or temporary unmapping @@ -481,8 +471,8 @@ static inline int page_try_dup_anon_rmap(struct page *p= age, bool compound, * The caller needs to hold the PT lock and has to have the page table ent= ry * cleared/invalidated. * - * This is similar to page_try_dup_anon_rmap(), however, not used during f= ork() - * 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 tempor= arily * unmapping a page (swap, migration) via folio_remove_rmap_*(). * * Marking the page shared can only fail if the page may be pinned; device --=20 2.41.0