[PATCH 08/16] nvme-auth: don't keep long lived 4k dhchap buffer
Sagi Grimberg
sagi at grimberg.me
Wed Nov 9 10:05:15 PST 2022
>> dhchap structure is per-queue, it is wasteful to keep it for the entire
>> lifetime of the queue. Allocate it dynamically and get rid of it after
>> authentication. We don't need kzalloc because all accessors are clearing
>> it before writing to it.
>
> Btw, do we need a mempool here to make sure we always get one for
> a reconnect under memory pressure?
We probably need it. Will add as an incremental patch.
>> + /*
>> + * Allocate a large enough buffer for the entire negotiation:
>> + * 4k should be enough to ffdhe8192.
>> + */
>> + chap->buf_size = 4096;
>
> Same comments as for Hannes previous series: no need for ->buf_size,
> this can be a global constant.
>
> And in the comment the should is weird, it is enough.
Folding it in.
More information about the Linux-nvme
mailing list