From patchwork Fri Jan 26 13:29:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13532581 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 2E444C47DDF for ; Fri, 26 Jan 2024 13:30:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D2C96B0089; Fri, 26 Jan 2024 08:30:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 734556B0095; Fri, 26 Jan 2024 08:30:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 622C86B0096; Fri, 26 Jan 2024 08:30:25 -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 523606B0089 for ; Fri, 26 Jan 2024 08:30:25 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 23F2780F89 for ; Fri, 26 Jan 2024 13:30:25 +0000 (UTC) X-FDA: 81721546410.17.80A9026 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf01.hostedemail.com (Postfix) with ESMTP id 5070540028 for ; Fri, 26 Jan 2024 13:30:23 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=sNyn4VLF; dmarc=none; spf=none (imf01.hostedemail.com: domain of BATV+8230b42af99c397292d7+7460+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+8230b42af99c397292d7+7460+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706275823; a=rsa-sha256; cv=none; b=FKHN2G3g3ipduvmuXmRs2rMVeCdh1uaUFRJ0T1TywS49AkrTV3aSdOc5qTl1LEEm9cR/RS H8urojs2jLc2s3Tjbb6GE6DahbvmsyXXmfAMDb3BZSbJgVQbKarBe+dpR4dLgq4mNaDuKz zrvAlSIUAbZjtqYQLMfaKq1ISU9UrnY= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=sNyn4VLF; dmarc=none; spf=none (imf01.hostedemail.com: domain of BATV+8230b42af99c397292d7+7460+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+8230b42af99c397292d7+7460+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706275823; 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=3S6ntfnJ/Mttd+t3+rSdcxM6Jo8r6DNkjdxq43w+JDI=; b=ttua2B3ihRJuVM+5WlA53cpurniY7J8xPtHp9/n1qdKBoCnb29SLJJb2rz69iMhoEbjTIK nnKv7+ubU3r5WrR4En7encr//+ikxgVjkWEwrD3TloQb1KdXE8KhnktD5I5TbkjbU8qQiM mc88YSODBcDOQ1RygeSCevyneUdFrsM= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=3S6ntfnJ/Mttd+t3+rSdcxM6Jo8r6DNkjdxq43w+JDI=; b=sNyn4VLFKK7KKN6xXdNVh+Gfrs YBZlvjHMYwgFA+xKWQrZF1xEy98zlVXD3oWPI4rdiDn9jHVZVBojX4ktb8ro0huk+/Rtbvq+3aHEL o3EGv5vggwpFIXq8rztl0TM014nJRnm8iHWkaejOlbiCKE+5Ph0d+SwuGkIfUQmxAqMiulNZzZJcn EZCy8mEVpGPIJ2DWHMcl7+3xIyLOq3Ujt5AAIFOL1ypE70AZQ7RtPkXdwJ8/il5RKfyYfW+59dNJn qIsySAjobSf/eQAHXDf0Jttu575b5KGI33DUnN7B6fjakfL/PLC0nqI1LgytJWT2es+JJQHy2oQld kWF9qCAQ==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTMHk-00000004Cwj-3jOh; Fri, 26 Jan 2024 13:30:21 +0000 From: Christoph Hellwig To: Chandan Babu R , "Darrick J. Wong" , Hugh Dickins , Andrew Morton Cc: linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 18/21] xfs: remove xfarray_sortinfo.page_kaddr Date: Fri, 26 Jan 2024 14:29:00 +0100 Message-Id: <20240126132903.2700077-19-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240126132903.2700077-1-hch@lst.de> References: <20240126132903.2700077-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5070540028 X-Stat-Signature: i3zz39xf6c11nxzqujq8necst7kbijd7 X-HE-Tag: 1706275823-558412 X-HE-Meta: U2FsdGVkX19qk0SgH+c+eSMMCrKNtFUDV8v465q2bMYa/pZH/N3aK30C1qVSNN6hBLBelpK66/rYAKpOCEE9wC/TbTe0ogZBD2R+8kU3TkHe2uTfD7HWTGsDM7FWhE+FOfV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/spquLHNkMKo5Gjc8s5mvStfY25WZZLEGI13qz4/ve2fDp8kltRDWnkt1LKTAveLABpVs1sr1AFW6cO2CMMVZ98jdqZNpoeDKvjxs3gRZprGeiRaCGd/b5TdND1tZAmcvPmxFRdjQFxv0jwgofK5Vro04qOowDIeXBvXGKCugkqW8hETgaaQ/LserchVyuiMtYIb3KKiIlSisrYKG5Wefe8aWAJ47tOZCEshgzFHxu5mwnXYIV0pjqp6ydPGNfvCVkM2D+bkgfZNLkX6xJmZosx/0eJryyoudxHOkQVT/dwMKqh2+FZPMg= 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: Now that xfile pages don't need kmapping, there is no need to cache the kernel virtual address for them. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/scrub/xfarray.c | 22 ++++------------------ fs/xfs/scrub/xfarray.h | 1 - 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/fs/xfs/scrub/xfarray.c b/fs/xfs/scrub/xfarray.c index d0f98a43b2ba0a..82b2a35a8e8630 100644 --- a/fs/xfs/scrub/xfarray.c +++ b/fs/xfs/scrub/xfarray.c @@ -570,18 +570,7 @@ xfarray_sort_get_page( loff_t pos, uint64_t len) { - int error; - - error = xfile_get_page(si->array->xfile, pos, len, &si->xfpage); - if (error) - return error; - - /* - * xfile pages must never be mapped into userspace, so we skip the - * dcache flush when mapping the page. - */ - si->page_kaddr = page_address(si->xfpage.page); - return 0; + return xfile_get_page(si->array->xfile, pos, len, &si->xfpage); } /* Release a page we grabbed for sorting records. */ @@ -589,11 +578,8 @@ static inline int xfarray_sort_put_page( struct xfarray_sortinfo *si) { - if (!si->page_kaddr) + if (!xfile_page_cached(&si->xfpage)) return 0; - - si->page_kaddr = NULL; - return xfile_put_page(si->array->xfile, &si->xfpage); } @@ -636,7 +622,7 @@ xfarray_pagesort( return error; xfarray_sort_bump_heapsorts(si); - startp = si->page_kaddr + offset_in_page(lo_pos); + startp = page_address(si->xfpage.page) + offset_in_page(lo_pos); sort(startp, hi - lo + 1, si->array->obj_size, si->cmp_fn, NULL); xfarray_sort_bump_stores(si); @@ -883,7 +869,7 @@ xfarray_sort_load_cached( return error; } - memcpy(ptr, si->page_kaddr + offset_in_page(idx_pos), + memcpy(ptr, page_address(si->xfpage.page) + offset_in_page(idx_pos), si->array->obj_size); return 0; } diff --git a/fs/xfs/scrub/xfarray.h b/fs/xfs/scrub/xfarray.h index 62b9c506fdd1b7..6f2862054e194d 100644 --- a/fs/xfs/scrub/xfarray.h +++ b/fs/xfs/scrub/xfarray.h @@ -107,7 +107,6 @@ struct xfarray_sortinfo { /* Cache a page here for faster access. */ struct xfile_page xfpage; - void *page_kaddr; #ifdef DEBUG /* Performance statistics. */