Commit afb2d666 authored by Mark-PK Tsai's avatar Mark-PK Tsai Committed by Andrew Morton

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/20231006060245.7411-1-mark-pk.tsai@mediatek.comSigned-off-by: default avatarMark-PK Tsai <mark-pk.tsai@mediatek.com>
Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: YJ Chiang <yj.chiang@mediatek.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent bafd7e9d
...@@ -1839,7 +1839,7 @@ static int zs_page_migrate(struct page *newpage, struct page *page, ...@@ -1839,7 +1839,7 @@ static int zs_page_migrate(struct page *newpage, struct page *page,
* Here, any user cannot access all objects in the zspage so let's move. * Here, any user cannot access all objects in the zspage so let's move.
*/ */
d_addr = kmap_atomic(newpage); d_addr = kmap_atomic(newpage);
memcpy(d_addr, s_addr, PAGE_SIZE); copy_page(d_addr, s_addr);
kunmap_atomic(d_addr); kunmap_atomic(d_addr);
for (addr = s_addr + offset; addr < s_addr + PAGE_SIZE; for (addr = s_addr + offset; addr < s_addr + PAGE_SIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment