linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] zram: use copy_page for full page copy
@ 2023-10-07  7:05 Mark-PK Tsai
  2023-10-08  4:38 ` Sergey Senozhatsky
  2024-02-05  6:50 ` Sergey Senozhatsky
  0 siblings, 2 replies; 5+ messages in thread
From: Mark-PK Tsai @ 2023-10-07  7:05 UTC (permalink / raw)
  To: Minchan Kim, Sergey Senozhatsky, Jens Axboe, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: yj.chiang, Mark-PK Tsai, linux-kernel, linux-block,
	linux-arm-kernel, linux-mediatek

Some architectures, such as arm, have implemented
optimized copy_page for full page copying.

Replace the full page memcpy with copy_page to
take advantage of the optimization.

Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
---
 drivers/block/zram/zram_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index d77d3664ca08..58700dd73d1d 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1338,7 +1338,7 @@ static int zram_read_from_zspool(struct zram *zram, struct page *page,
 	src = zs_map_object(zram->mem_pool, handle, ZS_MM_RO);
 	if (size == PAGE_SIZE) {
 		dst = kmap_atomic(page);
-		memcpy(dst, src, PAGE_SIZE);
+		copy_page(dst, src);
 		kunmap_atomic(dst);
 		ret = 0;
 	} else {
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-02-05  6:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-07  7:05 [PATCH] zram: use copy_page for full page copy Mark-PK Tsai
2023-10-08  4:38 ` Sergey Senozhatsky
2024-02-05  6:43   ` Mark-PK Tsai (蔡沛剛)
2024-02-05  6:48     ` Sergey Senozhatsky
2024-02-05  6:50 ` Sergey Senozhatsky

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).