From patchwork Mon Dec 4 14:21:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13478532 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 B1FE8C4167B for ; Mon, 4 Dec 2023 14:23:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 005D86B02C3; Mon, 4 Dec 2023 09:22:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EA6F56B02C5; Mon, 4 Dec 2023 09:22:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CABAF6B02C7; Mon, 4 Dec 2023 09:22:50 -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 B815E6B02C3 for ; Mon, 4 Dec 2023 09:22:50 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8937C120284 for ; Mon, 4 Dec 2023 14:22:50 +0000 (UTC) X-FDA: 81529352100.10.8451841 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf29.hostedemail.com (Postfix) with ESMTP id BDF13120018 for ; Mon, 4 Dec 2023 14:22:48 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=akUpp2j5; spf=pass (imf29.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=1701699768; 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=wmC0HbMgxf2wn+iz2jDhVN1M/dlanF/535x+xcS2yyw=; b=n5EHgss0H8aWqqIh82aFTu7WZLug8qQgd6VRfFgtY22EoOOzYUtLoSFSn/C/XA0+uDqwaD C7ZorAJDpiNiSVqL3Zv7J2+8gRnoN3hAHgODnHhZGnmOhRFIs7JRBKsb8e8VPW9aqb2F6Y 0KLoxcsuFRVSgeBfiy5AgzoI1yxGK2o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701699768; a=rsa-sha256; cv=none; b=v8d40Spz3DMxvn8jVfomZciQUhxCxr3rEuOU0yKGWdxzLye+n4Vza3PYFP8MCcPmj0C+9W eiM371sYxHJbOc+zyMgIwgbqtCrksBkjiOETniMGNFAH6AGvgoB8bFjAbzwHFS1rRYtM/c sck4YVVCaeLqifwmuZUwx2+/BpuS/oE= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=akUpp2j5; spf=pass (imf29.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=1701699768; 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=wmC0HbMgxf2wn+iz2jDhVN1M/dlanF/535x+xcS2yyw=; b=akUpp2j522F1OCy/HmXEqMcwJWIKBk0306uZlbgs1hHKI4lW+ktEg+MljnMGPXJ3OBz/HV y/V56cMacxfWisAwgP+Err59q2ewOIyADDofgyAuJRCj4kVN6J6pDk+GsgvHE07OmAGB1T +/fFMoGxQSi7sD+Ge9qLbQVmb4kzqo0= 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-668-0wmHc9idP7KPtoNc59ZDjA-1; Mon, 04 Dec 2023 09:22:47 -0500 X-MC-Unique: 0wmHc9idP7KPtoNc59ZDjA-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 8FEA085A5B5; Mon, 4 Dec 2023 14:22:45 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.195.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA6A22026D4C; Mon, 4 Dec 2023 14:22:43 +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 30/39] mm/rmap: page_remove_rmap() -> folio_remove_rmap_pte() Date: Mon, 4 Dec 2023 15:21:37 +0100 Message-ID: <20231204142146.91437-31-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-Stat-Signature: o65ncnudwee1rf5spitrqfzojbkgber7 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BDF13120018 X-Rspam-User: X-HE-Tag: 1701699768-441948 X-HE-Meta: U2FsdGVkX1+tHz1oMlum93lf/U93n4IuO7JVZbD5GCVSvTaDB6WcBf70+OgQ1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vP8349kz+2O08zuJKRz//9BJvs5Pgfd8aoGHl1WSo3K+PYQ7TvH6Op45bZ5yA== 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: Let's convert try_to_unmap_one() and try_to_migrate_one(). Signed-off-by: David Hildenbrand --- mm/rmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index 50b6909157ac1..4a0114d04ab48 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1598,7 +1598,7 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma, /* * When racing against e.g. zap_pte_range() on another cpu, - * in between its ptep_get_and_clear_full() and page_remove_rmap(), + * in between its ptep_get_and_clear_full() and folio_remove_rmap_*(), * try_to_unmap() may return before page_mapped() has become false, * if page table locking is skipped: use TTU_SYNC to wait for that. */ @@ -1879,7 +1879,7 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma, if (unlikely(folio_test_hugetlb(folio))) hugetlb_remove_rmap(folio); else - page_remove_rmap(subpage, vma, false); + folio_remove_rmap_pte(folio, subpage, vma); if (vma->vm_flags & VM_LOCKED) mlock_drain_local(); folio_put(folio); @@ -1947,7 +1947,7 @@ static bool try_to_migrate_one(struct folio *folio, struct vm_area_struct *vma, /* * When racing against e.g. zap_pte_range() on another cpu, - * in between its ptep_get_and_clear_full() and page_remove_rmap(), + * in between its ptep_get_and_clear_full() and folio_remove_rmap_*(), * try_to_migrate() may return before page_mapped() has become false, * if page table locking is skipped: use TTU_SYNC to wait for that. */ @@ -2240,7 +2240,7 @@ static bool try_to_migrate_one(struct folio *folio, struct vm_area_struct *vma, if (unlikely(folio_test_hugetlb(folio))) hugetlb_remove_rmap(folio); else - page_remove_rmap(subpage, vma, false); + folio_remove_rmap_pte(folio, subpage, vma); if (vma->vm_flags & VM_LOCKED) mlock_drain_local(); folio_put(folio); @@ -2379,7 +2379,7 @@ static bool page_make_device_exclusive_one(struct folio *folio, * There is a reference on the page for the swap entry which has * been removed, so shouldn't take another. */ - page_remove_rmap(subpage, vma, false); + folio_remove_rmap_pte(folio, subpage, vma); } mmu_notifier_invalidate_range_end(&range);