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

From: Sergey Senozhatsky
Date: Sat Nov 21 2015 - 04:39:12 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/