patch-2.4.20 linux-2.4.20/kernel/timer.c

Next file: linux-2.4.20/lib/Config.in
Previous file: linux-2.4.20/kernel/time.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/kernel/timer.c linux-2.4.20/kernel/timer.c
@@ -601,7 +601,14 @@
 	if (p->pid) {
 		if (--p->counter <= 0) {
 			p->counter = 0;
-			p->need_resched = 1;
+			/*
+			 * SCHED_FIFO is priority preemption, so this is 
+			 * not the place to decide whether to reschedule a
+			 * SCHED_FIFO task or not - Bhavesh Davda
+			 */
+			if (p->policy != SCHED_FIFO) {
+				p->need_resched = 1;
+			}
 		}
 		if (p->nice > 0)
 			kstat.per_cpu_nice[cpu] += user_tick;
@@ -671,12 +678,14 @@
 	 * need to save/restore the flags of the local CPU here. -arca
 	 */
 	write_lock_irq(&xtime_lock);
+	vxtime_lock();
 
 	ticks = jiffies - wall_jiffies;
 	if (ticks) {
 		wall_jiffies += ticks;
 		update_wall_time(ticks);
 	}
+	vxtime_unlock();
 	write_unlock_irq(&xtime_lock);
 	calc_load(ticks);
 }
@@ -731,10 +740,18 @@
  * The Alpha uses getxpid, getxuid, and getxgid instead.  Maybe this
  * should be moved into arch/i386 instead?
  */
- 
+
+/**
+ * sys_getpid - return the thread group id of the current process
+ *
+ * Note, despite the name, this returns the tgid not the pid.  The tgid and
+ * the pid are identical unless CLONE_THREAD was specified on clone() in
+ * which case the tgid is the same in all threads of the same group.
+ *
+ * This is SMP safe as current->tgid does not change.
+ */
 asmlinkage long sys_getpid(void)
 {
-	/* This is SMP safe - current->pid doesn't change */
 	return current->tgid;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)