[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240415163156.GQ223006@ziepe.ca>
Date: Mon, 15 Apr 2024 13:31:56 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Uros Bizjak <ubizjak@...il.com>
Cc: iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
David Woodhouse <dwmw2@...radead.org>,
Lu Baolu <baolu.lu@...ux.intel.com>, Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH] iommu/intel: Use try_cmpxchg64{,_local}() in iommu.c
On Sun, Apr 14, 2024 at 06:23:11PM +0200, Uros Bizjak wrote:
> Replace this pattern in iommu.c:
>
> cmpxchg64{,_local}(*ptr, 0, new) != 0
>
> ... with the simpler and faster:
>
> !try_cmpxchg64{,_local}(*ptr, &tmp, new)
>
> The x86 CMPXCHG instruction returns success in the ZF flag, so this change
> saves a compare after the CMPXCHG.
>
> No functional change intended.
>
> Signed-off-by: Uros Bizjak <ubizjak@...il.com>
> Cc: David Woodhouse <dwmw2@...radead.org>
> Cc: Lu Baolu <baolu.lu@...ux.intel.com>
> Cc: Joerg Roedel <joro@...tes.org>
> Cc: Will Deacon <will@...nel.org>
> Cc: Robin Murphy <robin.murphy@....com>
> ---
> drivers/iommu/intel/iommu.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Jason
Powered by blists - more mailing lists