[PATCH 14/17] blk-mq: move the srcu_struct used for quiescing to the tagset
Chao Leng
lengchao at huawei.com
Wed Oct 26 19:49:45 PDT 2022
On 2022/10/26 21:01, Sagi Grimberg wrote:
>
>
> On 10/26/22 11:48, Chao Leng wrote:
>>> +
>>> + if (set->flags & BLK_MQ_F_BLOCKING) {
>>> + set->srcu = kmalloc(sizeof(*set->srcu), GFP_KERNEL);
>> Memory with contiguous physical addresses is not necessary, maybe it is a better choice to use kvmalloc,
>> because sizeof(*set->srcu) is a little large.
>> kvmalloc() is more friendly to scenarios where memory is insufficient and running for a long time.
>
> Huh?
>
> (gdb) p sizeof(struct srcu_struct)
> $1 = 392
I double recheck it. What I remember in my head is the old version of the size.
The size of the latest version is the size that you show.
Change the srcu_node array to a pointer in April 2022.
The link:
https://github.com/torvalds/linux/commit/2ec303113d978931ef368886c4c6bc854493e8bf
Therefore, kvmalloc() is a better choice for older versions.
For the latest version, static data member or kmalloc() are OK.
More information about the Linux-nvme
mailing list