All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: liweihang <liweihang@huawei.com>
Cc: "jgg@ziepe.ca" <jgg@ziepe.ca>,
	"dledford@redhat.com" <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Linuxarm <linuxarm@huawei.com>
Subject: Re: Questions about masked atomic
Date: Sun, 17 May 2020 16:14:09 +0300	[thread overview]
Message-ID: <20200517131409.GA60005@unreal> (raw)
In-Reply-To: <B82435381E3B2943AA4D2826ADEF0B3A02363499@DGGEML522-MBX.china.huawei.com>

On Fri, May 15, 2020 at 09:40:26AM +0000, liweihang wrote:
> On 2020/5/12 19:35, Leon Romanovsky wrote:
> > On Mon, May 11, 2020 at 01:54:48PM +0000, liweihang wrote:
> >> Hi All,
> >>
> >> I have two questions about masked atomic (Masked Compare and Swap & MFetchAdd):
> >>
> >> 1. The kernel now supports masked atomic, but the it does not support atomic
> >>    operation. Is the masked atomic valid in kernel currently?
> >
> > Yes, it is valid, but probably has a very little real value for the kernel ULPs.
> > I see code in the RDS that uses atomics, but it says nothing to me, because
> > upstream RDS and version in-real-use are completely different.
> >
> >> 2. In the userspace, ofed does not have the corresponding opcode for the masked
> >>    atomic (IB_WR_MASKED_ATOMIC_CMP_AND_SWP, IB_WR_MASKED_ATOMIC_FETCH_AND_ADD),
> >>    and ibv_send_wr also has no related data segment for it. How to support it in
> >>    userspace?
> >
> > ibv_send_wr is not extensible, so the real solution will need to extend ibv_wr_post() [1]
> > with specific and new post builders.
> >
> > Thanks
> >
> > [1] https://github.com/linux-rdma/rdma-core/blob/master/libibverbs/man/ibv_wr_post.3.md
> >
>
> Hi Leon,
>
> Thanks for your response. May I ask another question:
>
> Why it's not encouraged to use atomic/extended atomic/masked atomic operations in kernel?
> Jason said that there seems no kernel users of extended atomic, is there any other reasons?

I don't think that "it is not encouraged", the more accurate will be
"the IBTA atomics will give nothing to the kernel ULPs".

The atomic data is not necessary stored in the host memory, while ULPs
need it in the memory. It means that they anyway will need to do some
synchronization in the host and "cancel" any advantage of atomics if
they exist.

Thanks

>
> Weihang

  reply	other threads:[~2020-05-17 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 13:54 Questions about masked atomic liweihang
2020-05-12 11:35 ` Leon Romanovsky
2020-05-15  9:40   ` liweihang
2020-05-17 13:14     ` Leon Romanovsky [this message]
2020-05-17 18:58       ` Tom Talpey
2020-05-19  1:27         ` liweihang

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=20200517131409.GA60005@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liweihang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.