[RFC PATCHv3 2/6] nvme-multipath: add support for adaptive I/O policy

Nilay Shroff nilay at linux.ibm.com
Mon Oct 27 05:09:53 PDT 2025



On 10/27/25 5:04 PM, Hannes Reinecke wrote:
>> +static bool nvme_mpath_set_current_adaptive_path(struct nvme_ns *ns)
>> +{
>> +    struct nvme_ns_head *head = ns->head;
>> +
>> +    if (!head->disk || head->subsys->iopolicy != NVME_IOPOLICY_ADAPTIVE)
>> +        return false;
>> +
>> +    if (test_and_set_bit(NVME_NS_PATH_STAT, &ns->flags))
>> +        return false;
>> +
>> +    blk_queue_flag_set(QUEUE_FLAG_SAME_FORCE, ns->queue);
>> +    blk_stat_enable_accounting(ns->queue);
>> +    return true;
>> +}
>> +
>> +static bool nvme_mpath_clear_current_adaptive_path(struct nvme_ns *ns)
>> +{
>> +
>> +    if (!test_and_clear_bit(NVME_NS_PATH_STAT, &ns->flags))
>> +        return false;
>> +
>> +    blk_stat_disable_accounting(ns->queue);
>> +    blk_queue_flag_clear(QUEUE_FLAG_SAME_FORCE, ns->queue);
>> +    nvme_mpath_reset_current_stat(ns);
>> +    return true;
>> +}
>> +
> 
> Hmm. I think this is a misnomer, as for the adaptive path policy we
> don't really have a 'current_path', and as such we don't clear
> the 'current_path' setting. Rather we disable the policy altogether
> here.
> Can we reflect that in the function name and name it eg
> nvme_mpath_enable_adaptive_path_policy()
> or somesuch?

Yeah you are right, I'll update function name as suggested.

Thanks,
--Nilay



More information about the Linux-nvme mailing list