linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>,
	Ming Lei <ming.lei@canonical.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	David Miller <davem@davemloft.net>,
	Roland Dreier <roland@kernel.org>,
	netdev <netdev@vger.kernel.org>, Yan Burman <yanb@mellanox.com>,
	Jack Morgenstein <jackm@dev.mellanox.co.il>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH repost for-3.9] pci: avoid work_on_cpu for nested SRIOV probes
Date: Thu, 11 Apr 2013 11:05:17 -0700	[thread overview]
Message-ID: <20130411180517.GJ17641@mtj.dyndns.org> (raw)
In-Reply-To: <20130411153030.GA22743@redhat.com>

Hello,

On Thu, Apr 11, 2013 at 06:30:30PM +0300, Michael S. Tsirkin wrote:
> The issue is that a driver, in it's probe function, calls
> pci_sriov_enable so a PF device probe causes VF probe (AKA nested
> probe).  Each probe in pci_device_probe is (normally) run through
> work_on_cpu (this is to get the right numa node for memory allocated by
> the driver).  In turn work_on_cpu does this internally:
> 
>         schedule_work_on(cpu, &wfc.work);
>         flush_work(&wfc.work);
> 
> So if you are running probe on CPU1, and cause another
> probe on the same CPU, this will try to flush
> workqueue from inside same workqueue which of course
> deadlocks.
> 
> Nested probing might be tricky to get right generally.

Hmm... how about adding a work_on_cpu_nested() which takes @subclass
argument?  Wouldn't that be much cleaner?

Thanks.

-- 
tejun

  reply	other threads:[~2013-04-11 18:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 15:30 [PATCH repost for-3.9] pci: avoid work_on_cpu for nested SRIOV probes Michael S. Tsirkin
2013-04-11 18:05 ` Tejun Heo [this message]
2013-04-11 18:58   ` Michael S. Tsirkin
2013-04-11 19:04     ` Tejun Heo
2013-04-11 19:17       ` Michael S. Tsirkin
2013-04-11 19:20         ` Tejun Heo
2013-04-11 20:30           ` Michael S. Tsirkin
2013-04-11 20:41             ` Tejun Heo
2013-04-11 21:52               ` Or Gerlitz
     [not found]               ` <516AA80F.7040505@mellanox.com>
2013-04-14 13:43                 ` Tejun Heo
2013-04-18  8:33                   ` Michael S. Tsirkin
2013-04-18  9:40                     ` Jack Morgenstein
2013-04-18  8:48                       ` Michael S. Tsirkin
2013-04-18  9:57                         ` Jack Morgenstein
2013-04-18 14:49                     ` Or Gerlitz
2013-04-18 13:54                       ` Michael S. Tsirkin
2013-04-18 18:19                         ` Tejun Heo
2013-04-18 18:25                           ` Bjorn Helgaas
2013-04-18 20:11                             ` Michael S. Tsirkin
2013-04-18 18:41                         ` Or Gerlitz
2013-04-18 20:03                           ` Michael S. Tsirkin

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=20130411180517.GJ17641@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jackm@dev.mellanox.co.il \
    --cc=linux-pci@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=roland@kernel.org \
    --cc=yanb@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).