From patchwork Mon Jul 12 06:09:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12370309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33C0AC07E9B for ; Mon, 12 Jul 2021 06:12:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0300E6101E for ; Mon, 12 Jul 2021 06:12:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0300E6101E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Chjp4oOneogMwO7cBd8TtQUHLLgmnrTfi2+dAGLsRpQ=; b=ZE29Cynu/s9xDb lC8HvqeylE4A3JtotI6wA7bKM4mpEIRNoICnd36+5fqG5KwSGPtRUDEi/l5MJG7Rf1ZiRUdNHgqBt /5hrE0NAoxLiPg/Jr73pc60Jgx9nB4m7nKii9Zg7EGPERifBw+nKPL3ObHY3wqj761JDCVk1FAeds tQt+MTkXhEBYpNM4KUAIvBJiL5WJsKbG/x+EH5VoZHb47JpR+5gYBtHZUQggcBdVzwXZLzEEJc0YL KmHvrsCPVwOqtkyE7yUd7k3wR3b5u35XkXa7W0JDXYSp7wA88noVkr40Lc8k83F6HtsyNeU39CpQt 3mSLKFsTqM/yM72TCLmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2p9t-005yLO-Pi; Mon, 12 Jul 2021 06:11:14 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2p9r-005yKm-Hb for linux-arm-kernel@bombadil.infradead.org; Mon, 12 Jul 2021 06:11:11 +0000 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 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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());