lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0b9376b8-6132-4b48-a5bd-75eacd121561@gmail.com>
Date: Mon, 23 Jun 2025 11:45:54 +0800
From: Wang Jinchao <wangjinchao600@...il.com>
To: Yu Kuai <yukuai1@...weicloud.com>
Cc: linux-raid@...r.kernel.org, Song Liu <song@...nel.org>,
 linux-kernel@...r.kernel.org, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH] md/raid1: change r1conf->r1bio_pool to a pointer type

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ