All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Amrani, Ram" <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
To: Matan Barak <matanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
	Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Liran Liss <liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>,
	Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Tal Alon <talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"Elior,
	Ariel" <Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
	"Kalderon,
	Michal" <Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Subject: RE: [PATCH RFC 02/10] IB/core: Add support to finalize objects in one transaction
Date: Sun, 7 May 2017 12:02:31 +0000	[thread overview]
Message-ID: <BN3PR07MB2578868B660CC388664BE501F8E90@BN3PR07MB2578.namprd07.prod.outlook.com> (raw)
In-Reply-To: <CAAKD3BBfZa_eM2L+LE30uDnoEge6rCBj17YtkVZULUsKMQrQww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

> >> The new ioctl based infrastructure either commits or rollbacks
> >> all objects of the command as one transaction. In order to do
> >> that, we introduce a notion of dealing with a collection of
> >> objects that are related to a specific action.
> >>
> >> This also requires adding a notion of an action and attribute.
> >> An action contains a groups of attributes, where each group
> >> contains several attributes.
> >>
> >> When declaring these actions and attributes, we actually declare
> >> their specifications. When a command is executed, we actually
> >> allocates some space to hold auxiliary information.
> >>
> >> Signed-off-by: Matan Barak <matanb@mellanox.com>
> >> ---
> >
> > Matan, thanks for the RFC!
> >
> > If I got this correctly each object will go through three phases - get, handler, and a put.
> > I don't quite understand how a batch operation, like destroy QPs, can be undone after the handler phase.
> > I do see it working if at first multiple gets are performed and one of them fails.
> > In that case undoing is easy because the handlers weren't invoked yet.
> >
> > In the case were some user-objects failed the operation how is this reflected upwards?
> >
> > Also, I wonder, is there another intention behind batch operations except speed?
> >
> 
> It's really not recommended to batch create/destroy. The reason is
> exactly what you've pointer out.
> If you batch several "destroy objects" and the n'th one fail, you
> can't unwind the successful ones.
> 
> So basically, we want to support a semantic which is similar to what
> we have today - create a single object or destroy a single object.
> In this case, the pre-handler stage locks the dependencies of this
> object (for example, in create_qp you lock the pd and cq so they won't
> be destroyed)
> and create the uobject for the QP. The handler itself can assume the
> requirements it stated in the specifications are filled and just
> create the QP and
> tie the uobject to the QP object. In the post-handler stage we commit
> the QP's uobject and unlock the dependencies (assuming the handler
> increased
> the required refcounts).
> Destroying an object is similar. The only different is that the
> destruction itself isn't done by the handler, but in the
> post-handler's code (to share this code between
> regular "destroy" calls with process tear-down and hardware removal).
 
I understand there are two sets of objects here. Let's make sure I'm not confusing them.

(1) A collection of user-objects passed via ioctl. This is indicated in the first paragraph.
But as you indicated now we shouldn't support this. So why (apparently) do we?

(2) A collection of user-objects that should be locked for the creation/deletion/modification
of another that was requested via ioctl.
In this case the handler doesn't need to be invoked at all for the collection.
We can easily roll back the "get" phase, if failed during.
We don't expect the "put" phase to fail, if it will fail for some reason. Then this won't really
be handled as the handler was already invoked.

Thanks,
Ram



  parent reply	other threads:[~2017-05-07 12:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 15:20 [PATCH RFC 00/10] IB/core: SG IOCTL based RDMA ABI Matan Barak
     [not found] ` <1492615225-55118-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-04-19 15:20   ` [PATCH RFC 01/10] IB/core: Add a generic way to execute an operation on a uobject Matan Barak
     [not found]     ` <1492615225-55118-2-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-05-04 10:23       ` Leon Romanovsky
     [not found]         ` <20170504102303.GR22833-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-05-04 10:37           ` Matan Barak
     [not found]             ` <CAAKD3BALCSD=N90gFa+R64QAyuiuJLFmZzsvRz1roq5x-0s3Jw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-04 12:28               ` Leon Romanovsky
     [not found]                 ` <20170504122851.GS22833-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-05-04 15:43                   ` Matan Barak
     [not found]                     ` <CAAKD3BCz8+aT7hKzoxL__0iU_rzW_zv6FWHMhmgD7tnbwv3big-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-04 18:17                       ` Leon Romanovsky
2017-04-19 15:20   ` [PATCH RFC 02/10] IB/core: Add support to finalize objects in one transaction Matan Barak
     [not found]     ` <1492615225-55118-3-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-05-04 14:50       ` Amrani, Ram
     [not found]         ` <SN1PR07MB22077A1B43881BAF7BAC5ED0F8EA0-mikhvbZlbf8TSoR2DauN2+FPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-05-07 11:00           ` Matan Barak
     [not found]             ` <CAAKD3BBfZa_eM2L+LE30uDnoEge6rCBj17YtkVZULUsKMQrQww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-07 12:02               ` Amrani, Ram [this message]
     [not found]                 ` <BN3PR07MB2578868B660CC388664BE501F8E90-EldUQEzkDQfpW3VS/XPqkOFPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-05-07 12:39                   ` Matan Barak
     [not found]                     ` <CAAKD3BAr0GX5rGCq_wcxQ=NKZwyHdrvnj_3G25mhq-c1qqFFRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-07 14:29                       ` Amrani, Ram
2017-04-19 15:20   ` [PATCH RFC 03/10] IB/core: Add new ioctl interface Matan Barak
     [not found]     ` <1492615225-55118-4-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-05-08  6:06       ` Leon Romanovsky
     [not found]         ` <20170508060624.GB10073-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-05-08  8:09           ` Matan Barak
2017-04-19 15:20   ` [PATCH RFC 04/10] IB/core: Declare a type instead of declaring only type attributes Matan Barak
2017-04-19 15:20   ` [PATCH RFC 05/10] IB/core: Add DEVICE type and root types structure Matan Barak
2017-04-19 15:20   ` [PATCH RFC 06/10] IB/core: Initialize uverbs types specification Matan Barak
2017-04-19 15:20   ` [PATCH RFC 07/10] IB/core: Add macros for declaring actions and attributes Matan Barak
2017-04-19 15:20   ` [PATCH RFC 08/10] IB/core: Add ability to explicitly destroy an uobject Matan Barak
2017-04-19 15:20   ` [PATCH RFC 09/10] IB/core: Add uverbs types, actions, handlers and attributes Matan Barak
2017-04-19 15:20   ` [PATCH RFC 10/10] IB/core: Expose ioctl interface through experimental Kconfig Matan Barak

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=BN3PR07MB2578868B660CC388664BE501F8E90@BN3PR07MB2578.namprd07.prod.outlook.com \
    --to=ram.amrani-ygcgfspz5w/qt0dzr+alfa@public.gmane.org \
    --cc=Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=matanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /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.