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

Sergey Senozhatsky
2024-07-30T09:38:41Z

On (24/07/29 19:25), alexs@kernel.org 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.