From patchwork Thu Mar 28 22:58:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13609726 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 80F3ACD11DD for ; Thu, 28 Mar 2024 22:58:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 08E196B0085; Thu, 28 Mar 2024 18:58:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 03E876B0087; Thu, 28 Mar 2024 18:58:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E21AE6B0088; Thu, 28 Mar 2024 18:58:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C75B96B0085 for ; Thu, 28 Mar 2024 18:58:45 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5AAC51C1220 for ; Thu, 28 Mar 2024 22:58:45 +0000 (UTC) X-FDA: 81947964210.25.B4A0A7D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 9ED5614001E for ; Thu, 28 Mar 2024 22:58:43 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="M9B/HFIu"; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711666723; 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=Vu5CwXDNBuOWiSxR3N5sLbOyG+5OrNL0WRTk+klYQDI=; b=fT6ldXtfmawieNeWjRMF2OQjRtRVabZHFXuG1WHe53UkEvjX6xOWNXjus5l5QyYevZdsGT kYtywlmqz/h8b5PCirf9QuGuTxJ7d4oYvrw/njtHtlP/NGR2phPRP9mVJJdV6l3aT4419g eezAnX0jXQ5oRVOG62hq3Y+Dk4583pA= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="M9B/HFIu"; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711666723; a=rsa-sha256; cv=none; b=hOtFvAs+4Uq2NcnS8nX0a9OGpTNAo1CFQdLEcvK9tMhLubKusmgUgJX5fsPHts50pNgx81 QlJgQazXeZvpU7uMHKcOAzsLxA0BPS0NzA/dulfI9e+8WSokwrzbMIjHDs+CLnxFRDLlMj oYpuYdBHhvrP2W+kiTEtvHdTxjRbQeA= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Vu5CwXDNBuOWiSxR3N5sLbOyG+5OrNL0WRTk+klYQDI=; b=M9B/HFIui6M92XML4VuZ8lLv/9 f9ZKuNk1EdMCmzkkVJEhdi/DRBIAxR1cz8T/WyyYPb5XFM/LfUOqnQkxL+nsRBei4C5w2SkoI4udu LwP6IQlmBlnr4oHLFuBxfUnbq62bFdIU/OmeGYZ1WsWW9WrnO3+iBhfE1bqgX8V0cIBGA1G0eyJ1u llUKBAKpFfFzyo0hC9D7VnXP5e6cMVZtwhwn/UHnb2jK0fwRazQG+zoVnsWNZang9aF73K+BSelex 2AnuErS2i2fxke2teakcmL3XEgdQ3Pfkt+WtE6mQoNvONnO2HKAa/5iJuqADORka3e17Kgubx+2qu K3PQIn+Q==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpyhd-00000007PFW-3f9B; Thu, 28 Mar 2024 22:58:33 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 3/3] mm: Rename vma_pgoff_address back to vma_address Date: Thu, 28 Mar 2024 22:58:29 +0000 Message-ID: <20240328225831.1765286-4-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240328225831.1765286-1-willy@infradead.org> References: <20240328225831.1765286-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: byttuirfnc6fkj6owa85w83ayjstt9ag X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9ED5614001E X-HE-Tag: 1711666723-721704 X-HE-Meta: U2FsdGVkX19ztZjgzNOTOmbRp7Olo9p3497jjGtLoS/7MvE7vEhuAehKH32cIV8BsnG19eulpFNjQPorVEU+bC3FB5GAh528uhdj4jQkUEkN60X1lbjpAuRRNKQ9vjel/++wVCHagu0B47ummJn2if0NRglwpBXPGqdgESF2Tho4CbWGzgsXpsBpoewBhiNDrhxwhrUVLserKiVPpQJoH0yJaJkPZLYDo2/P22/0MyCI+ukMeJZyVh0buXxD+8ZdgPv47f6MXHixVsDCqdhxjtauY6pgJXiVRkzglBm+J6jptU70D8GnAa/Gx4aYJ7gS8C1/y57LJTtbqvst8L/unhrj0n+zot26RdsC1qVQzsZ1nACAcUQ+pR2HdwMJfrNf4N43DNX9HvG/0f6xPCbnVHQZQihD+IpKfIJWCNk5Qmt7XMKva64VIC5V7GgN4RM11DTeMOprIhdL0K9eemYFIyNNUxPfOfoLmVQ4mxcO7y7Xl1TtX2HfiRMO7/JlhVJoaa4RumoQNX03n8GzsCxiKZY/vawhOKrIBDLkFhXWbvzLxNvz7BUnZnNXgYBNvrg689gbOAei+4N8P80RVktQCEXOBSxvGS2U7IIuprC+tCGbAlXvaw6v1tyDK3iUoNHkdVpOE1QlApzvQ17nbqNJjGxV4j9EAqQOSW0MCgf6GAiF6XmtiJ3u+7Zs1rojy6XvJ+VyOzEAcmIJLugAmVWCYNyKuto2hC/xSb+dcqrwbVk8ZZv3iYP6OrbUG/7MPr85fUFVO0E78Qi35ffewJkMzfYUkOm8+TariOTXcGc8LfkzU2DTDlQ2FFSVtUK3eLIKYA7vcjN9NoUsGCmVMkUw5RbdkEzMI8w/STJNKwd1MtJA3yQq6QXxSBbOJfsAxf7IQhDSG7ROerABsAA2xfgKn19Y30WFfZgZES2aWkGLbkl3ek2u/FXSuVfvY2UTykoOBlARnNnjt5lrimikmw3 5psMD/E/ fVmccYL4BKV2gZi/saJ+gts+scFajr4b5MixZkkSiUGovmoTrksDVGNizpk2e2mdIokdm+45PCYWiFVZxdbG98rsDtLB7cx/GLmrDMUYIFAVinhAYd1G/NoiYTuse7H4gfyWmFc7/ZI2AvgqPuzOQjMvxApCZhMlMkNePEMHSqq6+VCr1RUC6DyqXIfi5sItB0yrb71yltoLtcL8Mi0h+f/Swr953EJ/AZetu 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: With all callers converted, we can use the nice shorter name. Take this opportunity to reorder the arguments to the logical order (larger object first). Signed-off-by: Matthew Wilcox (Oracle) --- mm/internal.h | 9 ++++----- mm/memory-failure.c | 2 +- mm/page_vma_mapped.c | 2 +- mm/rmap.c | 12 ++++++------ 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index e312cb9f7368..19e6ddbe7134 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -804,17 +804,16 @@ void mlock_drain_remote(int cpu); extern pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma); /** - * vma_pgoff_address - Find the virtual address a page range is mapped at + * vma_address - Find the virtual address a page range is mapped at + * @vma: The vma which maps this object. * @pgoff: The page offset within its object. * @nr_pages: The number of pages to consider. - * @vma: The vma which maps this object. * * If any page in this range is mapped by this VMA, return the first address * where any of these pages appear. Otherwise, return -EFAULT. */ -static inline unsigned long -vma_pgoff_address(pgoff_t pgoff, unsigned long nr_pages, - struct vm_area_struct *vma) +static inline unsigned long vma_address(struct vm_area_struct *vma, + pgoff_t pgoff, unsigned long nr_pages) { unsigned long address; diff --git a/mm/memory-failure.c b/mm/memory-failure.c index bdeeb4d2b584..07d40d40ec96 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -443,7 +443,7 @@ static void __add_to_kill(struct task_struct *tsk, struct page *p, tk->addr = ksm_addr ? ksm_addr : page_address_in_vma(p, vma); if (is_zone_device_page(p)) { if (fsdax_pgoff != FSDAX_INVALID_PGOFF) - tk->addr = vma_pgoff_address(fsdax_pgoff, 1, vma); + tk->addr = vma_address(vma, fsdax_pgoff, 1); tk->size_shift = dev_pagemap_mapping_shift(vma, tk->addr); } else tk->size_shift = page_shift(compound_head(p)); diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index ac48d6284bad..53b8868ede61 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -334,7 +334,7 @@ int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma) .flags = PVMW_SYNC, }; - pvmw.address = vma_pgoff_address(pgoff, 1, vma); + pvmw.address = vma_address(vma, pgoff, 1); if (pvmw.address == -EFAULT) return 0; if (!page_vma_mapped_walk(&pvmw)) diff --git a/mm/rmap.c b/mm/rmap.c index 4b08b1a06688..56b313aa2ebf 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -794,7 +794,7 @@ unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) /* The !page__anon_vma above handles KSM folios */ pgoff = folio->index + folio_page_idx(folio, page); - return vma_pgoff_address(pgoff, 1, vma); + return vma_address(vma, pgoff, 1); } /* @@ -1132,7 +1132,7 @@ int pfn_mkclean_range(unsigned long pfn, unsigned long nr_pages, pgoff_t pgoff, if (invalid_mkclean_vma(vma, NULL)) return 0; - pvmw.address = vma_pgoff_address(pgoff, nr_pages, vma); + pvmw.address = vma_address(vma, pgoff, nr_pages); VM_BUG_ON_VMA(pvmw.address == -EFAULT, vma); return page_vma_mkclean_one(&pvmw); @@ -2592,8 +2592,8 @@ static void rmap_walk_anon(struct folio *folio, anon_vma_interval_tree_foreach(avc, &anon_vma->rb_root, pgoff_start, pgoff_end) { struct vm_area_struct *vma = avc->vma; - unsigned long address = vma_pgoff_address(pgoff_start, - folio_nr_pages(folio), vma); + unsigned long address = vma_address(vma, pgoff_start, + folio_nr_pages(folio)); VM_BUG_ON_VMA(address == -EFAULT, vma); cond_resched(); @@ -2654,8 +2654,8 @@ static void rmap_walk_file(struct folio *folio, lookup: vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff_start, pgoff_end) { - unsigned long address = vma_pgoff_address(pgoff_start, - folio_nr_pages(folio), vma); + unsigned long address = vma_address(vma, pgoff_start, + folio_nr_pages(folio)); VM_BUG_ON_VMA(address == -EFAULT, vma); cond_resched();