- uml-timer-cleanups.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     uml: timer cleanups

has been removed from the -mm tree.  Its filename is

     uml-timer-cleanups.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: uml: timer cleanups
From: Jeff Dike <jdike@xxxxxxxxxxx>

set_interval returns an error instead of panicing if setitimer fails.  Some of
its callers now check the return.

enable_timer is largely tt-mode-specific, so it is marked as such, and the
only skas-mode caller is made to call set-interval instead.

user_time_init was a no-value-added wrapper around set_interval, so it is
gone.

Since set_interval is now called from kernel code, callers no longer pass
ITIMER_* to it.  Instead, they pass a flag which is converted into ITIMER_REAL
or ITIMER_VIRTUAL.

Signed-off-by: Jeff Dike <jdike@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/um/include/os.h            |    4 +++-
 arch/um/kernel/time.c           |    7 +++++--
 arch/um/os-Linux/skas/process.c |    6 +++++-
 arch/um/os-Linux/time.c         |   18 +++++++++---------
 4 files changed, 22 insertions(+), 13 deletions(-)

diff -puN arch/um/include/os.h~uml-timer-cleanups arch/um/include/os.h
--- a/arch/um/include/os.h~uml-timer-cleanups
+++ a/arch/um/include/os.h
@@ -276,9 +276,11 @@ extern int setjmp_wrapper(void (*proc)(v
 
 extern void switch_timers(int to_real);
 extern void idle_sleep(int secs);
+extern int set_interval(int is_virtual);
+#ifdef CONFIG_MODE_TT
 extern void enable_timer(void);
+#endif
 extern void disable_timer(void);
-extern void user_time_init(void);
 extern void uml_idle_timer(void);
 extern unsigned long long os_nsecs(void);
 
diff -puN arch/um/kernel/time.c~uml-timer-cleanups arch/um/kernel/time.c
--- a/arch/um/kernel/time.c~uml-timer-cleanups
+++ a/arch/um/kernel/time.c
@@ -113,12 +113,15 @@ static void register_timer(void)
 
 	err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL);
 	if(err != 0)
-		printk(KERN_ERR "timer_init : request_irq failed - "
+		printk(KERN_ERR "register_timer : request_irq failed - "
 		       "errno = %d\n", -err);
 
 	timer_irq_inited = 1;
 
-	user_time_init();
+	err = set_interval(1);
+	if(err != 0)
+		printk(KERN_ERR "register_timer : set_interval failed - "
+		       "errno = %d\n", -err);
 }
 
 extern void (*late_time_init)(void);
diff -puN arch/um/os-Linux/skas/process.c~uml-timer-cleanups arch/um/os-Linux/skas/process.c
--- a/arch/um/os-Linux/skas/process.c~uml-timer-cleanups
+++ a/arch/um/os-Linux/skas/process.c
@@ -155,11 +155,15 @@ extern int __syscall_stub_start;
 static int userspace_tramp(void *stack)
 {
 	void *addr;
+	int err;
 
 	ptrace(PTRACE_TRACEME, 0, 0, 0);
 
 	init_new_thread_signals();
-	enable_timer();
+	err = set_interval(1);
+	if(err)
+		panic("userspace_tramp - setting timer failed, errno = %d\n",
+		      err);
 
 	if(!proc_mm){
 		/* This has a pte, but it can't be mapped in with the usual
diff -puN arch/um/os-Linux/time.c~uml-timer-cleanups arch/um/os-Linux/time.c
--- a/arch/um/os-Linux/time.c~uml-timer-cleanups
+++ a/arch/um/os-Linux/time.c
@@ -17,20 +17,25 @@
 #include "kern_constants.h"
 #include "os.h"
 
-static void set_interval(int timer_type)
+int set_interval(int is_virtual)
 {
 	int usec = 1000000/hz();
+	int timer_type = is_virtual ? ITIMER_VIRTUAL : ITIMER_REAL;
 	struct itimerval interval = ((struct itimerval) { { 0, usec },
 							  { 0, usec } });
 
 	if(setitimer(timer_type, &interval, NULL) == -1)
-		panic("setitimer failed - errno = %d\n", errno);
+		return -errno;
+
+	return 0;
 }
 
+#ifdef CONFIG_MODE_TT
 void enable_timer(void)
 {
-	set_interval(ITIMER_VIRTUAL);
+	set_interval(1);
 }
+#endif
 
 void disable_timer(void)
 {
@@ -74,7 +79,7 @@ void uml_idle_timer(void)
 
 	set_handler(SIGALRM, (__sighandler_t) alarm_handler,
 		    SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
-	set_interval(ITIMER_REAL);
+	set_interval(0);
 }
 #endif
 
@@ -94,8 +99,3 @@ void idle_sleep(int secs)
 	ts.tv_nsec = 0;
 	nanosleep(&ts, NULL);
 }
-
-void user_time_init(void)
-{
-	set_interval(ITIMER_VIRTUAL);
-}
_

Patches currently in -mm which might be from jdike@xxxxxxxxxxx are

origin.patch
uml-use-mcmodel=kernel-for-x86_64.patch
uml-fix-proc-vs-interrupt-context-spinlock-deadlock.patch
uml-const-more-data.patch
uml-get-rid-of-zone_dma-use.patch
uml-fix-missing-x86_64-register-definitions.patch
uml-fix-gcov-support.patch
uml-use-correct-sigbus-handler.patch
uml-add-checkstack-support.patch
uml-mark-some-tt-mode-code.patch
uml-thread-creation-tidying.patch
uml-file-renaming.patch
uml-add-an-export.patch
uml-fix-sleep-length-bug.patch
uml-fix-allocation-size.patch
uml-remove-pte_mkexec.patch
simplify-update_times-avoid-jiffies-jiffies_64-aliasing-problem-2.patch
kill-wall_jiffies.patch
const-struct-tty_operations.patch
namespaces-utsname-switch-to-using-uts-namespaces.patch
introduce-kernel_execve.patch
rename-the-provided-execve-functions-to-kernel_execve.patch
provide-kernel_execve-on-all-architectures.patch
provide-kernel_execve-on-all-architectures-fix.patch
remove-the-use-of-_syscallx-macros-in-uml.patch
sh64-remove-the-use-of-kernel-syscalls.patch
remove-remaining-errno-and-__kernel_syscalls__-references.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux