Re: [PATCH v2] zram: Prevent page allocation failure during zcomp_strm_alloc

Sergey Senozhatsky
2015-11-21T09:39:07Z

On (11/21/15 11:15), Sergey Senozhatsky wrote:
[..]
>
> with the only nit that the subject should be "try kmalloc() before vmalloc()"
> or similar, not "prevent page allocation failure", I think.
>

Oh, and one more thing

> static void zcomp_lz4_destroy(void *private)
> {
> - kfree(private);
> + if (is_vmalloc_addr(private))
> + vfree(private);
> + else
> + kfree(private);
> }

static void zcomp_FOO_destroy(void *private)
{
kvfree(private);
}

-ss