From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 C0801C11F6A for ; Wed, 14 Jul 2021 03:13:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94054613B6 for ; Wed, 14 Jul 2021 03:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237636AbhGNDQP (ORCPT ); Tue, 13 Jul 2021 23:16:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:60238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237368AbhGNDQO (ORCPT ); Tue, 13 Jul 2021 23:16:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 86777613B2; Wed, 14 Jul 2021 03:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626232403; bh=eHqXqU0BSC/4FXMxbMmPUP5y/NWhQgyVoBJ51q6I6VI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RneN6lR7Gk+SyuzkEGUgXr7XT7IriiK0Ld1//j6zYRb/qjM02yKdHFlCHwgq90qaq OPjucaISjtpHs8RTbetzrdLw0tATbov36tOsLzqUKF7hgRqLXL5M0yHnn/NxKihWk6 XATsATEQtu6TsePkHQkvwWzzh8U31KxpN30+TtitWfM10iGQUE9q/fcjs7X+unaStk ZHtv2y0Nl7o/khL5FkiHbf6WW2QL+zHAkOE6vysdoTfYAllTgQtdsaRVGM7lQfpLRT dmpkufnoyEh3lCAwyau7PA+Fd+WvV0VZCuzN3IWCM8tiQ264dk4mqkI34mlyVof+4q TRVyTjlfWJ2GQ== Received: by mail-lf1-f51.google.com with SMTP id f30so1030255lfj.1; Tue, 13 Jul 2021 20:13:23 -0700 (PDT) X-Gm-Message-State: AOAM530pSEqh7KJjPhG2VJJFCX81jVTCkMwj+xPGFp/iTIsvS6iWV+XB 7P8QBLGWQxm+IlIYtxD0RijxGQ8AC2XoBmB5Wcg= X-Google-Smtp-Source: ABdhPJxjtzRmeK8gT6oxvZVQIbBescQdPKCDPRyAmUuPGRj8zSZMbMltcH961OP7xUnOjUvePsuZ4INz3sZLDriTjNw= X-Received: by 2002:ac2:42d6:: with SMTP id n22mr6034055lfl.41.1626232401837; Tue, 13 Jul 2021 20:13:21 -0700 (PDT) MIME-Version: 1.0 References: <20210712060928.4161649-1-hch@lst.de> In-Reply-To: <20210712060928.4161649-1-hch@lst.de> From: Guo Ren Date: Wed, 14 Jul 2021 11:13:10 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: flush_kernel_dcache_page fixes and removal To: Christoph Hellwig Cc: Linus Torvalds , Andrew Morton , "James E.J. Bottomley" , Russell King , Thomas Bogendoerfer , Nick Hu , Greentime Hu , Vincent Chen , Helge Deller , Yoshinori Sato , Rich Felker , Geoff Levand , Paul Cercueil , Ulf Hansson , Alex Shi , Linux Kernel Mailing List , Linux ARM , 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 , linux-doc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Acked-by for csky abiv1 part.=EF=BC=88No change to our execution path after the patch set.=EF=BC=89 On Mon, Jul 12, 2021 at 2:10 PM Christoph Hellwig wrote: > > Hi all, > > while looking to convert the block layer away from kmap_atomic towards > kmap_local_page and prefeably the helpers that abstract it away I noticed > that a few block drivers directly or implicitly call > flush_kernel_dcache_page before kunmapping a page that has been written > to. flush_kernel_dcache_page is documented to to be used in such cases, > but flush_dcache_page is actually required when the page could be in > the page cache and mapped to userspace, which is pretty much always the > case when kmapping an arbitrary page. Unfortunately the documentation > doesn't exactly make that clear, which lead to this misused. And it turn= s > out that only the copy_strings / copy_string_kernel in the exec code > were actually correct users of flush_kernel_dcache_page, which is why > I think we should just remove it and eat the very minor overhead in > exec rather than confusing poor driver writers. > > Diffstat: > Documentation/core-api/cachetlb.rst | 86 +++++++---= ------- > Documentation/translations/zh_CN/core-api/cachetlb.rst | 9 - > arch/arm/include/asm/cacheflush.h | 4 > arch/arm/mm/flush.c | 33 ------ > arch/arm/mm/nommu.c | 6 - > arch/csky/abiv1/cacheflush.c | 11 -- > arch/csky/abiv1/inc/abi/cacheflush.h | 4 > arch/mips/include/asm/cacheflush.h | 8 - > arch/nds32/include/asm/cacheflush.h | 3 > arch/nds32/mm/cacheflush.c | 9 - > arch/parisc/include/asm/cacheflush.h | 8 - > arch/parisc/kernel/cache.c | 3 > arch/sh/include/asm/cacheflush.h | 8 - > block/blk-map.c | 2 > drivers/block/ps3disk.c | 2 > drivers/mmc/host/jz4740_mmc.c | 4 > drivers/mmc/host/mmc_spi.c | 2 > drivers/scsi/aacraid/aachba.c | 1 > fs/exec.c | 6 - > include/linux/highmem.h | 5 > lib/scatterlist.c | 5 > tools/testing/scatterlist/linux/mm.h | 1 > 22 files changed, 55 insertions(+), 165 deletions(-) --=20 Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/