From patchwork Thu Sep 2 21:56:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12473075 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 898B2C433F5 for ; Thu, 2 Sep 2021 21:56:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 39FBE60E8B for ; Thu, 2 Sep 2021 21:56:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 39FBE60E8B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D0C1F6B011B; Thu, 2 Sep 2021 17:56:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBA426B011C; Thu, 2 Sep 2021 17:56:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD05F6B011D; Thu, 2 Sep 2021 17:56:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id AAC936B011B for ; Thu, 2 Sep 2021 17:56:35 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 774BF82E4EB4 for ; Thu, 2 Sep 2021 21:56:35 +0000 (UTC) X-FDA: 78543993150.23.2363D25 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf24.hostedemail.com (Postfix) with ESMTP id 31417B000099 for ; Thu, 2 Sep 2021 21:56:35 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id D917F60F21; Thu, 2 Sep 2021 21:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1630619794; bh=jU+8M5TJ9tde0qEm5zXzQdBL4OxfEqPn+SW6Idccwq4=; h=Date:From:To:Subject:In-Reply-To:From; b=z0CHXc2ndoqDpNrOPXBp7fuB0rrzMFEO3rg/yrcXbr32wHihE9wUQBlEq3JLusH0c zpOuPR/j1/3uTj5h1dgetMv1iW7uZgJFvgLlGGi+nlXRhfJqE8TS5fWHr8X8Rj6Bxt T/ZeD69qmktF5WR7eVi7pMb8GjBV+KsaVrOMzQ1E= Date: Thu, 02 Sep 2021 14:56:33 -0700 From: Andrew Morton To: akpm@linux-foundation.org, alexs@kernel.org, dalias@libc.org, deanbo422@gmail.com, deller@gmx.de, geoff@infradead.org, green.hu@gmail.com, guoren@kernel.org, hch@lst.de, James.Bottomley@HansenPartnership.com, linux-mm@kvack.org, linux@armlinux.org.uk, mm-commits@vger.kernel.org, nickhu@andestech.com, paul@crapouillou.net, torvalds@linux-foundation.org, tsbogend@alpha.franken.de, ulf.hansson@linaro.org, ysato@users.osdn.me Subject: [patch 123/212] scatterlist: replace flush_kernel_dcache_page with flush_dcache_page Message-ID: <20210902215633.89fP6QAW8%akpm@linux-foundation.org> In-Reply-To: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=z0CHXc2n; spf=pass (imf24.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 31417B000099 X-Stat-Signature: mb736d3pje178tzk1o4n3xkhgkpcxmkn X-HE-Tag: 1630619795-836966 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: From: Christoph Hellwig Subject: scatterlist: replace flush_kernel_dcache_page with flush_dcache_page 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. Link: https://lkml.kernel.org/r/20210712060928.4161649-5-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Linus Torvalds Cc: Alex Shi Cc: Geoff Levand Cc: Greentime Hu Cc: Guo Ren Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Nick Hu Cc: Paul Cercueil Cc: Rich Felker Cc: Russell King Cc: Thomas Bogendoerfer Cc: Ulf Hansson Cc: Vincent Chen Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- lib/scatterlist.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/lib/scatterlist.c~scatterlist-replace-flush_kernel_dcache_page-with-flush_dcache_page +++ a/lib/scatterlist.c @@ -887,9 +887,8 @@ void sg_miter_stop(struct sg_mapping_ite 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());