Re: [PATCH v4] zram: Implement multi-page write-back
From: Sergey Senozhatsky
Date: Wed Nov 12 2025 - 21:11:22 EST
On (25/11/06 09:49), Yuwen Chen wrote:
[..]
> +static int zram_writeback_slots(struct zram *zram, struct zram_pp_ctl *ctl)
> +{
[..]
> + struct zram_wb_request req_prealloc[2] = {0};
[..]
> + /* allocate memory for req_pool */
> + req_pool = kzalloc(sizeof(*req) * ZRAM_WB_REQ_CNT, GFP_KERNEL);
> + if (req_pool) {
> + req_pool_cnt = ZRAM_WB_REQ_CNT;
> + } else {
> + req_pool = req_prealloc;
> + req_pool_cnt = ARRAY_SIZE(req_prealloc);
> + }
This looks like a preliminary optimization, I'd probably prefer
to not have req_prealloc entirely.