Re: [PATCH v4 03/22] mm/zsmalloc: convert __zs_map_object/__zs_unmap_object to use zpdesc

From: Sergey Senozhatsky
Date: Tue Jul 30 2024 - 05:38:48 EST


On (24/07/29 19:25), alexs@xxxxxxxxxx wrote:
> +static inline void *zpdesc_kmap_atomic(struct zpdesc *zpdesc)
> +{
> + return kmap_atomic(zpdesc_page(zpdesc));
> +}
> +
[..]
> /* copy object to per-cpu buffer */
> - addr = kmap_atomic(pages[0]);
> + addr = zpdesc_kmap_atomic(zpdescs[0]);
> memcpy(buf, addr + off, sizes[0]);
> kunmap_atomic(addr);
> - addr = kmap_atomic(pages[1]);
> + addr = zpdesc_kmap_atomic(zpdescs[1]);
> memcpy(buf + sizes[0], addr, sizes[1]);
> kunmap_atomic(addr);

Don't know if kmap_atomic() wrapper buys us anything, but okay.