Skip to content

Commit afb2d66

Browse files
PeikanTsaiakpm00
authored andcommitted
zsmalloc: use copy_page for full page copy
Some architectures have implemented optimized copy_page for full page copying, such as arm. On my arm platform, use the copy_page helper for single page copying is about 10 percent faster than memcpy. 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: Matthias Brugger <[email protected]> Cc: Minchan Kim <[email protected]> Cc: YJ Chiang <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent bafd7e9 commit afb2d66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/zsmalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@ static int zs_page_migrate(struct page *newpage, struct page *page,
18391839
* Here, any user cannot access all objects in the zspage so let's move.
18401840
*/
18411841
d_addr = kmap_atomic(newpage);
1842-
memcpy(d_addr, s_addr, PAGE_SIZE);
1842+
copy_page(d_addr, s_addr);
18431843
kunmap_atomic(d_addr);
18441844

18451845
for (addr = s_addr + offset; addr < s_addr + PAGE_SIZE;

0 commit comments

Comments
 (0)