[PATCH] nvmet: parametrize maximum number of ANA groups

Chaitanya Kulkarni chaitanyak at nvidia.com
Tue Feb 22 01:53:28 PST 2022


On 2/22/22 12:55 AM, Aleksandr Dyadyushkin wrote:
> From: Aleksandr Dyadyushkin <alextalker at yandex.ru>
> 
> Allow the end user (i.e. the administrator) to set maximum number of ANA
> groups (and thus ANAGRPMAX and NANAGRPID implicitly) via module
> loading-time parameter, without a need to modify and rebuild source
> code.
> 
> Most of all, this can be helpful for fancy namespace assignment schemes
> (since maximum number of namespaces allowed by default is 1024 which is
> 8 times more than 128 for ANA groups) or mock-up configurations.
> 
> For backwards compatibility, default values are left as is.
> 
> While permitted values are choosen as high as possible for the current

s/choosen/chosen/g

> code architecture, it is worth noting that allocation of
> 'nvmet_ana_group_enabled' might yield a failure during loading on
> systems with high parameter value and low free memory.
> 
> In regard to performance, it might be argued that replacing constant
> macros value with a parameter could affect compile-time optimizations of
> the loops but such an issue would only affect
> 'nvmet_execute_get_log_page_ana' and 'nvmet_ports_make' functions at the
> moment.
> 
> Signed-off-by: Aleksandr Dyadyushkin <alextalker at ya.ru>

Please no module param for this, right place is configfs subsys attr.

Also, if you are doing this please make sure to write a block test for
these two configfs params, since it definitely adds a code that user
input might missuse with invalid numbers.

-ck



More information about the Linux-nvme mailing list