linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Korty <joe.korty@ccur.com>
To: linux-rt-users <linux-rt-users@vger.kernel.org>
Subject: might_sleep oops in irq_set_affinity_notifier users
Date: Mon, 19 Aug 2013 12:25:25 -0400	[thread overview]
Message-ID: <20130819162525.GA3532@tsunami.ccur.com> (raw)

Hi,
The sfc, mellanox, and infiniband drivers use the
irq_set_affinity_notifier service.  This causes these
drivers to issue a might_sleep oops on driver load due to
calling schedule_work under a raw spin lock:

int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask)
{
	...
	if (desc->affinity_notify) {
		kref_get(&desc->affinity_notify->kref);
		schedule_work(&desc->affinity_notify->work);
	}
	...
}

int irq_set_affinity(unsigned int irq, const struct cpumask *mask)
{
	...
	raw_spin_lock_irqsave(&desc->lock, flags);
	ret =  __irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask);
	raw_spin_unlock_irqrestore(&desc->lock, flags);
	...
}

I suppose this could be fixed by using tasklets instead of
schedule_work.  But perhaps it might be better to modify
work queues to use raw locks for the queuing / dequeing
of work rather than sleepy locks; that way, work can be
queued up under both sleepy and atomic contexts under the
rt kernel, just as work can be today queued up under the
nort kernel without any problems.

Joe

PS: failure paths: both sfc and mellanox invoke
irq_cpu_rmap_add which in turn invokes the above
irq_set_affinity lock which oops.  The infiniband driver
invokes irq_set_affinity_lock directly.

PPS: oops was observed under 3.6.11.6-rt38 but a perusal
of 3.10.6-rt3 sources shows it has the same problem.

                 reply	other threads:[~2013-08-19 16:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20130819162525.GA3532@tsunami.ccur.com \
    --to=joe.korty@ccur.com \
    --cc=linux-rt-users@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 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).