linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bill Huey (hui)" <bill.huey@gmail.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org
Cc: Dario Faggioli <raistlin@linux.it>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Thomas Gleixner <tglx@linutronix.de>,
	KY Srinivasan <kys@microsoft.com>,
	Amir Frenkel <frenkel.amir@gmail.com>,
	Bdale Garbee <bdale@gag.com>
Subject: [PATCH RFC v0 02/12] Reroute rtc update irqs to the cyclic scheduler handler
Date: Mon, 11 Apr 2016 22:29:10 -0700	[thread overview]
Message-ID: <1460438960-32060-3-git-send-email-bill.huey@gmail.com> (raw)
In-Reply-To: <1460438960-32060-1-git-send-email-bill.huey@gmail.com>

Redirect rtc update irqs so that it drives the cyclic scheduler timer
handler instead. Let the handler determine which slot to activate next.
Similar to scheduler tick handling but just for the cyclic scheduler.

Signed-off-by: Bill Huey (hui) <bill.huey@gmail.com>
---
 drivers/rtc/interface.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 9ef5f6f..6d39d40 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -17,6 +17,10 @@
 #include <linux/log2.h>
 #include <linux/workqueue.h>
 
+#ifdef CONFIG_RTC_CYCLIC
+#include "../kernel/sched/cyclic.h"
+#endif
+
 static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer);
 static void rtc_timer_remove(struct rtc_device *rtc, struct rtc_timer *timer);
 
@@ -488,6 +492,9 @@ EXPORT_SYMBOL_GPL(rtc_update_irq_enable);
 void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode)
 {
 	unsigned long flags;
+#ifdef CONFIG_RTC_CYCLIC
+	int handled = 0;
+#endif
 
 	/* mark one irq of the appropriate mode */
 	spin_lock_irqsave(&rtc->irq_lock, flags);
@@ -500,7 +507,23 @@ void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode)
 		rtc->irq_task->func(rtc->irq_task->private_data);
 	spin_unlock_irqrestore(&rtc->irq_task_lock, flags);
 
+#ifdef CONFIG_RTC_CYCLIC
+	/* wake up slot_curr if overrun task */
+	if (RTC_PF) {
+		if (rt_overrun_rq_admitted()) {
+			/* advance the cursor, overrun report */
+			rt_overrun_timer_handler(rtc);
+			handled = 1;
+		}
+	}
+
+	if (!handled) {
+		wake_up_interruptible(&rtc->irq_queue);
+	}
+#else
 	wake_up_interruptible(&rtc->irq_queue);
+#endif
+
 	kill_fasync(&rtc->async_queue, SIGIO, POLL_IN);
 }
 
-- 
2.5.0

  parent reply	other threads:[~2016-04-12  5:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12  5:29 [PATCH RFC v0 00/12] Cyclic Scheduler Against RTC Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 01/12] Kconfig change Bill Huey (hui)
2016-04-12  5:29 ` Bill Huey (hui) [this message]
2016-04-12  5:29 ` [PATCH RFC v0 03/12] Add cyclic support to rtc-dev.c Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 04/12] Anonymous struct initialization Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 05/12] Task tracking per file descriptor Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 06/12] Add anonymous struct to sched_rt_entity Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 07/12] kernel/userspace additions for addition ioctl() support for rtc Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 08/12] Compilation support Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 09/12] Add priority support for the cyclic scheduler Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 10/12] Export SCHED_FIFO/RT requeuing functions Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 11/12] Cyclic scheduler support Bill Huey (hui)
2016-04-12  5:29 ` [PATCH RFC v0 12/12] Cyclic/rtc documentation Bill Huey (hui)
2016-04-12  5:58 ` [PATCH RFC v0 00/12] Cyclic Scheduler Against RTC Mike Galbraith
     [not found]   ` <CAAmnkz=X4TtY7LQwPuWWD0q99XeZQT+53RZ_7dNb3P=X=+jxrg@mail.gmail.com>
2016-04-12  6:05     ` Mike Galbraith
2016-04-13  8:57 ` Juri Lelli
2016-04-13  9:37   ` Bill Huey (hui)
2016-04-13 10:08     ` Juri Lelli
2016-04-13 10:35       ` Bill Huey (hui)

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=1460438960-32060-3-git-send-email-bill.huey@gmail.com \
    --to=bill.huey@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=a.zummo@towertech.it \
    --cc=bdale@gag.com \
    --cc=frenkel.amir@gmail.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raistlin@linux.it \
    --cc=rostedt@goodmis.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 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).