From patchwork Mon Dec 11 15:56:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13487444 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 9185DC4167B for ; Mon, 11 Dec 2023 15:57:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FDE86B010C; Mon, 11 Dec 2023 10:57:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 98BD56B010E; Mon, 11 Dec 2023 10:57:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8014D6B010F; Mon, 11 Dec 2023 10:57:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 65E8D6B010C for ; Mon, 11 Dec 2023 10:57:31 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 40E5FA1B81 for ; Mon, 11 Dec 2023 15:57:31 +0000 (UTC) X-FDA: 81554992302.23.E38F058 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 688CE160024 for ; Mon, 11 Dec 2023 15:57:29 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gDLSatI9; spf=pass (imf08.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=1702310249; 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=DP/TBY2FfVhMMZMh3t2xGvG39Fvp3GsRcAEgonPxhwA=; b=oU9DGtpPlnaOZOpL8Deqx9IdEAJs+Cw1bExLoF8/a329eMLU/0ZsHmXU6eohou4yYWXDds LHcTp42EuGvwbuUIHi2rnU0OPCZCausRftu1d8wwVSsqXi0QimOxV90rVR1bw/iws9RnSb /LLRdxmF0TC63IMGd1Ythn0TmW3yvEI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702310249; a=rsa-sha256; cv=none; b=XVpkiBOZ4bumY0bbaWcUB1vXIxQ0offtkx3oppwmSUDTuXvPZuDbd7lKprzl9FGDxAEOu5 M53qEszN4d/m7P2Uv/6P4ji6DQsCi+B/SeBNTNIvVxH+ek5ycim8KJRuc8VH08aPaJb2I7 jkKM7u3wuGCQb27JEmS8GWd5jFeVm5I= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gDLSatI9; spf=pass (imf08.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702310248; 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=DP/TBY2FfVhMMZMh3t2xGvG39Fvp3GsRcAEgonPxhwA=; b=gDLSatI95/KyDsxbQs7ZxnoLX0WitDLnd1MNChZ1hbQc3Z3AUfDi7ytkANh6efOrg1poIX 8rt22IhJd8cfEmcgSrmEuOo07PaZn4Xi9XLpgpw+bmnWs2ucMLj23Q+lFyFQrikDeNgr7X eYFVyNlNI3Z3smGENs5c3GNiR0xv1ec= 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-686-nYAYGRlYOBO4fpab-9MmDA-1; Mon, 11 Dec 2023 10:57:27 -0500 X-MC-Unique: nYAYGRlYOBO4fpab-9MmDA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 7362810133A0; Mon, 11 Dec 2023 15:57:26 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.192.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9447E1121306; Mon, 11 Dec 2023 15:57:24 +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 v1 12/39] mm/rmap: remove page_add_file_rmap() Date: Mon, 11 Dec 2023 16:56:25 +0100 Message-ID: <20231211155652.131054-13-david@redhat.com> In-Reply-To: <20231211155652.131054-1-david@redhat.com> References: <20231211155652.131054-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Rspamd-Queue-Id: 688CE160024 X-Rspam-User: X-Stat-Signature: 6c365h9gi5fhraokgigc3u9fcn8dggid X-Rspamd-Server: rspam03 X-HE-Tag: 1702310249-586922 X-HE-Meta: U2FsdGVkX1/7VtiQesPzJRQsrd6vP/KcuEZ2N0WRsHf63/ocxyYCraa0kjm47naU/pe3m1Yw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XO5dyTs+XjdufoMfgYLKOhnrCRD9kd85GlD/GajqBgZLbIyJTDQxo246+7rDPxS68yGFvLtHqmMLNPU3rfJ4A== 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, let's remove it. Reviewed-by: Yin Fengwei Signed-off-by: David Hildenbrand Reviewed-by: Ryan Roberts --- include/linux/rmap.h | 2 -- mm/rmap.c | 21 --------------------- 2 files changed, 23 deletions(-) diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 1753900f4aed..7198905dc8be 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -240,8 +240,6 @@ void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long address); void folio_add_new_anon_rmap(struct folio *, struct vm_area_struct *, unsigned long address); -void page_add_file_rmap(struct page *, struct vm_area_struct *, - bool compound); void folio_add_file_rmap_ptes(struct folio *, struct page *, int nr_pages, struct vm_area_struct *); #define folio_add_file_rmap_pte(folio, page, vma) \ diff --git a/mm/rmap.c b/mm/rmap.c index 4f30930a1162..2ff2f11275e5 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1467,27 +1467,6 @@ void folio_add_file_rmap_pmd(struct folio *folio, struct page *page, #endif } -/** - * page_add_file_rmap - add pte mapping to a file page - * @page: the page to add the mapping to - * @vma: the vm area in which the mapping is added - * @compound: charge the page as compound or small page - * - * The caller needs to hold the pte lock. - */ -void page_add_file_rmap(struct page *page, struct vm_area_struct *vma, - bool compound) -{ - struct folio *folio = page_folio(page); - - VM_WARN_ON_ONCE_PAGE(compound && !PageTransHuge(page), page); - - if (likely(!compound)) - folio_add_file_rmap_pte(folio, page, vma); - else - folio_add_file_rmap_pmd(folio, page, vma); -} - /** * page_remove_rmap - take down pte mapping from a page * @page: page to remove mapping from