From patchwork Mon Dec 16 15:53:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13909929 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 6607FE77180 for ; Mon, 16 Dec 2024 15:54:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E78928D0002; Mon, 16 Dec 2024 10:54:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E28E68D0001; Mon, 16 Dec 2024 10:54:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF8F28D0002; Mon, 16 Dec 2024 10:54:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AEA1A8D0001 for ; Mon, 16 Dec 2024 10:54:14 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5B076120E1E for ; Mon, 16 Dec 2024 15:54:14 +0000 (UTC) X-FDA: 82901267946.26.5F3E97A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id F1B651C0011 for ; Mon, 16 Dec 2024 15:53:41 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QRspj2HJ; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734364433; 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:references:dkim-signature; bh=rBBpd22PJzLLmPajy8p7zWHGVvG5LBG4Sj90qfpefx0=; b=cLZb/18JUcntSVTBCvGJP4K0wLY9fIB1a7WHaVk+pT+IRqO38aNvB26dITGq7NZuu/bUcD w1vdJtpYCIcS5pQjM7xGIyUtLmF4SrFelukhs2g5aoIDHF1vxNGxC52uq/GyC/yc3OMW+b JdSMk0YxiJ3d7W+BOxdLrV0/WMg4Yb8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734364433; a=rsa-sha256; cv=none; b=GoddJK+fNbWsW88auxdFH4f+PPOyDu4UT8aTrXFfqxyI6agtkOP8hvtpLWHwPHe2Jka0Tv cw9pZhhBKdlhxrZ3/3f+yK6bM6VGogBj0YxLxEoC8WNHL8gl4qliwLkjmJoQg5o7N61KAh ByTcWmOEOPxvt9xVtJ0RVwfv6oRGfV8= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QRspj2HJ; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=rBBpd22PJzLLmPajy8p7zWHGVvG5LBG4Sj90qfpefx0=; b=QRspj2HJzQ59iy5Ci553SMSMuO OpXDIMj4ZSvlXoCYN03XnzN6ZFvokxsuE07B78w44YAdCG4uoQP7ne4uYQVtvJ6Fp0G+KH/MHLMSO r+WK18nJ4hPxUe34Xd3V0v2r60xi/SVkxxmoUec7Uztzmh2gZYsmXANof2/YTzIJz/kl4ispSox8d UVyk6ltKQrRQXBtak8bbmXoZsR22pyG3z4Nz6zMVkenVyxprmo2LWknrCbK155VRWNMKKDY5Lxtx1 Zmxy20RDozu4q2jQnlHlFmK0nu7jdbAndAmNFX1PjXK8nOd87wrH56Z0/hGw1c15b+4RY6yzPV2ye PLjdJjqQ==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tNDQA-000000002B3-0vvD; Mon, 16 Dec 2024 15:54:10 +0000 From: "Matthew Wilcox (Oracle)" To: Dan Williams Cc: "Matthew Wilcox (Oracle)" , Vishal Verma , Dave Jiang , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/2] dax: Remove access to page->index Date: Mon, 16 Dec 2024 15:53:55 +0000 Message-ID: <20241216155408.8102-1-willy@infradead.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: F1B651C0011 X-Stat-Signature: 6zrwudp4kz97u4p3n7jeusbp3c5jgyii X-Rspam-User: X-HE-Tag: 1734364421-855191 X-HE-Meta: U2FsdGVkX19Wfn+eeveYMl/U7zQFWgJk7xSwKxOAcqCmH3K7i1fmXSMYyaFsU/hQg6bFzLW2sMdAs0sruwQb8w/Gk/mwY+x+RPY/aA9AHOOFc2rjfdp5KJ+bbzU7yPD6O4bDscrHfvKP9hC0zUw4v99ntaE2ceE2DnRaqQgVhcPapXRf3j7fvc0QeDMOsVcC0c1W+WFtzmStDP8cyPyQR6d0hcOUDcMFvpG4y0a1OD84RvqJirwkao8s3wuiNbiRqJNi1ZCs1X/T4Hq+IJjxEopoxac9etJtkGbcJpHxcVOlIT8IdZ4hjLxmFQl+y8UR6SfU/uBjJO7XzDNH1JDnETS/EIU31rpBC6cwNu92/pkXM0W9Dn7/YhPc2N1ZY/iQ/Lbe+BWp7Q0wKSULC3JafUlFeHcuhi5hUIIuiNIEOp3VW05gMVRoITr8CmIdFuy3FqH6FILYj3Vo3biEOKgXiRR2BsxL2c25v+xtFKMajv5Rsrt0vu+ADeqhg0aLwdwfeM+DmVDBkyQ+s50bxHY0zNLPXaB9E8eIUMNpbaDnQxOblcEBnffB4619JmHCRgPctZKN8lTXdt+31p14uVGSHE//nLS27fihjIR5G5bNzamVa/pasiRNrKl2+WlfUXGm5wXG9uyrpFAhWWTYBdxVOsEmsd8Mh4Pq12y7jbXGB5HG1IK5x21HPo/gPeiQLpP724w6JmnbGYoYgk1GrkX6CftrKs0UZYg8wXgHUqR1XI6OeJMJm/WO2UUKIi75zbl0Wr37Hcl6Ddxd58Fz+wwQIMrrk9Fy2lJ6he6YsR0opt+jdy65lsafnP9RWa19zBlXtQiBoTtL38TvFoQsZq6IcmeidtDlAZuXNBtRpUZ5depqncromBoSSikgCNeRlx0k33DMlJ3KLeuVek+eQTvyGEvNy1H4tiZsoeKN4BTvoPzZKTjTjM9EeEkbN3Nnq64/VnR1ryQjk7UlFHcT+72 TvW4yEvS 96jANIjwd3IhKSf3YlRoozk6O589elidLpAUQ1j4/lkcezOjlV1EU9vMh8c3o9PxoYQ2sNF2etPsq6heE7va5h2cUOB1YjfGjyS4xFizxsTODyi0a19uX32hpdUuvv+x1SQOX/MK+FcKvcvxaket5v7Kqove4TxHSElHRVkAQXnNO0Paa4dQvV+BZ6cwEZfAGNHbMu5TYKo/7ggshR2qMYI02o+3FtAyHYogzbZsOqd4PoUhpg+R6ac/K+8QMuNAWBIXammd20ccz5ltcENOc8gBIyg== 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: This looks like a complete mess (why are we setting page->index at page fault time?), but I no longer care about DAX, and there's no reason to let DAX hold us back from removing page->index. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jane Chu --- drivers/dax/device.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/dax/device.c b/drivers/dax/device.c index 6d74e62bbee0..bc871a34b9cd 100644 --- a/drivers/dax/device.c +++ b/drivers/dax/device.c @@ -89,14 +89,13 @@ static void dax_set_mapping(struct vm_fault *vmf, pfn_t pfn, ALIGN_DOWN(vmf->address, fault_size)); for (i = 0; i < nr_pages; i++) { - struct page *page = pfn_to_page(pfn_t_to_pfn(pfn) + i); + struct folio *folio = pfn_folio(pfn_t_to_pfn(pfn) + i); - page = compound_head(page); - if (page->mapping) + if (folio->mapping) continue; - page->mapping = filp->f_mapping; - page->index = pgoff + i; + folio->mapping = filp->f_mapping; + folio->index = pgoff + i; } }