[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240904160458.GB1909087@ziepe.ca>
Date: Wed, 4 Sep 2024 13:04:58 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Leon Romanovsky <leon@...nel.org>
Cc: Junxian Huang <huangjunxian6@...ilicon.com>, linux-rdma@...r.kernel.org,
linuxarm@...wei.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 for-next 1/2] RDMA/core: Provide
rdma_user_mmap_disassociate() to disassociate mmap pages
On Tue, Sep 03, 2024 at 10:09:22AM +0300, Leon Romanovsky wrote:
> > The original thought was that ib_uverbs_mmap() reads ufile->disassociated while
> > uverbs_user_mmap_disassociate() writes it, and there might be a racing. We tried
> > to use atomic_t to avoid racing without adding locks.
>
> atomic_t is never a replacement for locks. It is a way to provide
> coherent view of the data between CPUs and makes sure that write/read is
> not interrupted.
Yes, add a lock, like I said
Jason
Powered by blists - more mailing lists