From patchwork Wed Jan 3 08:41:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13509727 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 6D3D8C3DA6E for ; Wed, 3 Jan 2024 08:42:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04CCC8D0040; Wed, 3 Jan 2024 03:42:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F3EBA8D0035; Wed, 3 Jan 2024 03:42:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E07308D0040; Wed, 3 Jan 2024 03:42:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CF5BD8D0035 for ; Wed, 3 Jan 2024 03:42:30 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A7910C029D for ; Wed, 3 Jan 2024 08:42:30 +0000 (UTC) X-FDA: 81637358460.16.3549E73 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf11.hostedemail.com (Postfix) with ESMTP id 0F29140027 for ; Wed, 3 Jan 2024 08:42:28 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=gRAjktk4; spf=none (imf11.hostedemail.com: domain of BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+f852f126c6d693376302+7437+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=1704271349; 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=ik7cnTIZhbznlyWw4+r3mPkuN44dpkXMWni2Aw4AUI0=; b=6bEG1YrSNBfhBN9abnL/BgAR0XFnKvqQHzbliRsZ/PiTuUqo3BjYfAKTSn/HdTpzfsZeOT CZl4/yFKYQg05kANLvrusGZFkopMA27w0g6xG9JtrInleoKAGw+6hiUGMvaiKJS3HcdCuG VMMjReD1rtdQ3yERLDOqJlj6RCIA+qI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704271349; a=rsa-sha256; cv=none; b=zyJZeCQmsypvky2XJhok+5cxT9bxbgI3nfMhRwGIStp4M6dXJhENwgeDH0CKlcbmdgDYc/ Z1kGye/KvGrqqg89I2/iPA7vr7gc22+6t8PlSbdzgbLBlkcTFgwFRlgiEDy/yMpEL605Lm PwJO5GGrIJY3JCI6/IhWxSYXJwMUP/0= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=gRAjktk4; spf=none (imf11.hostedemail.com: domain of BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none 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=ik7cnTIZhbznlyWw4+r3mPkuN44dpkXMWni2Aw4AUI0=; b=gRAjktk4Su/8TshZNq2nC3vkT6 vMTgAMvHufHHwQsPb9PqatFRNAynJv19dDAEEFtS6L91vABcKdHXCvu7gPOgR4THSK6nNcLSLUFqi APq90y1U9oa7HazrKFy1RytPoRFNktNsgu2FPVux4Yos/evZbQciJqA81sHQhAeThcv5wXw6s/vs1 JRFlZobiatRk4kxHQWwXoY0bvTByfBFljw9C87awvr6xGl6RzL4/Mza5LK+fXjTsl93p1Vx5fS+Vb 5IkCtyVKbnYLVuEPBeomtD4W5cFN5xs2WKWOx2aG+qe3QekojXcshwZwjnLCf7CmdmM360+QolgJU 819dZ7xw==; Received: from [89.144.222.185] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rKwpT-00A6mu-2b; Wed, 03 Jan 2024 08:42:24 +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 10/15] xfs: remove xfarray_sortinfo.page_kaddr Date: Wed, 3 Jan 2024 08:41:21 +0000 Message-Id: <20240103084126.513354-11-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103084126.513354-1-hch@lst.de> References: <20240103084126.513354-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: 0F29140027 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: bkqcot7kdizd5rjg1s85zpjwfo5w5i7r X-HE-Tag: 1704271348-365913 X-HE-Meta: U2FsdGVkX1+hPtd4ChqFkXwYJjI/FcfMMKhJf8+HGBGE8OOa+NcbI/2SggfT/R7ahIRT2DcRH816ASh19G7GMXVU+KdfllU20wXKinQzuaYOJE+OOuE4tGVZNg8OBzNqYnaJOIBxrZT2a3k+BJaji0pU6/7+NTfavOsxmGB+bq3guybbewWlF4+77A5zwjsLcuDpXSI1E5/NEuG2kKDgqDYAVJER+gpXFMcX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mxieykmF9bH7dG0aaGEA7VT5z9zOvoAlJKTm3k8jyU1oCqsyPuJrhY6+gLn3TnXVV0yb7dLADFQal+dTfLIvNTWi7k66mNUgBmEBGyHQZDEyycjuCaxgZ7+GNw== 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 3a44700037924b..c29a240d4e25f4 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. */