Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2703421pxv; Sun, 11 Jul 2021 23:13:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXZ0O9a1RQ/f22Q/XRiuP8IUQIJue9tV5fmqOHJKh/xd50EDoMD+HIHnFV2yr5I1dCbT2p X-Received: by 2002:a05:6e02:13e6:: with SMTP id w6mr753725ilj.298.1626070433287; Sun, 11 Jul 2021 23:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626070433; cv=none; d=google.com; s=arc-20160816; b=CJz3PaRaO8KV2ZSWj+jeUo7IGzTVLsHJSIRSrMmRp7GjG0GhWRznl6WaGP4VuCSJsQ ytrjlPtfDpZ0wFAmTyVbswE+bFINTQuQMkqz3dOytrZT+zX28Q8OnMEXaAVDuT66yDD7 X+m5WDaFP0CUOmLs26gSAcNxM4dVA/c+/DhaFtrckjQd9zYFXGn85OHcsFqeIXYwfUzi nMQAjgqU0xSQOVqV/elhEMRzVb7yeIiAsgiH1neJYKMrm7NMPbIltiFF4IPdfrTHyHoP r0xVUb9MgAUW26iXoCXVq8DnbJKxp8//n/pIJkAcYtvcq1GPqwUk74wDtpPPKhsJM/+c BU2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qx+S4X/AntMqvxHU8howep6p8wMPAKrF08wI0C/NDGI=; b=FPkqZVk8jdLm9ND45uFm5UUaZARv0qNcEFgvjRn6w1jMEK/yS2WEY9zNK7WzF66s6X 0HJlTQpXF+HzXrpy+tzg4273py/YR321i+NNhAOVnb+T3sF3WEfsgUlzryqbJ7ew7C4O ZPzIUkhAHg3+KFCbI9M670sQF2SVvHq0cXIV0y6qF8GtUf3EvjQ7eTSs4swE+eT6m2sU scoLvHSOnkOkGMlIPuXuYQlWn/L3G5wGmKBP27+SWgeO6gd88NG9Z8b2Qyr5C2+iHAtx hK20F2SwphUFFat39KbHbXkYDEoiBHaYbvo99FeATV+F47AS+euYZbYDfnWvPSujvHKG CZKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=HW0ivQUN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z24si6260616jap.49.2021.07.11.23.13.41; Sun, 11 Jul 2021 23:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=HW0ivQUN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232627AbhGLGPZ (ORCPT + 99 others); Mon, 12 Jul 2021 02:15:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230207AbhGLGPY (ORCPT ); Mon, 12 Jul 2021 02:15:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A712CC0613DD; Sun, 11 Jul 2021 23:12:36 -0700 (PDT) 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: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=qx+S4X/AntMqvxHU8howep6p8wMPAKrF08wI0C/NDGI=; b=HW0ivQUNaIYb5D9jXaAJzvrLZZ NniOiQZpWmJnb1cTY9auqT9pv2DlwoLkLGJ+KeyvsCTm9An/7PIvNmXlKerWnhERlxy776PZAbEK5 w+s3UFIo7PBlv0QHfGAW7tcievs3wv7RgURmLb7ugyYGYQNGDA/Ee9+qWygbCEh9qtXob4Q6q49Sx 8Fs0AbLAHKg5mW3XTuQD7t+AshiUpgoY/8GYI0/12YPWENxwvsCl13CCTg420Ahuq+TxZKyOMbHaO GCzOJe9rzXLJP6nlryt99yK+VjCX8rmjhs/Mi1LuOtuutrWVqEpojFaINEGSgdhC5fOkGQmHPJeqa ovmkx9nA==; Received: from [2001:4bb8:184:8b7c:bd9:61b8:39ba:d78a] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2p9R-00GwGj-QZ; Mon, 12 Jul 2021 06:10:54 +0000 From: Christoph Hellwig To: Linus Torvalds , Andrew Morton , "James E.J. Bottomley" Cc: Russell King , Guo Ren , Thomas Bogendoerfer , Nick Hu , Greentime Hu , Vincent Chen , Helge Deller , Yoshinori Sato , Rich Felker , Geoff Levand , Paul Cercueil , Ulf Hansson , Alex Shi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org Subject: [PATCH 4/6] scatterlist: replace flush_kernel_dcache_page with flush_dcache_page Date: Mon, 12 Jul 2021 08:09:26 +0200 Message-Id: <20210712060928.4161649-5-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712060928.4161649-1-hch@lst.de> References: <20210712060928.4161649-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pages used in scatterlist can be mapped page cache pages (and often are), so we must use flush_dcache_page here instead of the more limited flush_kernel_dcache_page that is intended for highmem pages only. Also remove the PageSlab check given that page_mapping_file as used by the flush_dcache_page implementations already contains that check. Signed-off-by: Christoph Hellwig --- lib/scatterlist.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 27efa6178153..627aa84f8bbd 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -887,9 +887,8 @@ void sg_miter_stop(struct sg_mapping_iter *miter) miter->__offset += miter->consumed; miter->__remaining -= miter->consumed; - if ((miter->__flags & SG_MITER_TO_SG) && - !PageSlab(miter->page)) - flush_kernel_dcache_page(miter->page); + if (miter->__flags & SG_MITER_TO_SG) + flush_dcache_page(miter->page); if (miter->__flags & SG_MITER_ATOMIC) { WARN_ON_ONCE(preemptible()); -- 2.30.2