All of lore.kernel.org
 help / color / mirror / Atom feed
From: Parav Pandit <parav@mellanox.com>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	Doug Ledford <dledford@redhat.com>,
	Leon Romanovsky <leonro@mellanox.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Daniel Jurgens <danielj@mellanox.com>
Subject: RE: [PATCH rdma-next 1/3] IB/core: Let IB core distribute cache update events
Date: Thu, 24 Oct 2019 19:58:15 +0000	[thread overview]
Message-ID: <AM0PR05MB4866E018CCCAE50CFBC79E6DD16A0@AM0PR05MB4866.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20191023174037.GY22766@mellanox.com>



> -----Original Message-----
> From: Jason Gunthorpe <jgg@mellanox.com>
> Sent: Wednesday, October 23, 2019 12:41 PM
> To: Parav Pandit <parav@mellanox.com>
> Cc: Leon Romanovsky <leon@kernel.org>; Doug Ledford
> <dledford@redhat.com>; Leon Romanovsky <leonro@mellanox.com>; RDMA
> mailing list <linux-rdma@vger.kernel.org>; Daniel Jurgens
> <danielj@mellanox.com>
> Subject: Re: [PATCH rdma-next 1/3] IB/core: Let IB core distribute cache update
> events
> 
> On Wed, Oct 23, 2019 at 05:08:56AM +0000, Parav Pandit wrote:
> > > >  	unsigned long flags;
> > > >  	struct ib_event_handler *handler; @@ -1971,6 +1963,22 @@ void
> > > > ib_dispatch_event(struct ib_event *event)
> > > >
> > > >  	spin_unlock_irqrestore(&event->device->event_handler_lock,
> > > > flags); }
> > > > +
> > > > +/**
> > > > + * ib_dispatch_event - Dispatch an asynchronous event
> > > > + * @event:Event to dispatch
> > > > + *
> > > > + * Low-level drivers must call ib_dispatch_event() to dispatch
> > > > +the
> > > > + * event to all registered event handlers when an asynchronous
> > > > +event
> > > > + * occurs.
> > > > + */
> > > > +void ib_dispatch_event(struct ib_event *event) {
> > > > +	if (ib_is_cache_update_event(event))
> > > > +		ib_enqueue_cache_update_event(event);
> > > > +	else
> > > > +		ib_dispatch_cache_event_clients(event);
> > > > +}
> > > >  EXPORT_SYMBOL(ib_dispatch_event);
> > >
> > > It seems like there is now some big mess here, many of the users of
> > > events, including cache, acctually do need a blocking context to do
> > > their work, while this function is supposed to be atomic context for the
> driver.
> > >
> > > So, after this change, many event types are now guarenteed to be
> > > called from a blocking context in a WQ - but we still go ahead and
> > > do silly things like launch more work to get into blocking contexts
> > > from the other users
> > >
> > > Thus I'm wondering if this wouldn't be better off just always
> > > pushing events into a wq and running the notifier subscriptions
> sequentially?
> > >
> > Are you saying we should drop the else part above and always do
> > ib_enqueue_cache_update_event()?
> 
> Yes, but also now saying that all notifier callbacks are called from work queues
> and can block for short periods.
> 
> This seems it would simplify many of the users??
> 
Yes, however that optimization should be a different series per ULP/consumer/event based.
Will send v1 through Leon's queue.

> And not using the ib_enqueue_cache_update_event() but a simple
> blocking_notifier_call_chain() with the cache always at the front
> 
> > Only event that I wanted to deliver faster was
> > IB_EVENT_SRQ_LIMIT_REACHED.
> 
> It might make sense to have an atomic event list for such things in future..
> 
Ok.

> Jason

  reply	other threads:[~2019-10-24 19:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20  6:54 [PATCH rdma-next 0/3] Let IB core distribute cache update events Leon Romanovsky
2019-10-20  6:54 ` [PATCH rdma-next 1/3] IB/core: " Leon Romanovsky
2019-10-22 19:55   ` Jason Gunthorpe
2019-10-23  5:08     ` Parav Pandit
2019-10-23 17:40       ` Jason Gunthorpe
2019-10-24 19:58         ` Parav Pandit [this message]
2019-10-20  6:54 ` [PATCH rdma-next 2/3] IB/core: Cut down single member ib_cache structure Leon Romanovsky
2019-10-20  6:54 ` [PATCH rdma-next 3/3] IB/core: Do not notify GID change event of an unregistered device Leon Romanovsky
2019-10-22 20:00   ` Jason Gunthorpe

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=AM0PR05MB4866E018CCCAE50CFBC79E6DD16A0@AM0PR05MB4866.eurprd05.prod.outlook.com \
    --to=parav@mellanox.com \
    --cc=danielj@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=leon@kernel.org \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.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.