[PATCH] zram: use copy_page for full page copy

Mark-PK Tsai posted 1 patch 11 months, 2 weeks ago
There is a newer version of this series
drivers/block/zram/zram_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] zram: use copy_page for full page copy
Posted by Mark-PK Tsai 11 months, 2 weeks ago
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@mediatek.com>
---
 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
Re: [PATCH] zram: use copy_page for full page copy
Posted by Sergey Senozhatsky 7 months, 2 weeks ago
Cc-ing Andrew on this

On (23/10/07 15:05), Mark-PK Tsai wrote:
> 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@mediatek.com>

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

> ---
>  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
Re: [PATCH] zram: use copy_page for full page copy
Posted by Sergey Senozhatsky 11 months, 2 weeks ago
On (23/10/07 15:05), Mark-PK Tsai wrote:
> 
> 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@mediatek.com>

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Re: [PATCH] zram: use copy_page for full page copy
Posted by Mark-PK Tsai (蔡沛剛) 7 months, 2 weeks ago
On Sun, 2023-10-08 at 13:38 +0900, Sergey Senozhatsky wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On (23/10/07 15:05), Mark-PK Tsai wrote:
> > 
> > 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@mediatek.com>
> 
> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

I guess this patch may have been overlooked.
Could someone please help to review it?

Thanks,
Mark
Re: [PATCH] zram: use copy_page for full page copy
Posted by Sergey Senozhatsky 7 months, 2 weeks ago
On (24/02/05 06:43), Mark-PK Tsai (蔡沛剛) wrote:
> On Sun, 2023-10-08 at 13:38 +0900, Sergey Senozhatsky wrote:
> >  	 
> > External email : Please do not click links or open attachments until
> > you have verified the sender or the content.
> >  On (23/10/07 15:05), Mark-PK Tsai wrote:
> > > 
> > > 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@mediatek.com>
> > 
> > Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
> 
> I guess this patch may have been overlooked.
> Could someone please help to review it?

Oh, yes. Let me take care of that.