[PATCH] zram: use copy_page for full page copy

From: Mark-PK Tsai
Date: Sat Oct 07 2023 - 03:06:12 EST


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@xxxxxxxxxxxx>
---
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