From patchwork Mon Dec 4 14:21:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13478539 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 31FDDC10DCE for ; Mon, 4 Dec 2023 14:23:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 953BE6B02D6; Mon, 4 Dec 2023 09:23:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 900DA6B02D8; Mon, 4 Dec 2023 09:23:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 77CDD6B02D9; Mon, 4 Dec 2023 09:23:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 63DC96B02D6 for ; Mon, 4 Dec 2023 09:23:08 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 40550120119 for ; Mon, 4 Dec 2023 14:23:08 +0000 (UTC) X-FDA: 81529352856.22.8123244 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 8140FA001A for ; Mon, 4 Dec 2023 14:23:06 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QfDiIXM2; spf=pass (imf15.hostedemail.com: domain of david@redhat.com designates 170.10.133.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=1701699786; 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=v4HAiul36EO+vclRiaij572sHtWWM/DwfWC2VtVH9HE=; b=SfH2ZvD+rC2THCv6wM9sFYE3w9nILVTLopFYxIeGcKbSBx/pUTmunQ3n445A+cObbZiIiN Accp8CQAUSBViRqd6ZVbwAHxQ978RDOSQH8XhRzcjgV8aBeCCoBbTq4eNezqABlXIqB9JJ ypl1Y33CmUpM0xg5OeD1toXbbJ6n1aA= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QfDiIXM2; spf=pass (imf15.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701699786; a=rsa-sha256; cv=none; b=XpFNLTqJhZbiARuNg7+8MZhiqYZiSFEVDp97BCx63LgHEjfymnA1L+LsF37MJGB7809iSh X/LzhYeRp6rIOlI6UHN6rAlTjmEy7QvBnCDGs0v8MFxTGK8DK2cpvmoIrUYPac1FsZ4NXr J8QFWWqFw7km46vWSvpyp4X4PYmO6HQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701699785; 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=QfDiIXM2sIT/8GXDUL0iPJL9v03bFOpbc9kPI6UMfotLps2FKvcvgAHAvtQMrxz394tAll zzjgkrx8gF21DqrRePvRFitfjGuNJ/R1VISBMPRUI5flqteafTFsCSaK099M59lJgj+b8C xVC3Jy0mbY0ovwXMv/Nu3enYFBwERhc= 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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Rspamd-Queue-Id: 8140FA001A X-Rspam-User: X-Stat-Signature: ap14bmxwynpxqtff4owpob9nbjjicjum X-Rspamd-Server: rspam01 X-HE-Tag: 1701699786-526951 X-HE-Meta: U2FsdGVkX1+cGXJtFVVVXb9Cmv7rQyRvzmAMxjCJ6bNNcR160HLurBbzdf8Y27DgFdj0+tLcCAPrMT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xesMn3+zoTgFiZSO6aNovfm04/wiHwdOqD+csrwQv64X8YPw== 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 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_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) { @@ -463,16 +463,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 @@ -481,8 +471,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