From: Wang Jinchao <wangjinchao600@gmail.com>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: linux-raid@vger.kernel.org, Song Liu <song@kernel.org>,
linux-kernel@vger.kernel.org, "yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH] md/raid1: change r1conf->r1bio_pool to a pointer type
Date: Mon, 23 Jun 2025 11:45:54 +0800 [thread overview]
Message-ID: <0b9376b8-6132-4b48-a5bd-75eacd121561@gmail.com> (raw)
In-Reply-To: <dd532c80-2597-deff-4a3e-3d8ce88cbc19@huaweicloud.com>
On 6/23/25 11:26, Yu Kuai wrote:
> Hi,
>
> 在 2025/06/23 11:18, Wang Jinchao 写道:
>> 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.
>>
>
> I said multiple times it's a fixed size and won't change, you don't need
> to store it. Not sure if you get this. :(
>
> conf->r1bio_pool = mempool_create_kmalloc_pool(NR_RAID_BIOS,
> offsetof(struct r1bio, bios[mddev->raid_disks *2]);
>
> Thanks,
> Kuai
>
This time I got it.
I used to think it was a pointer, but now I realize it’s actually a
pointer cast from a fixed value.
I can change it to use mempool_create_kmalloc_pool now.
I will also reconsider your three previous suggestions.
Thanks for your patience.
---
Jinchao
prev parent reply other threads:[~2025-06-23 3:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 11:41 Wang Jinchao
2025-06-19 0:56 ` Su Yue
2025-06-19 2:01 ` Wang Jinchao
2025-06-19 5:54 ` Su Yue
2025-06-19 9:02 ` Yu Kuai
2025-06-23 3:18 ` Wang Jinchao
2025-06-23 3:26 ` Yu Kuai
2025-06-23 3:45 ` Wang Jinchao [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0b9376b8-6132-4b48-a5bd-75eacd121561@gmail.com \
--to=wangjinchao600@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®