public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Leon Romanovsky <leon@kernel.org>
Cc: Junxian Huang <huangjunxian6@hisilicon.com>,
	linux-rdma@vger.kernel.org, linuxarm@huawei.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 for-next 1/2] RDMA/core: Provide rdma_user_mmap_disassociate() to disassociate mmap pages
Date: Wed, 4 Sep 2024 13:04:58 -0300	[thread overview]
Message-ID: <20240904160458.GB1909087@ziepe.ca> (raw)
In-Reply-To: <20240903070922.GI4026@unreal>

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

  reply	other threads:[~2024-09-04 16:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  6:46 [PATCH v3 for-next 0/2] RDMA: Provide an API for drivers to disassociate mmap pages Junxian Huang
2024-08-28  6:46 ` [PATCH v3 for-next 1/2] RDMA/core: Provide rdma_user_mmap_disassociate() " Junxian Huang
2024-09-02  6:57   ` Leon Romanovsky
2024-09-02 13:32     ` Junxian Huang
2024-09-03  7:09       ` Leon Romanovsky
2024-09-04 16:04         ` Jason Gunthorpe [this message]
2024-08-28  6:46 ` [PATCH v3 for-next 2/2] RDMA/hns: Disassociate mmap pages for all uctx when HW is being reset Junxian Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240904160458.GB1909087@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=huangjunxian6@hisilicon.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox