public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Mickler <florian@mickler.org>
To: Florian Mickler <florian@mickler.org>
Cc: pm list <linux-pm@lists.linux-foundation.org>,
	James Bottomley <James.Bottomley@suse.de>,
	markgross@thegnar.org
Subject: Re: [PATCH v3] pm_qos: make update_request callable from interrupt context
Date: Wed, 9 Jun 2010 09:18:39 +0200	[thread overview]
Message-ID: <20100609091839.6b34f8e7@schatten.dmk.lab> (raw)
In-Reply-To: <20100609091330.77427fb9@schatten.dmk.lab>

On Wed, 9 Jun 2010 09:13:30 +0200
Florian Mickler <florian@mickler.org> wrote:

> On Wed, 9 Jun 2010 08:54:27 +0200
> Florian Mickler <florian@mickler.org> wrote:
> 
>  > > On Mon, Jun 07, 2010 at 12:19:41PM -0400, James Bottomley wrote:
> > > > > On Mon, 2010-06-07 at 17:34 +0200, florian@mickler.org wrote:
> > > > > > We use the spinlocked notifier chain variant (struct
> > > > > > atomic_notifier_head) and add an __might_sleep() to the chain for
> > > > > > constraints which have non-atomic notifiers. This way we catch all
> > > > > > interrupt-context-update-sites at runtime.
> > > > > 
> > > > > Actually, I'm afraid we can't really call blocking notifiers through the
> > > > > atomic chain because we might end up with a contested chain call and a
> > > > > huge busy wait in the spinlock (especially if one of the notifiers is
> > > > > sleeping).
> 	
> Actually, I just checked and __atomic_notifier_call_chain()
> uses an rcu_read_lock() to protect the chain from removal of
> notifiers while going through it. 
> 	
> So I (now again) think this patch (with queuing the  might_sleep() for
> the network notifier) might be enough.
> 
> Cheers,
> Flo

Oh, wow. I changed my mind again after reading up on RCU :|.

 * It is illegal to block while in an RCU read-side critical section.

(from include/linux/rcupdate.h)

Cheers,
Flo

p.s.: so, back to my original plan. 

      reply	other threads:[~2010-06-09  7:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-07 12:31 [PATCH] pm_qos: make update_request callable from interrupt context florian
2010-06-07 13:10 ` James Bottomley
2010-06-07 13:37   ` Alan Stern
2010-06-07 14:10   ` Florian Mickler
2010-06-07 14:20     ` James Bottomley
2010-06-07 15:27       ` [PATCH v2] " florian
2010-06-07 15:34       ` [PATCH v3] " florian
2010-06-07 16:19         ` James Bottomley
2010-06-08  4:13           ` mark gross
2010-06-08  8:09             ` Florian Mickler
2010-06-08 12:06             ` James Bottomley
2010-06-09  6:54               ` Florian Mickler
2010-06-09  7:13                 ` Florian Mickler
2010-06-09  7:18                   ` Florian Mickler [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=20100609091839.6b34f8e7@schatten.dmk.lab \
    --to=florian@mickler.org \
    --cc=James.Bottomley@suse.de \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=markgross@thegnar.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