linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* flush_kernel_dcache_page fixes and removal
@ 2021-07-12  6:09 Christoph Hellwig
  2021-07-12  6:09 ` [PATCH 1/6] mmc: JZ4740: remove the flush_kernel_dcache_page call in jz4740_mmc_read_data Christoph Hellwig
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Christoph Hellwig @ 2021-07-12  6:09 UTC (permalink / raw)
  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, linux-arm-kernel, linux-csky, linux-mips,
	linux-parisc, linux-sh, linux-mmc, linux-scsi, linux-mm,
	linux-doc

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 turns
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(-)

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-08-04 11:13 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-12  6:09 flush_kernel_dcache_page fixes and removal Christoph Hellwig
2021-07-12  6:09 ` [PATCH 1/6] mmc: JZ4740: remove the flush_kernel_dcache_page call in jz4740_mmc_read_data Christoph Hellwig
2021-07-19  8:15   ` Paul Cercueil
2021-08-04 11:12   ` Ulf Hansson
2021-07-12  6:09 ` [PATCH 2/6] mmc: mmc_spi: replace flush_kernel_dcache_page with flush_dcache_page Christoph Hellwig
2021-08-04 11:12   ` Ulf Hansson
2021-07-12  6:09 ` [PATCH 3/6] ps3disk: " Christoph Hellwig
2021-07-19  3:07   ` Geoff Levand
2021-07-12  6:09 ` [PATCH 4/6] scatterlist: " Christoph Hellwig
2021-07-12  6:09 ` [PATCH 5/6] aacraid: remove an unused include Christoph Hellwig
2021-07-19  1:50   ` Martin K. Petersen
2021-07-12  6:09 ` [PATCH 6/6] mm: remove flush_kernel_dcache_page Christoph Hellwig
2021-07-12 23:56   ` Ira Weiny
2021-07-12 19:24 ` flush_kernel_dcache_page fixes and removal Linus Torvalds
2021-07-13  5:46   ` Christoph Hellwig
2021-07-13  8:46 ` Russell King (Oracle)
2021-07-13  9:11   ` Christoph Hellwig
2021-07-19  5:38   ` Herbert Xu
2021-07-19 15:42     ` Russell King (Oracle)
2021-07-14  3:13 ` Guo Ren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).