Received: by 2002:a05:7412:a9a8:b0:f9:92ae:e617 with SMTP id o40csp24718rdh; Wed, 20 Dec 2023 14:49:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IGN0nRfqMDoL01opvjP2UAbGa51UWLDor6QyAUdDhwNCKMN1oFEA5lnhVaI1k3/JuI4zwKt X-Received: by 2002:a17:906:100c:b0:a23:645f:af41 with SMTP id 12-20020a170906100c00b00a23645faf41mr2464656ejm.40.1703112597708; Wed, 20 Dec 2023 14:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703112597; cv=none; d=google.com; s=arc-20160816; b=RBN0N0rLlteSMYfPwczeSHBHgTYPyixECSokCN5hB9NOzGtcoewBd4EqBKISbvmbj9 Sg1GmtBIwE+eiozEXOMuLfI7SP7erfpsOEtFnsnnMilELpX0ym4x5TpNLL/FXs9wVX5s p5q3UqnZYR9l/21uD+iocsbqlPNEKO3uEma37YBBYIBOmqwjV/V+eucBMAx10Sb8FqDt wBJgLjwkEdg6QrgZ3wy8gpaZc06u0gm9/Z9BCNSe6ZXA070Ud2d6RS87spTwCF8z+6/x dPR9vPB84Ss90D1yJAV88CyR0oqjDFUg/h2AvFZjYb2enxy3S31jMBwtON4TQvI/O96q tPwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mS0pWaBCqy9h91FWQHLx11u81chGpDs+z9F+Kww2vxc=; fh=UlFXU+hKOMcm6idRzNfe3Pu+B5L1f7aeir3C6i/NWQA=; b=cb1Lpm93nG2Slk2YvLPTLWP6MnVGBulIXw0ueUWVZM3aY+iIl2ljoE5tf08uD4UhLL e/Ap4jklfBiNLzdQOKH/oov3zCmSlXugtDF8IW0lIlxT/qUr2tUoIW4u3WrofJLkRJk+ YSr0EbgNhROq5WGao9l1rjdgQkWIlvd0CbInQ1U8uY/uZ54XyUpqLoDnZwTXvClZsdou wWLucthQD00lBfkTSetD4Ddkr5Xl/VAk/nJunTb06dMxSmiQR66uSfR+VprCI6KoS7Xa P5SwoGEne2zNWP2E8dsT8H4g0CbaLb14Pzp5TeQ0VVCEmrlRJcT582ILxbO0Mcr1B2el ro6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZOSVm+Zy; spf=pass (google.com: domain of linux-kernel+bounces-7545-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x7-20020a170906710700b00a234c8ed4f5si226665ejj.912.2023.12.20.14.49.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 14:49:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7545-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZOSVm+Zy; spf=pass (google.com: domain of linux-kernel+bounces-7545-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4DD191F24381 for ; Wed, 20 Dec 2023 22:49:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 136F24F1EC; Wed, 20 Dec 2023 22:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZOSVm+Zy" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBD244EB5D for ; Wed, 20 Dec 2023 22:46:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703112368; 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=mS0pWaBCqy9h91FWQHLx11u81chGpDs+z9F+Kww2vxc=; b=ZOSVm+Zy5YNGsxAyI/NPeK8LabP7933Z3TETlTXG399oxkuW7yYRZGiA01uYOVt3ePs3yu BSaSHMPxX7DvR+sc4Qe+UUGcHC2Zbvma7Ko0lwR33BKyZfJLO4PiKvkcndInl1WIX8FUlj DQ/vL8QvpDHDexzYy/VtXBpUBVFTUzQ= 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-509--oVgBcMTPd2G_zQpLfDtjg-1; Wed, 20 Dec 2023 17:46:02 -0500 X-MC-Unique: -oVgBcMTPd2G_zQpLfDtjg-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 4742E3C23FCD; Wed, 20 Dec 2023 22:46:02 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3692540C6EB9; Wed, 20 Dec 2023 22:46:00 +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 21/40] mm/rmap: remove page_add_anon_rmap() Date: Wed, 20 Dec 2023 23:44:45 +0100 Message-ID: <20231220224504.646757-22-david@redhat.com> In-Reply-To: <20231220224504.646757-1-david@redhat.com> References: <20231220224504.646757-1-david@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 All users are gone, remove it and all traces. Signed-off-by: David Hildenbrand --- include/linux/rmap.h | 2 -- mm/rmap.c | 31 ++++--------------------------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/include/linux/rmap.h b/include/linux/rmap.h index b5da3d86200e4..fe7b5a8b0e75b 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -239,8 +239,6 @@ void folio_add_anon_rmap_ptes(struct folio *, struct page *, int nr_pages, folio_add_anon_rmap_ptes(folio, page, 1, vma, address, flags) void folio_add_anon_rmap_pmd(struct folio *, struct page *, struct vm_area_struct *, unsigned long address, rmap_t flags); -void page_add_anon_rmap(struct page *, struct vm_area_struct *, - unsigned long address, rmap_t flags); void folio_add_new_anon_rmap(struct folio *, struct vm_area_struct *, unsigned long address); void folio_add_file_rmap_ptes(struct folio *, struct page *, int nr_pages, diff --git a/mm/rmap.c b/mm/rmap.c index 7f380f5a34c90..87415bbf24022 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1270,7 +1270,7 @@ static void __page_check_anon_rmap(struct folio *folio, struct page *page, * The page's anon-rmap details (mapping and index) are guaranteed to * be set up correctly at this point. * - * We have exclusion against page_add_anon_rmap because the caller + * We have exclusion against folio_add_anon_rmap_*() because the caller * always holds the page locked. * * We have exclusion against folio_add_new_anon_rmap because those pages @@ -1283,29 +1283,6 @@ static void __page_check_anon_rmap(struct folio *folio, struct page *page, page); } -/** - * page_add_anon_rmap - add pte mapping to an anonymous page - * @page: the page to add the mapping to - * @vma: the vm area in which the mapping is added - * @address: the user virtual address mapped - * @flags: the rmap flags - * - * The caller needs to hold the pte lock, and the page must be locked in - * the anon_vma case: to serialize mapping,index checking after setting, - * and to ensure that PageAnon is not being upgraded racily to PageKsm - * (but PageKsm is never downgraded to PageAnon). - */ -void page_add_anon_rmap(struct page *page, struct vm_area_struct *vma, - unsigned long address, rmap_t flags) -{ - struct folio *folio = page_folio(page); - - if (likely(!(flags & RMAP_COMPOUND))) - folio_add_anon_rmap_pte(folio, page, vma, address, flags); - else - folio_add_anon_rmap_pmd(folio, page, vma, address, flags); -} - static __always_inline void __folio_add_anon_rmap(struct folio *folio, struct page *page, int nr_pages, struct vm_area_struct *vma, unsigned long address, rmap_t flags, enum rmap_level level) @@ -1419,7 +1396,7 @@ void folio_add_anon_rmap_pmd(struct folio *folio, struct page *page, * @vma: the vm area in which the mapping is added * @address: the user virtual address mapped * - * Like page_add_anon_rmap() but must only be called on *new* folios. + * Like folio_add_anon_rmap_*() but must only be called on *new* folios. * This means the inc-and-test can be bypassed. * The folio does not have to be locked. * @@ -1479,7 +1456,7 @@ static __always_inline void __folio_add_file_rmap(struct folio *folio, if (nr) __lruvec_stat_mod_folio(folio, NR_FILE_MAPPED, nr); - /* See comments in page_add_anon_rmap() */ + /* See comments in folio_add_anon_rmap_*() */ if (!folio_test_large(folio)) mlock_vma_folio(folio, vma); } @@ -1593,7 +1570,7 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma, /* * It would be tidy to reset folio_test_anon mapping when fully - * unmapped, but that might overwrite a racing page_add_anon_rmap + * unmapped, but that might overwrite a racing folio_add_anon_rmap_*() * which increments mapcount after us but sets mapping before us: * so leave the reset to free_pages_prepare, and remember that * it's only reliable while mapped. -- 2.43.0