Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1376481

[PATCH RFC v0 02/12] Reroute rtc update irqs to the cyclic scheduler handler

Path csiph.com!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From "Bill Huey (hui)" <bill.huey@gmail.com>
Newsgroups linux.kernel
Subject [PATCH RFC v0 02/12] Reroute rtc update irqs to the cyclic scheduler handler
Date Tue, 12 Apr 2016 07:40:02 +0200
Message-ID <rmZdo-1UI-11@gated-at.bofh.it> (permalink)
References <rmZ3H-1MB-3@gated-at.bofh.it>
X-Original-To Peter Zijlstra <a.p.zijlstra@chello.nl>, Steven Rostedt <rostedt@goodmis.org>, linux-kernel@vger.kernel.org
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ex/LsRpnTcteIuGt+UNWxSXyHZmXs69sOmkiX1w5D98=; b=oOcWYFP1WduVHpEJns+oSx6OUHVbP/1/HR993Zhr0EpF2nuKviv/002nOyaPEVtGWX R/aQkv1/VPPjgAFHpQTZNjKmdIM3BgAkaqGSxOfgPyNMteXbn7hHmBpEDwM1+uaNNWa6 fdv4UVEktAj31u4ddbTklLCKXAJZu3crrxpUZZoc1O6Ix4LJB5klb5jKSYuiJIOBnxqA 4LEuFEscYDRSTo+d3CYkQkd3EbzIZv2MR1osQKMVcqpg0xGdjAGd0JNSs0qRGc5Ts09F oQckug6ay+ahNIZjFGvANYvxoDu3XxUkTcI/DTDszNHQZt+oN3k7TIrRiZh6Td/4RVjy 6o7A==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ex/LsRpnTcteIuGt+UNWxSXyHZmXs69sOmkiX1w5D98=; b=ewoKfKctmR+iY+RnT84eCbKr11JLq+5ROJmaNoMOMbSVdJto5S3B0S2xP3PoApQtCU 7yAfjO0ahTAra9iYCPiV5uVov463xywIPkjmNWvSKgfZO17+ftiJubHS1ea2vLLmEwS3 O/gL6c7Gifr0gCaQ5lO/ylFSP3BTF37vHMUPbTrs8kJ8+gv1PnJf0/OqFCS6mBydjYl4 1UcuhlgNRC6OG1ssf7SrLPrU29lAt+PVQTEiJcC5675muXXgSGQu9rL43qHfsMrxmt15 ncbKpj386tq2ueVD3GO9JMpQL8bush0QKX1P4HbgPbJP8Q7AheCyE8fc0LlEnurOuyqJ vwuQ==
X-Gm-Message-State AOPr4FUjz8/aTnG4kP5XQfmO8VcOaJsYICVsKwj6ME3zR9Ljv04LUvl2+fF0a5fU1/4Hkw==
X-Received by 10.157.11.21 with SMTP id a21mr644524ota.5.1460438965670; Mon, 11 Apr 2016 22:29:25 -0700 (PDT)
X-Mailer git-send-email 2.5.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 60
Organization linux.* mail to news gateway
X-Original-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>
X-Original-Date Mon, 11 Apr 2016 22:29:10 -0700
X-Original-Message-ID <1460438960-32060-3-git-send-email-bill.huey@gmail.com>
X-Original-References <1460438960-32060-1-git-send-email-bill.huey@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1376481

Show key headers only | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RFC v0 00/12] Cyclic Scheduler Against RTC "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:30 +0200
  [PATCH RFC v0 01/12] Kconfig change "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:40 +0200
  [PATCH RFC v0 03/12] Add cyclic support to rtc-dev.c "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:40 +0200
  [PATCH RFC v0 10/12] Export SCHED_FIFO/RT requeuing functions "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:40 +0200
  [PATCH RFC v0 07/12] kernel/userspace additions for addition ioctl() support for rtc "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:40 +0200
  [PATCH RFC v0 08/12] Compilation support "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:40 +0200
  [PATCH RFC v0 02/12] Reroute rtc update irqs to the cyclic scheduler handler "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:40 +0200
  [PATCH RFC v0 12/12] Cyclic/rtc documentation "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:40 +0200
  [PATCH RFC v0 06/12] Add anonymous struct to sched_rt_entity "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:40 +0200
  [PATCH RFC v0 05/12] Task tracking per file descriptor "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-12 07:40 +0200
  Re: [PATCH RFC v0 00/12] Cyclic Scheduler Against RTC Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-04-12 08:00 +0200
    Re: [PATCH RFC v0 00/12] Cyclic Scheduler Against RTC Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-04-12 08:10 +0200
  Re: [PATCH RFC v0 00/12] Cyclic Scheduler Against RTC Juri Lelli <juri.lelli@arm.com> - 2016-04-13 11:00 +0200
    Re: [PATCH RFC v0 00/12] Cyclic Scheduler Against RTC "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-13 11:40 +0200
      Re: [PATCH RFC v0 00/12] Cyclic Scheduler Against RTC Juri Lelli <juri.lelli@arm.com> - 2016-04-13 12:10 +0200
        Re: [PATCH RFC v0 00/12] Cyclic Scheduler Against RTC "Bill Huey (hui)" <bill.huey@gmail.com> - 2016-04-13 12:40 +0200

csiph-web