Skip to content

Commit

Permalink
zram: use copy_page for full page copy
Browse files Browse the repository at this point in the history
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.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Mark-PK Tsai <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]>
Cc: AngeloGioacchino Del Regno <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: YJ Chiang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: NotZeetaa <[email protected]>
Signed-off-by: Pajdek <[email protected]>
  • Loading branch information
PeikanTsai authored and ppajda committed Jun 4, 2024
1 parent dd817f9 commit e301bb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/zram/zram_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index,
zram_entry_handle(zram, entry), 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 {
Expand Down

0 comments on commit e301bb4

Please sign in to comment.