linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Wang <wangyun@linux.vnet.ibm.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Paul Turner <pjt@google.com>, Dhaval Giani <dhaval.giani@gmail.com>
Subject: [RFC PATCH 2/4] linsched: add check on invoke "tick_nohz_irq_exit" in "irq_exit"
Date: Mon, 16 Apr 2012 11:37:53 +0800	[thread overview]
Message-ID: <4F8B9411.8090600@linux.vnet.ibm.com> (raw)

From: Michael Wang <wangyun@linux.vnet.ibm.com>

"tick_nohz_irq_exit" will make sure the tick timer reprogram correctly
after cpu enter idle.

With out this check, after the interrupt, tick timer will be enabled
even cpu is still in idle, this will cause inaccuracy if cpu do load
balance in next tick.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
---
 arch/linsched/kernel/irq.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/linsched/kernel/irq.c b/arch/linsched/kernel/irq.c
index a800bbd..d5d16e5 100644
--- a/arch/linsched/kernel/irq.c
+++ b/arch/linsched/kernel/irq.c
@@ -1,6 +1,7 @@
 #include <linux/interrupt.h>
 #include <asm/hardirq.h>
 #include <linux/sched.h>
+#include <linux/tick.h>

 unsigned long linsched_irq_flags = ARCH_IRQ_ENABLED;

@@ -81,6 +82,9 @@ void irq_exit(void)
 	sub_preempt_count(IRQ_EXIT_OFFSET);
 	if (!in_interrupt() && local_softirq_pending())
 		do_softirq();
+
+	if (idle_cpu(smp_processor_id()) && !in_interrupt() && !need_resched())
+		tick_nohz_irq_exit();
 }

 void local_bh_enable_ip(unsigned long ip)
-- 
1.7.1


             reply	other threads:[~2012-04-16  3:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16  3:37 Michael Wang [this message]
2012-09-03  3:58 [RFC PATCH 2/4] linsched: add check on invoke tick_nohz_irq_exit() in irq_exit() Michael Wang

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=4F8B9411.8090600@linux.vnet.ibm.com \
    --to=wangyun@linux.vnet.ibm.com \
    --cc=dhaval.giani@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pjt@google.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).