linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] zsmalloc: use copy_page for full page copy
@ 2023-10-06  6:02 Mark-PK Tsai
  2023-10-06 11:11 ` Sergey Senozhatsky
  0 siblings, 1 reply; 3+ messages in thread
From: Mark-PK Tsai @ 2023-10-06  6:02 UTC (permalink / raw)
  To: Minchan Kim, Sergey Senozhatsky, Andrew Morton, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: yj.chiang, Mark-PK Tsai, linux-mm, linux-kernel,
	linux-arm-kernel, linux-mediatek

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.

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

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index c743ce7a5f49..b1c0dad7f4cf 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -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.
 	 */
 	d_addr = kmap_atomic(newpage);
-	memcpy(d_addr, s_addr, PAGE_SIZE);
+	copy_page(d_addr, s_addr);
 	kunmap_atomic(d_addr);
 
 	for (addr = s_addr + offset; addr < s_addr + PAGE_SIZE;
-- 
2.18.0



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

end of thread, other threads:[~2023-10-07  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06  6:02 [PATCH] zsmalloc: use copy_page for full page copy Mark-PK Tsai
2023-10-06 11:11 ` Sergey Senozhatsky
2023-10-07  7:45   ` Mark-PK Tsai (蔡沛剛)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox