dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0139-Reduce-timer-event-frequency-by-10.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Mark Salter <msalter@redhat.com>
f725e3
Date: Thu, 20 Feb 2014 12:54:52 -0500
f725e3
Subject: [PATCH] Reduce timer event frequency by 10
f725e3
f725e3
Timer event to keep grub msec counter was running at 1000HZ. This was too
f725e3
fast for UEFI timer driver and resulted in a 10x slowdown in grub time
f725e3
versus wallclock. Reduce the timer event frequency and increase tick
f725e3
increment accordingly to keep better time.
f725e3
f725e3
Signed-off-by: Mark Salter <msalter@redhat.com>
f725e3
---
f725e3
 grub-core/kern/arm/efi/init.c | 4 ++--
f725e3
 1 file changed, 2 insertions(+), 2 deletions(-)
f725e3
f725e3
diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c
f725e3
index a6ae03475cc..0c17d8390fa 100644
f725e3
--- a/grub-core/kern/arm/efi/init.c
f725e3
+++ b/grub-core/kern/arm/efi/init.c
f725e3
@@ -38,7 +38,7 @@ static void
f725e3
 increment_timer (grub_efi_event_t event __attribute__ ((unused)),
f725e3
 		 void *context __attribute__ ((unused)))
f725e3
 {
f725e3
-  tmr++;
f725e3
+  tmr += 10;
f725e3
 }
f725e3
 
f725e3
 void
f725e3
@@ -52,7 +52,7 @@ grub_machine_init (void)
f725e3
 
f725e3
   efi_call_5 (b->create_event, GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL,
f725e3
 	      GRUB_EFI_TPL_CALLBACK, increment_timer, NULL, &tmr_evt);
f725e3
-  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 10000);
f725e3
+  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 100000);
f725e3
 
f725e3
   grub_install_get_time_ms (grub_efi_get_time_ms);
f725e3
 }