From patchwork Mon Dec 4 14:21:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13478502 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 BD12EC4167B for ; Mon, 4 Dec 2023 14:22:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CA6E6B0163; Mon, 4 Dec 2023 09:22:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 753A86B0169; Mon, 4 Dec 2023 09:22:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5FA636B016A; Mon, 4 Dec 2023 09:22:18 -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 4B3996B0163 for ; Mon, 4 Dec 2023 09:22:18 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2CF95160265 for ; Mon, 4 Dec 2023 14:22:18 +0000 (UTC) X-FDA: 81529350756.03.20854AF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 55A32180017 for ; Mon, 4 Dec 2023 14:22:16 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="MkC57k5/"; spf=pass (imf06.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=1701699736; a=rsa-sha256; cv=none; b=ddRIvbUu+9n8ftwLOWbY4tFyN+VLi34fw8WFoK1EQBevOkanJOoP0uQrmAd3AKzyZH+9c7 HRbVRsGzeMGf1XmhCK4EBXuwFaB7kD8xaBGajFDApw3ZEoHrgZXSe4fFEe18coNhUBgcHq ReH4xFlYAogg5Vlb/zsK2X+ylgLX3x0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="MkC57k5/"; spf=pass (imf06.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=1701699736; 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=O9+7fynWu7ZwbI+2ouLA8wkNah+BDZS2kzyGsyNToAE=; b=0bAOyFBONoDrCA3aaaW/f8nFYfUH4kC8jNqyTnrGdzym5m5jWPP9XezbaWYor6u0GF21eI GGI5hPICVEO6vDv117mtMs7rIIq5bnPTbcqL04xC90VzNfirOCmysPvaV4EsI/QEjQH0e1 dtHElIsQ4Byewmg7wc6FngvxTp+o5tc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701699735; 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=O9+7fynWu7ZwbI+2ouLA8wkNah+BDZS2kzyGsyNToAE=; b=MkC57k5/9apOX9TByBbc8MfBAqnP+ES4/9MKXH3IavpjrNHTMV6GdqMlzYeFmOLis5aGCn uI4Z8d4E4x1O0HAQke5XGN6aUhqKj3vOqSW5NMg671FOwDJ6pYd3xCfl18017vyX0w4Koe LaB0t0AKG/DyLn+Nu0bHCV3qlOoBgRI= 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-518-ekuHhhc4MEqvFS8uO4ctFw-1; Mon, 04 Dec 2023 09:22:11 -0500 X-MC-Unique: ekuHhhc4MEqvFS8uO4ctFw-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 0E725811E7E; Mon, 4 Dec 2023 14:22:11 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.195.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 616822026D68; Mon, 4 Dec 2023 14:22:09 +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 12/39] mm/rmap: remove page_add_file_rmap() Date: Mon, 4 Dec 2023 15:21:19 +0100 Message-ID: <20231204142146.91437-13-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-Server: rspam08 X-Rspamd-Queue-Id: 55A32180017 X-Stat-Signature: g6qk48zi6kgxngqh9779mkq486qfeq3g X-Rspam-User: X-HE-Tag: 1701699736-779105 X-HE-Meta: U2FsdGVkX19aMpzwCKIC6yGJiEjyxRf5KIFN9GeGRFS4tfN6UWhIk4TCVMnpkryiDyrwFIjtni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BndjIntS+IAhUEmaQXFLXe28c32Z+lkZS0EGBWye0hzq9qIv7rEGoKvjQ== 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. Signed-off-by: David Hildenbrand Reviewed-by: Yin Fengwei --- 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 a4a30c361ac50..95f7b94a70295 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -235,8 +235,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 *, unsigned int nr, struct vm_area_struct *); #define folio_add_file_rmap_pte(folio, page, vma) \ diff --git a/mm/rmap.c b/mm/rmap.c index 1614d98062948..53e2c653be99a 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1422,27 +1422,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