[PATCH] nvmet: use try_cmpxchg in nvmet_update_sq_head

Chaitanya Kulkarni chaitanyak at nvidia.com
Mon Oct 24 17:47:05 PDT 2022


On 10/20/22 08:35, Uros Bizjak wrote:
> Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in
> nvmet_update_sq_head.  x86 CMPXCHG instruction returns success in ZF flag, so
> this change saves a compare after cmpxchg (and related move instruction in
> front of cmpxchg).
> 

Is it worth a share delts of assembly instructions of the changes above?
as developers on block mailing list are sharing the delta between before
and after patch including the assembly.

I also hope that you have tested this change with blktests nvme.

Either way:-

Reviewed-by: ChaItanya Kulkarni <kch at nvidia.com>

-ck



More information about the Linux-nvme mailing list