public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Using msleep() instead of HZ
  2005-06-14 11:31 [PATCH] Using msleep() instead of HZ Luca Falavigna
@ 2005-06-14  9:40 ` Ingo Molnar
  2005-06-14 16:10 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2005-06-14  9:40 UTC (permalink / raw)
  To: Luca Falavigna; +Cc: akpm, Linux Kernel Mailing List


* Luca Falavigna <dktrkranz@gmail.com> wrote:

> Hi Andrew,
> Ingo suggested me to forward you my patches which do use of msleep in order to
> perform short delays instead of using HZ directly.
> I already sent him some, but they are against his -RT tree.
> This is a modified patch, built against 2.6.12-rc6.
> 
> Signed-off by: Luca Falavigna <dktrkranz@gmail.com>

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Using msleep() instead of HZ
@ 2005-06-14 11:31 Luca Falavigna
  2005-06-14  9:40 ` Ingo Molnar
  2005-06-14 16:10 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Luca Falavigna @ 2005-06-14 11:31 UTC (permalink / raw)
  To: akpm; +Cc: mingo, Linux Kernel Mailing List

Hi Andrew,
Ingo suggested me to forward you my patches which do use of msleep in order to
perform short delays instead of using HZ directly.
I already sent him some, but they are against his -RT tree.
This is a modified patch, built against 2.6.12-rc6.

Signed-off by: Luca Falavigna <dktrkranz@gmail.com>

--- ./drivers/char/rtc.c.orig	2005-06-14 11:25:52.000000000 +0000
+++ ./drivers/char/rtc.c	2005-06-14 11:27:21.000000000 +0000
@@ -894,7 +894,6 @@ static int __init rtc_init(void)
 	struct proc_dir_entry *ent;
 #if defined(__alpha__) || defined(__mips__)
 	unsigned int year, ctrl;
-	unsigned long uip_watchdog;
 	char *guess = NULL;
 #endif
 #ifdef __sparc__
@@ -1000,12 +999,8 @@ no_irq:
 	/* Each operating system on an Alpha uses its own epoch.
 	   Let's try to guess which one we are using now. */
 	
-	uip_watchdog = jiffies;
 	if (rtc_is_updating() != 0)
-		while (jiffies - uip_watchdog < 2*HZ/100) {
-			barrier();
-			cpu_relax();
-		}
+		msleep(20);
 	
 	spin_lock_irq(&rtc_lock);
 	year = CMOS_READ(RTC_YEAR);
@@ -1213,7 +1208,6 @@ static int rtc_proc_open(struct inode *i

 void rtc_get_rtc_time(struct rtc_time *rtc_tm)
 {
-	unsigned long uip_watchdog = jiffies;
 	unsigned char ctrl;
 #ifdef CONFIG_MACH_DECSTATION
 	unsigned int real_year;
@@ -1221,7 +1215,7 @@ void rtc_get_rtc_time(struct rtc_time *r

 	/*
 	 * read RTC once any update in progress is done. The update
-	 * can take just over 2ms. We wait 10 to 20ms. There is no need to
+	 * can take just over 2ms. We wait 20ms. There is no need to
 	 * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP.
 	 * If you need to know *exactly* when a second has started, enable
 	 * periodic update complete interrupts, (via ioctl) and then
@@ -1230,10 +1224,7 @@ void rtc_get_rtc_time(struct rtc_time *r
 	 */

 	if (rtc_is_updating() != 0)
-		while (jiffies - uip_watchdog < 2*HZ/100) {
-			barrier();
-			cpu_relax();
-		}
+		msleep(20);

 	/*
 	 * Only the values that we read from the RTC are set. We leave
--- ./kernel/irq/autoprobe.c.orig	2005-06-14 11:29:01.000000000 +0000
+++ ./kernel/irq/autoprobe.c	2005-06-14 11:29:08.000000000 +0000
@@ -45,8 +45,7 @@ unsigned long probe_irq_on(void)
 	}

 	/* Wait for longstanding interrupts to trigger. */
-	for (delay = jiffies + HZ/50; time_after(delay, jiffies); )
-		/* about 20ms delay */ barrier();
+	msleep(20);

 	/*
 	 * enable any unassigned irqs
@@ -68,8 +67,7 @@ unsigned long probe_irq_on(void)
 	/*
 	 * Wait for spurious interrupts to trigger
 	 */
-	for (delay = jiffies + HZ/10; time_after(delay, jiffies); )
-		/* about 100ms delay */ barrier();
+	msleep(100);

 	/*
 	 * Now filter out any obviously spurious interrupts


I'm a bit late. I'm having troubles with my ISP. Sorry.
Regards,
-- 
					Luca



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Using msleep() instead of HZ
  2005-06-14 11:31 [PATCH] Using msleep() instead of HZ Luca Falavigna
  2005-06-14  9:40 ` Ingo Molnar
@ 2005-06-14 16:10 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2005-06-14 16:10 UTC (permalink / raw)
  To: Luca Falavigna; +Cc: akpm, mingo, Linux Kernel Mailing List

Luca Falavigna wrote:
> Hi Andrew,
> Ingo suggested me to forward you my patches which do use of msleep in order to
> perform short delays instead of using HZ directly.
> I already sent him some, but they are against his -RT tree.
> This is a modified patch, built against 2.6.12-rc6.
> 
> Signed-off by: Luca Falavigna <dktrkranz@gmail.com>

ACK



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-06-14 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-14 11:31 [PATCH] Using msleep() instead of HZ Luca Falavigna
2005-06-14  9:40 ` Ingo Molnar
2005-06-14 16:10 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox