[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <35358897-5009-4843-8234-136bd5756e0b@gmail.com>
Date: Mon, 23 Jun 2025 11:18:03 +0800
From: Wang Jinchao <wangjinchao600@...il.com>
To: Yu Kuai <yukuai3@...wei.com>
Cc: linux-raid@...r.kernel.org, Song Liu <song@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] md/raid1: change r1conf->r1bio_pool to a pointer type
On 6/18/25 19:41, Wang Jinchao wrote:
>> In raid1_reshape(), newpool is a stack variable.
>> mempool_init() initializes newpool->wait with the stack address.
>> After assigning newpool to conf->r1bio_pool, the wait queue
>> need to be reinitialized, which is not ideal.
>>
>> Change raid1_conf->r1bio_pool to a pointer type and
>> replace mempool_init() with mempool_create() to
>> avoid referencing a stack-based wait queue.
>>
>Can you also switch to kmalloc pool in this patch?
>Thanks,
>Kuai
Hi Kuai,
Comparing mempool_create_kmalloc_pool() and mempool_create(), the former
requires the pool element size as a parameter, while the latter uses
r1bio_pool_alloc() to allocate new elements, with the size calculated
based on poolinfo->raid_disks.
The key point is poolinfo, which is used for both r1bio_pool and r1buf_pool.
If we change from mempool_create() to mempool_create_kmalloc_pool(), we
would need to introduce a new concept, such as r1bio_pool_size, and
store it somewhere. In this case, the original conf->poolinfo would lose
its meaning and become just r1buf_poolinfo.
So I think keeping poolinfo is a better fit for the pool in RAID1.
By the way, I did not receive your email in my Gmail inbox; I found your
message on lore.org. The last email I received from you was on June 16,
so I am not sure what the problem is.
I also sent you an email mentioning that not using poolinfo makes
rollback in raid1_reshape more difficult.
I wonder whether you received it, or maybe I missed your reply.
I am looking forward to your discussion. I want to gain a deeper
understanding and contribute more to md/raid.
Thanks.
Powered by blists - more mailing lists