lkml.org 
[lkml]   [2001]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] kernel/exit.c - 2.4.2 - small optimalisation (very small) to do_exit()
Date
Hi,

This very small patches re-orders 2 if-statements so that in the
most common case 1 less if-statement is executed, in the worst
case the same number of if-statements is executed (doesn't matter
though: it's would be the fault-situation anyway).

diff -ur --minimal linux-vanilla/kernel/exit.c linux-2.4.2/kernel/exit.c
--- linux-vanilla/kernel/exit.c Mon Mar 26 09:28:13 2001
+++ linux-2.4.2/kernel/exit.c Mon Mar 26 10:50:30 2001
@@ -425,10 +425,12 @@

if (in_interrupt())
panic("Aiee, killing interrupt handler!");
- if (!tsk->pid)
- panic("Attempted to kill the idle task!");
- if (tsk->pid == 1)
- panic("Attempted to kill init!");
+ if (tsk->pid <= 1) {
+ if (tsk->pid)
+ panic("Attempted to kill init!");
+ else
+ panic("Attempted to kill the idle task!");
+ }
tsk->flags |= PF_EXITING;
del_timer_sync(&tsk->real_timer);

Greetings,

Folkert van Heusden (folkert@vanheusden.com)
[ www.vanheusden.com ]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:17    [W:0.244 / U:0.640 seconds]
©2003-2014 Jasper Spaans. Advertise on this site