All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Jens Axboe <axboe@fb.com>, Jes Sorensen <jsorensen@fb.com>,
	Tariq Toukan <tariqt@mellanox.com>,
	Saeed Mahameed <saeedm@dev.mellanox.co.il>,
	Networking <netdev@vger.kernel.org>,
	Leon Romanovsky <leonro@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>,
	Kernel Team <kernel-team@fb.com>, Christoph Hellwig <hch@lst.de>
Subject: Re: [RFD] Managed interrupt affinities [ Was: mlx5 broken affinity ]
Date: Mon, 13 Nov 2017 22:33:49 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1711132220240.2097@nanos> (raw)
In-Reply-To: <4bae1d1d-d401-115d-91cc-4b7df88b02c5@grimberg.me>

On Mon, 13 Nov 2017, Sagi Grimberg wrote:
> > > >          #1 Before the core tries to move the interrupt so it can veto
> > > > the
> > > > 	  move if it cannot allocate new resources or whatever is required
> > > > 	  to operate after the move.
> > > 
> > > What would the core do if a driver veto a move?
> > 
> > Return the error code from write_affinity() as it does with any other error
> > which fails to set the affinity.
> 
> OK, so this would mean that the driver queue no longer has a vector
> correct? so is the semantics that it needs to cleanup its resources or
> should it expect another callout for that?

The driver queue still has the old vector, i.e.

echo XXX > /proc/irq/YYY/affinity

     write_irq_affinity(newaffinity)

	newvec = reserve_new_vector();

	ret = subsys_pre_move_callback(...., newaffinity);

	if (ret) {
		drop_new_vector(newvec);
		return ret;
	}

	shutdown(oldvec);
	install(newvec);

	susbsys_post_move_callback(....)

	startup(newvec);

subsys_pre_move_callback()

	ret = do_whatever();
	if (ret)
		return ret;

	/*
	 * Make sure nothing is queued anymore and outstanding
	 * requests are completed. Same as for managed CPU hotplug.
	 */
	stop_and_drain_queue();
	return 0;

subsys_post_move_callback()

	install_new_data();

	/* Reenable queue. Same as for managed CPU hotplug */
	reenable_queue();

	free_old_data();
	return;

Does that clarify the mechanism?

> > > This looks like it can work to me, but I'm probably not familiar enough
> > > to see the full picture here.
> > 
> > On the interrupt core side this is workable, I just need the input from the
> > driver^Wsubsystem side if this can be implemented sanely.
> 
> Can you explain what do you mean by "subsystem"? I thought that the
> subsystem would be the irq subsystem (which means you are the one to provide
> the needed input :) ) and the driver would pass in something
> like msi_irq_ops to pci_alloc_irq_vectors() if it supports the driver
> requirements that you listed and NULL to tell the core to leave it alone
> and do what it sees fit (or pass msi_irq_ops with flag that means that).
> 
> ops structure is a very common way for drivers to communicate with a
> subsystem core.

So if you look at the above pseudo code then the subsys_*_move_callbacks
are probably subsystem specific, i.e. block or networking.

Those subsystem callbacks might either handle it at the subsystem level
directly or call into the particular driver.

That's certainly out of the scope what the generic interrupt code can do :)

Thanks,

	tglx

  reply	other threads:[~2017-11-13 21:33 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 16:19 mlx5 broken affinity Jes Sorensen
2017-11-01 17:21 ` Sagi Grimberg
2017-11-01 18:20   ` Jes Sorensen
2017-11-01 22:41     ` Saeed Mahameed
2017-11-01 23:02       ` Jes Sorensen
2017-11-02  8:28         ` Tariq Toukan
2017-11-02 10:08           ` Sagi Grimberg
2017-11-02 12:13             ` Andrew Lunn
2017-11-02 14:48             ` Jes Sorensen
2017-11-02 16:14               ` Sagi Grimberg
2017-11-02 17:13                 ` Jes Sorensen
2017-11-02 18:10                 ` Thomas Gleixner
2017-11-05  8:36                   ` Sagi Grimberg
2017-11-07 15:07                     ` Thomas Gleixner
2017-11-08  7:27                       ` Sagi Grimberg
2017-11-08 12:21                         ` David Laight
2017-11-08 16:13                           ` Jens Axboe
2017-11-09 10:09                             ` Christoph Hellwig
2017-11-09 15:18                               ` Jens Axboe
2017-11-09 15:08                         ` Saeed Mahameed
2017-11-09 15:40                           ` Sagi Grimberg
2017-11-08 16:19                       ` Jes Sorensen
2017-11-08 17:33                         ` Thomas Gleixner
2017-11-09 10:50                           ` Sagi Grimberg
2017-11-09 14:19                             ` Thomas Gleixner
2017-11-09 15:21                               ` Jens Axboe
2017-11-09 17:03                                 ` Thomas Gleixner
2017-11-09 20:11                                   ` Jens Axboe
2017-11-09 21:23                                     ` Thomas Gleixner
2017-11-09 21:30                                       ` Jens Axboe
2017-11-09 21:42                                     ` [RFD] Managed interrupt affinities [ Was: mlx5 broken affinity ] Thomas Gleixner
2017-11-10  5:56                                       ` Saeed Mahameed
2017-11-10 13:03                                         ` Thomas Gleixner
2017-11-13 19:20                                       ` Sagi Grimberg
2017-11-13 20:51                                         ` Thomas Gleixner
2017-11-13 21:13                                           ` Sagi Grimberg
2017-11-13 21:33                                             ` Thomas Gleixner [this message]
2017-11-13 21:49                                               ` Sagi Grimberg
2017-11-14 10:15                                                 ` Thomas Gleixner
2017-11-09 16:01                               ` mlx5 broken affinity Sagi Grimberg
2017-11-09 16:09                                 ` Jens Axboe
2017-11-09 17:07                                   ` Thomas Gleixner
2017-11-09 20:12                                     ` Jens Axboe
2017-11-09 21:25                                       ` Thomas Gleixner
2017-11-09 15:19                             ` Jens Axboe
2017-11-09 22:03                           ` Jes Sorensen
2017-11-02  7:57     ` Sagi Grimberg

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=alpine.DEB.2.20.1711132220240.2097@nanos \
    --to=tglx@linutronix.de \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=jsorensen@fb.com \
    --cc=kernel-team@fb.com \
    --cc=leonro@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@dev.mellanox.co.il \
    --cc=saeedm@mellanox.com \
    --cc=sagi@grimberg.me \
    --cc=tariqt@mellanox.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.