[PATCH V2 2/2] nvme-loop: use xarray for loop port tracking

Christoph Hellwig hch at lst.de
Mon Oct 5 08:48:35 EDT 2020


> +	unsigned long idx;
>  
> -	mutex_lock(&nvme_loop_ports_mutex);
> -	list_for_each_entry(p, &nvme_loop_ports, entry) {
> +	rcu_read_lock();
> +	xa_for_each(&nvme_loop_ports, idx, p) {

Why is the rcu_read_lock()?  We'd need a synchronize_rcu on the port
disable side.  But the manual mutex_locking seems more sensible here
anyway.

> +	xa_init(&nvme_loop_ports);

I don't think this is needed.



More information about the Linux-nvme mailing list