From patchwork Fri Jun 30 12:13:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13298111 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 3329DEB64D7 for ; Fri, 30 Jun 2023 12:13:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 931E08D0001; Fri, 30 Jun 2023 08:13:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8928A8E000F; Fri, 30 Jun 2023 08:13:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6964A8D0012; Fri, 30 Jun 2023 08:13:32 -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 50E9F8D0001 for ; Fri, 30 Jun 2023 08:13:32 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1696EAFB5E for ; Fri, 30 Jun 2023 12:13:32 +0000 (UTC) X-FDA: 80959304664.06.C4C0CA9 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf06.hostedemail.com (Postfix) with ESMTP id AC3E3180003 for ; Fri, 30 Jun 2023 12:13:29 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688127210; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MBZ7vvpVYusarV6ekdjHXkir2egpRNeipnLA+F+ZSxI=; b=UkeKBURr+Dzze97My2qBjv0xC8CwOtg5k5y3OPhtoaDZHUFrz0WVfWyVfPpifXK53AcwvV ngUzO2cr5G/28WKn+sF+o2UkJpLTN3uDUzJLaYDWQUdy8J139+geoH6bQqNSU5kabAEYlg iM5a9ljfeAmE28WZvM1tHWZWuP6nLCw= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688127210; a=rsa-sha256; cv=none; b=OznPpJYs2yMujLzGnDbm6V0vtvufdKiCVSbHzgIU7dtLTMpM8giUZxkVsSVJdeGqiarcvW +/aCYzc1aUEFJSDvSuBULtorsJynzOC19prN36IMOFuFiboWBLwsB7QK/pq4LvG8E3GKe1 v73+XRd6+owmnNGWzLx1pgbGsJmzdHc= Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QsvMZ5K4JzTldR; Fri, 30 Jun 2023 20:12:26 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 30 Jun 2023 20:13:21 +0800 From: Peng Zhang To: , CC: , , , , , ZhangPeng Subject: [PATCH 1/2] mm: remove page_rmapping() Date: Fri, 30 Jun 2023 20:13:09 +0800 Message-ID: <20230630121310.165700-2-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230630121310.165700-1-zhangpeng362@huawei.com> References: <20230630121310.165700-1-zhangpeng362@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: AC3E3180003 X-Stat-Signature: ot8fh8pj8qi8dmj1ppx483hxjpdfxnxs X-Rspam-User: X-HE-Tag: 1688127209-495281 X-HE-Meta: U2FsdGVkX18We7/lpGMZeRqslNXeS58TAIW85OzN7Ink/IqaCBithRHvrivrk3BM77Est0zD04cdyEoHS1Wd5vUNE4znDBB9c4VaM/9yWUjRXq1dehNaC3PUaAuK2Mgw4RJyfU404jTv6fcatrwBDZlAOeh83shM7MPKk0FRkUHd41U1AtiT6VpgAd/R1bE8fQoPCWpEeM8pzMNaQm5SQnif/mOu3gHRwTj3djwFyPmrKsqlcfRfaGYmv2Wfkk6ZJ6M6RlDwXFJbjeAwEimJ1hd6X4lFdJuGiNTgzlK19E3NBM1K6pueyg2MGSKYVfaWMP3tA/hqubqY8P5g1fkPIjqoDgDDnTuOYF6LWGf/z19HOV5HqrANT5Vu/rGoD4R252uwzvHAcf/99vFIkUL06Mo2X8m/UUKBN3mAdPPQ5oRpRLLJOU5BkhkUVpQsQYC4z7kV+inEq8s0Y0uuOussk22+zcWHocWfqGRW/52JYvQCUaZ9RLJEU59AOeyefziMjU/gN0HfUQlMgh56yglwJG7UrcnRa1tmsnSwG6FawOUQbh1uUcOWTMxqNLkm3bClKDxqfXalBW7yjab6whgzJi4gPjdcArf09xSq6JpnqTOVR9SXi5Vs0JhGPMbv88frOqzxK5P1CAk+NeM/8yb2FIxNBZxQdkWrWxmG/sRLwipV37G251j9owaKQ9wyLpr1zDuHMhw11qO9Uz21dPxSdxJzSIhNeYBGhh3p5K2Np2BTffQlsrvJAbQ5Tupj2WlTiCfhYsTovxrB6onDrfRj9fzO5KqAb0JkTzHcRMwBTZM52bd4r/kqajzA2iRgpIaeogUo/bVqA4aCZLHTL0mheZ+YjfRNOn0ulrScLdU8QV9pXAvKqSKxr1Zo/ERZMp3q4qH1zNRtpiV48V6kpN/3Le6H7rVmH/h+BwQbwyIrQm9eLKA+wGpEyHUfslYEZ5SMRDbxTnL/yB8u3MRkYW+ 7TaX6FLa 3URQ0XvOxZlEzHYCcMVs5H/sQQNuqZU673YIoErJKK2JKoMWWZ/oWl3wNj80+07Rh8O7us+uKP9ivoTCU2qi7YakwZWe6AoJnBae/hyynrKXgKh0UlWqu7Nc6yEgJ30k6odWyXt/Q3Hmx28ENESo86+GCQkEi+a8f3kdPzuNj+gj5FNi9lNXSXpuCnuCvp94lV2NX 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: From: ZhangPeng After converting the last user to folio_raw_mapping(), we can safely remove the function. Signed-off-by: ZhangPeng Reviewed-by: Sidhartha Kumar --- include/linux/mm.h | 1 - mm/memory.c | 2 +- mm/util.c | 6 ------ 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 9ecb8b9c07f6..8c7eba7370b2 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2129,7 +2129,6 @@ static inline void *folio_address(const struct folio *folio) return page_address(&folio->page); } -extern void *page_rmapping(struct page *page); extern pgoff_t __page_file_index(struct page *page); /* diff --git a/mm/memory.c b/mm/memory.c index 21fab2727209..6921df44a99f 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2979,7 +2979,7 @@ static vm_fault_t fault_dirty_shared_page(struct vm_fault *vmf) * pinned by vma->vm_file's reference. We rely on unlock_page()'s * release semantics to prevent the compiler from undoing this copying. */ - mapping = page_rmapping(page); + mapping = folio_raw_mapping(page_folio(page)); unlock_page(page); if (!page_mkwrite) diff --git a/mm/util.c b/mm/util.c index dd12b9531ac4..5e9305189c3f 100644 --- a/mm/util.c +++ b/mm/util.c @@ -734,12 +734,6 @@ void *vcalloc(size_t n, size_t size) } EXPORT_SYMBOL(vcalloc); -/* Neutral page->mapping pointer to address_space or anon_vma or other */ -void *page_rmapping(struct page *page) -{ - return folio_raw_mapping(page_folio(page)); -} - struct anon_vma *folio_anon_vma(struct folio *folio) { unsigned long mapping = (unsigned long)folio->mapping;