From patchwork Mon Feb 19 06:27:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13562221 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 A71F1C5475B for ; Mon, 19 Feb 2024 06:28:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0044B6B006E; Mon, 19 Feb 2024 01:28:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EA7B26B0071; Mon, 19 Feb 2024 01:28:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CAB966B0072; Mon, 19 Feb 2024 01:28:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A5C886B006E for ; Mon, 19 Feb 2024 01:28:16 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7EA141C01AA for ; Mon, 19 Feb 2024 06:28:16 +0000 (UTC) X-FDA: 81807573792.27.FD9905B Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf15.hostedemail.com (Postfix) with ESMTP id D2E58A0009 for ; Mon, 19 Feb 2024 06:28:14 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=qukGHfrg; dmarc=none; spf=none (imf15.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708324094; a=rsa-sha256; cv=none; b=MS6frdRoEb9B/nK6cAA04EK7PlhgwbwV7UB/a25SVtEICxLqssqpKxnlilBqYOD58RMj/0 yqclp3Vodtwspnxy0iP7XUNXF475yx5NZxvoMYMNu9N7Ke6KhDzj0CrYtGtqiPZPgNYeV7 2A/G/Sg+2QQ+GGgz0ssuHr6UFyHgVrQ= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=qukGHfrg; dmarc=none; spf=none (imf15.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+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=1708324094; 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=ce+30fpE0YE5UXSyweiYt8QFphx7mErg8pqsio+OP/6RIRKfhi9aYZY5zX6iEEgEU1b/eL Z+C+DShQnlD+6rVSaoKjnOxB0AS71MD6OnMhbEjFW8/gm2lkn6VwZE+5mTcHPgYFh1sH62 kEMF12EQtCFF4a8tVUe9mT3jTMHL9Ic= 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=qukGHfrgvmCkUKibrGcqlD6fPi Hoc4k6zg8xjQIztJlzH7nifjE+PhY6CZR4I+DpVcoGDzS+MU8U5QcQj6CMS0Q8oA5whu1MdDUt/8+ bINQxzKyIrBN8nMvliOYGD5Gw1kVkJ3vSjKHltfFb5NGhI0KAR23qs0OsOYyZDNQu6uodlIY3I1Ab X2A3wGDVR3w/wD5MILvfjYyvO8vZfpAGIsrPCIrVY+DESAZVc8cKuBfFqSt5T5ptJ8OIPxNK/qL0H vGW6P9nFH5HOFl00nsvo0EvoreumP7zTp6aQt4mBOolmxhYcIUk5Y79KNdjhUiwWscUZbRBKh/aI1 3rBVbauQ==; 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 1rbx8N-00000009FNK-18XK; Mon, 19 Feb 2024 06:28:11 +0000 From: Christoph Hellwig To: Chandan Babu R , "Darrick J. Wong" , Hugh Dickins , Andrew Morton Cc: Hui Su , linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 19/22] xfs: remove xfarray_sortinfo.page_kaddr Date: Mon, 19 Feb 2024 07:27:27 +0100 Message-Id: <20240219062730.3031391-20-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219062730.3031391-1-hch@lst.de> References: <20240219062730.3031391-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: D2E58A0009 X-Stat-Signature: 3ahsis1sak9edj8no55jf1gh5n44dowy X-HE-Tag: 1708324094-423476 X-HE-Meta: U2FsdGVkX1/0tj1jXhASO9Dnm/kJJhtLFsoT0p9ECkN+W93MMt9ITBuI2vZXYqYWhdfNjS7nsFIT8knfPbsLwzkwBQGSYmfnXjheKVcBLuD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EwGaNb5l+qtYhDXQ2E19qWSDcfO+LU0+lraFf6oz9ixX5o8+Gssrc/wDI3R2k+BGn07ZPWLuAK+xQBN1fFrVh14DV8Q69quQjwFziXBveWj5KMQP0liFTesJSJLYD1RYh5QckEN0fpv7VE/Guze/JHmJyoYwodGcMpb2ngWJwbpHC53C+0ddC2exO4kk0ds+uRywSwv3RgqiD/tKxpYSD1O/o4/yT/P6RNSPZcydRf5tsjOyW1rbVtY4qvFoDrSiASHuzXZjZZqH+88DrPYQLFSfNyh3bRC0iatufY9gjUnUoulVXrlHU4+6rkS3A99ZkwCTKvgr2GyFYw= 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. */