Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4065897rdb; Mon, 11 Dec 2023 08:00:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtGn0LZjTowc6KeRfjMQ8RDWVhc4o4A3Kq8JtEY7pPTp3wx7mwqh91OYe7x2Es0nSQ7hFl X-Received: by 2002:a05:6a20:a8a1:b0:187:e646:4faf with SMTP id ca33-20020a056a20a8a100b00187e6464fafmr1808810pzb.14.1702310411957; Mon, 11 Dec 2023 08:00:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702310411; cv=none; d=google.com; s=arc-20160816; b=uTt4RzO50tGiDbr069BT1jBxPHqsO8Zumf9mmebm8Atom92l3xVPvaZG/TsKdkAPme J302zX2zI+Eu1cUK87wgOIX4NK2fZPy+X8NYUlLb3iCO+HBPTVi+8PrWP+jzO5eM/8Or WFeCkiVH/ic08Q2t3HUFvxd48vnql4jKihCz+NHKiPsA8cofBc/AUh31Mn3kWjJD+G+B 6Srkp5QroyBcOu5xXKYPu6P06UtJnH1udT5HmnILLea87yMixYlUugfCUF3RKsoPLWCq eswyL6hT+xJVts2vRpr736sif4p3VecaF9WNEr3d/2mtGk+A37X/i9hEJdUlH/WMUUz7 5OGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kqof2lbc18NuxxZ3avfpRF1Wh/FjZz2qWodEICCpfdI=; fh=UlFXU+hKOMcm6idRzNfe3Pu+B5L1f7aeir3C6i/NWQA=; b=k08c2hcrWSz2v2pnhqEuQxMLWK6zUagAmCnRm9mN3uizzWyhlIgLxZUUpPsOvhgJHA n1yhRhjGbBasPObH7uVTYTWar5ILr02+3EVJbAGrv5dd7z7KAhTm9Q3MR+cUt3asVwHt otR/Nt05t/9hTi41TK9Y3LVJ/2MMFeAaRvspg7EgQOZxS7PnJDpC99vhXxK8W4DCHxjN jKLQShzkcxSFen9NJhU75hl7KhFi2OQp9oHLm28XAUtZaosB1JPjEcX6pFbxt6QtDrXC VJRdHGcFwaOrIWHvsc/+qPqh6LNJ7LNy1GtI47xxXpfqFp4bdiAUlDyCxd6OPv0LaUPW Gshw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Dek82Fcf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id cm22-20020a056a020a1600b005b999968b87si6512839pgb.580.2023.12.11.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 08:00:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Dek82Fcf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E0184804C235; Mon, 11 Dec 2023 07:59:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344789AbjLKP7b (ORCPT + 99 others); Mon, 11 Dec 2023 10:59:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344699AbjLKP6b (ORCPT ); Mon, 11 Dec 2023 10:58:31 -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 C5E0B199 for ; Mon, 11 Dec 2023 07:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702310308; 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=kqof2lbc18NuxxZ3avfpRF1Wh/FjZz2qWodEICCpfdI=; b=Dek82FcfP1ePG6KpQA36jOa71CLOX8vBP6c49VSUAwFAEGwvnTWYhOui8dnvFeadqhmPsb sheNBAJO1ADgXzLEuSZ2nJSes2PgmorlECakazllY+REaX+x4s5k0uNHXmZ4oUIT77bvzL GS8XUb3PE0UCDn6MqA4Q6ddZUuYmAc4= 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-146-nQ4jaL5vOtq2vnJawkD1nA-1; Mon, 11 Dec 2023 10:58:04 -0500 X-MC-Unique: nQ4jaL5vOtq2vnJawkD1nA-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 E265A85A58A; Mon, 11 Dec 2023 15:57:49 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.192.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id B71401121306; Mon, 11 Dec 2023 15:57:47 +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 21/39] mm/rmap: remove page_add_anon_rmap() Date: Mon, 11 Dec 2023 16:56:34 +0100 Message-ID: <20231211155652.131054-22-david@redhat.com> In-Reply-To: <20231211155652.131054-1-david@redhat.com> References: <20231211155652.131054-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 11 Dec 2023 08:00:00 -0800 (PST) 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 3b5357cb1c09..bd4edae4dbe7 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -240,8 +240,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 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 *, diff --git a/mm/rmap.c b/mm/rmap.c index 7787499fa2ad..83cba8909848 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1271,7 +1271,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 page_add_new_anon_rmap because those pages @@ -1284,29 +1284,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_mode mode) @@ -1420,7 +1397,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. * @@ -1480,7 +1457,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); } @@ -1594,7 +1571,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