All of lore.kernel.org
 help / color / mirror / Atom feed
From: florian@mickler.org
To: James.Bottomley@suse.de
Cc: markgross@thegnar.org, Frederic Weisbecker <fweisbec@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	linville@tuxdriver.com, linux-kernel@vger.kernel.org,
	Florian Mickler <florian@mickler.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 3/3] pm_qos: only schedule work when in interrupt context
Date: Mon, 14 Jun 2010 16:46:40 +0200	[thread overview]
Message-ID: <1276526800-12362-3-git-send-email-florian@mickler.org> (raw)
In-Reply-To: <1276266352.2862.70.camel@mulgrave.site>

With this patch we only schedule the work when in interrupt context.

Before update_request was callable from interrupt-context there was a
1:1 relation between a change in the request-value and a notification.
This patch restores that behaviour for all constraints that have update_request
never called from interrupt context.

The notifier mutex serializes calls to blocking_notifier_call_chain, so
that we are serialized against any pending or currently executing notification.

Signed-off-by: Florian Mickler <florian@mickler.org>
---
 kernel/pm_qos_params.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index 9346906..c06cae9 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -152,11 +152,15 @@ static s32 min_compare(s32 v1, s32 v2)
 static void pm_qos_call_notifiers(struct pm_qos_object *o,
 				  unsigned long curr_value)
 {
-	schedule_work(&o->notify);
-
 	if (o->atomic_notifiers)
 		atomic_notifier_call_chain(o->atomic_notifiers,
-					   curr_value, NULL);
+				(unsigned long) curr_value, NULL);
+
+	if (in_interrupt()) 
+		schedule_work(&o->notify);
+	else 
+		blocking_notifier_call_chain(o->blocking_notifiers, 
+				(unsigned long) curr_value, NULL);
 }
 
 static void update_notify(struct work_struct *work)
-- 
1.7.1

  parent reply	other threads:[~2010-06-14 14:46 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09 15:29 [PATCH v4] pm_qos: make update_request non blocking florian
2010-06-09 15:37 ` James Bottomley
2010-06-09 15:37 ` James Bottomley
2010-06-09 16:00   ` Florian Mickler
2010-06-09 16:00   ` Florian Mickler
2010-06-09 16:07     ` James Bottomley
2010-06-09 16:07     ` James Bottomley
2010-06-09 16:32       ` Florian Mickler
2010-06-09 17:05         ` James Bottomley
2010-06-09 17:05         ` James Bottomley
2010-06-09 17:31           ` Florian Mickler
2010-06-09 17:31           ` Florian Mickler
2010-06-10  7:45           ` Florian Mickler
2010-06-10 13:39             ` James Bottomley
2010-06-10 13:39             ` [linux-pm] " James Bottomley
2010-06-10 14:41               ` Florian Mickler
2010-06-11 14:25                 ` James Bottomley
2010-06-11 14:25                 ` [linux-pm] " James Bottomley
2010-06-11 15:49                   ` Florian Mickler
2010-06-11 15:49                   ` [linux-pm] " Florian Mickler
2010-06-14 14:33                   ` Florian Mickler
2010-06-14 14:33                   ` [linux-pm] " Florian Mickler
2010-06-14 14:44                     ` James Bottomley
2010-06-14 14:44                     ` [linux-pm] " James Bottomley
2010-06-14 14:49                       ` Florian Mickler
2010-06-14 14:49                       ` [linux-pm] " Florian Mickler
2010-06-14 15:10                         ` James Bottomley
2010-06-14 15:20                           ` Florian Mickler
2010-06-14 15:20                           ` [linux-pm] " Florian Mickler
2010-06-14 15:10                         ` James Bottomley
2010-06-14 14:46                   ` [PATCH 1/3] " florian
2010-06-14 14:46                   ` [PATCH 2/3] pm_qos: add atomic notifier chain florian
2010-06-14 14:46                   ` florian [this message]
2010-06-15 17:23                     ` [PATCH 3/3] pm_qos: only schedule work when in interrupt context Florian Mickler
2010-06-15 17:23                     ` Florian Mickler
2010-06-17 23:02                       ` James Bottomley
2010-06-17 23:02                       ` James Bottomley
2010-06-10 14:41               ` [PATCH v4] pm_qos: make update_request non blocking Florian Mickler
2010-06-10  7:45           ` Florian Mickler
2010-06-09 16:32       ` Florian Mickler

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=1276526800-12362-3-git-send-email-florian@mickler.org \
    --to=florian@mickler.org \
    --cc=James.Bottomley@suse.de \
    --cc=corbet@lwn.net \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linville@tuxdriver.com \
    --cc=markgross@thegnar.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 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.