From patchwork Mon Jan 29 14:34:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13535775 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 271E4C47DB3 for ; Mon, 29 Jan 2024 14:36:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC2FC6B00B6; Mon, 29 Jan 2024 09:36:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A251F6B00B7; Mon, 29 Jan 2024 09:36:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89F136B00B8; Mon, 29 Jan 2024 09:36:10 -0500 (EST) 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 6F6636B00B6 for ; Mon, 29 Jan 2024 09:36:10 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 534B51C1385 for ; Mon, 29 Jan 2024 14:36:10 +0000 (UTC) X-FDA: 81732598500.29.3CE87F3 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP id B841E18000B for ; Mon, 29 Jan 2024 14:36:08 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=idRwDPMa; spf=none (imf16.hostedemail.com: domain of BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706538968; 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=Wm7xa7r96NKU+d31cp71y/dKgMjfuX7LN3YMyGLJ91O8R8c8iLkWrkiEa9FViEQcks0ywk +s7Bk/FaVyCihcod8xqh5DluNeLIf0zpJuzQKv36/Djn+Ec2lj/8eqsfFitjhy46D5jiPE 801ZdX1fNngBtKcJWkoJJsY5zDoNt2w= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=idRwDPMa; spf=none (imf16.hostedemail.com: domain of BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706538968; a=rsa-sha256; cv=none; b=SreU8+oM4XbQnWWt++Pk7bbcal3fBfBCkANOAdrMb6Y24t/U4OyH4177XFGv0bzkBeI34u UUwiRv28Iu4B8NCzbTXHaK9Grt8OoI0P4XLoEaa5rp3dVWlZINvpEx3ybkgVuLwrv50lXN P8bOwHN63ci46U4iZXCYmc1Xtvxh668= 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=idRwDPMa/1mhc9knuQ1IMinnMU FQ3aK7oA+CoznHpL0Jce9W0VvBSgvpkoQjTRd9YgVzH8tznUPJPk5UJ+d3hs+TpZHUJ1Vi8MHRyAf xC5qTXDOeLWREkbhCSTf9TUNrFiS0Tepw3S0hyRiVKjJSCTktzcgC3rkCMQppM/HCwWgBmmj0fSq0 zxlHGNyDrXaDJoohXROVEUNgqsTvTAPKrSw42OmG6ufUK3I6BrWYHnxrOG6/BMvhfEfag/r3m6TtZ V97ZjDXOeh8GSqGXZPbrzELNV0MtxRB/wWaedYOU8DZN+tfhcI6cNR/68N9PmGBeFf3lewxk8m10i P80WKlQw==; Received: from [2001:4bb8:182:6550:c70:4a89:bc61:3] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUSk2-0000000D6S6-0A7O; Mon, 29 Jan 2024 14:36:06 +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 17/20] xfs: remove xfarray_sortinfo.page_kaddr Date: Mon, 29 Jan 2024 15:34:59 +0100 Message-Id: <20240129143502.189370-18-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240129143502.189370-1-hch@lst.de> References: <20240129143502.189370-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-Rspamd-Queue-Id: B841E18000B X-Rspam-User: X-Stat-Signature: g4smwtncmh4uhnmhuhabbr3i5x3xmfys X-Rspamd-Server: rspam01 X-HE-Tag: 1706538968-980041 X-HE-Meta: U2FsdGVkX19cYiF/D5nGSLRpFYMXkvsSy/uasCRERABWAuisg05rktoazZCsRPuUe4PFqdkhtz8UW0Gmn1JT0tnzgTOgOlEDIx8zWjhgFIBXA+7TTWGHSZCp6Re7D68nHNA8l3X7rSt4BYamsvU29ge9TD6I9+rJ0rT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84FadiAvr+AIhsT0fB5h6XEcPBygBHEWovWiNSSB4Sor1rUrInQ4Pmu36yZEdLcEjQ6QiKq3ePOvxR8n8QYM8maXv1FNUA2yV1sjFdfaZ2a7xWF/gAw7jWMFrRKjXGGO90YhZpXazrmQxu9RqZcmdFS32l9sSAJAIcwUkcSxB9WoJLhUKYmjsn1bKXxMV9IE9BukVBQJsOSm6QeTqX9OW9nBlSTlFdCQLxvuIGaZ+909xt3suUC3EYp4+yDNq5QFK32By2u6d0QrI+nLJg3UWnuA= 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. */