Thread (19 messages) 19 messages, 9 authors, 2021-08-04
STALE1789d

[PATCH 4/6] scatterlist: replace flush_kernel_dcache_page with flush_dcache_page

From: Christoph Hellwig <hch@lst.de>
Date: 2021-07-12 06:12:39
Also in: linux-arm-kernel, linux-doc, linux-mips, linux-mmc, linux-scsi, linux-sh, lkml
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

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 <hch@lst.de>
---
 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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help