mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: David Decotigny <decot@googlers.com>
Cc: <linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	Amir Vadai <amirv@mellanox.com>,
	"Paul E. McKenney" <paul.mckenney@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Josh Triplett <josh@joshtriplett.org>,
	David Howells <dhowells@redhat.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: Re: [PATCH v3] lib: cpu_rmap: avoid flushing all workqueues
Date: Wed, 2 Jan 2013 20:21:37 +0000	[thread overview]
Message-ID: <1357158097.3652.36.camel@bwh-desktop.uk.solarflarecom.com> (raw)
In-Reply-To: <796d4768f46d928c68018f44b369df570a0889c4.1356810877.git.decot@googlers.com>

On Sat, 2012-12-29 at 11:57 -0800, David Decotigny wrote:
> In some cases, free_irq_cpu_rmap() is called while holding a lock
> (eg. rtnl).

I made fairly sure that it didn't get called while holding the RTNL
lock.  However it looks like some mlx4_en ethtool ops now call it
(indirectly).

> This can lead to deadlocks, because it invokes
> flush_scheduled_work() which ends up waiting for whole system
> workqueue to flush, but some pending works might try to acquire the
> lock we are already holding.

Which is why the kernel-doc says not to do that.  But realistically a
device driver may not easily be able to avoid holding either its
underlying device's lock or a susbsytem global lock... and presumably
there may sometimes be a work item that needs the device lock.

> This commit uses reference-counting to replace
> irq_run_affinity_notifiers(). It also removes
> irq_run_affinity_notifiers() altogether.
> 
> Signed-off-by: David Decotigny <decot@googlers.com>
[...]
> --- a/lib/cpu_rmap.c
> +++ b/lib/cpu_rmap.c
[...]
>  /**
>   * irq_cpu_rmap_add - add an IRQ to a CPU affinity reverse-map
> - * @rmap: The reverse-map
> + * @rmap: The per-IRQ reverse-map
[...]

Please drop this comment change; the only 'per-IRQ' thing is the IRQ
notifier structure which is private.

With that, you can add:

Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


      parent reply	other threads:[~2013-01-02 20:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1356810877.git.decot@googlers.com>
2012-12-29 19:57 ` David Decotigny
2012-12-29 20:36   ` Josh Triplett
2013-01-02 20:29     ` Ben Hutchings
2013-01-02 20:34       ` David Decotigny
2013-01-02 21:12         ` David Decotigny
2013-01-02 20:21   ` Ben Hutchings [this message]

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=1357158097.3652.36.camel@bwh-desktop.uk.solarflarecom.com \
    --to=bhutchings@solarflare.com \
    --cc=akpm@linux-foundation.org \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=decot@googlers.com \
    --cc=dhowells@redhat.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=paul.mckenney@linaro.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®