Thread (9 messages) 9 messages, 1 author, 2008-03-14

Re: [PATCH RT 0/6] lockstat measurement extensions

From: Bill Huey (hui) <hidden>
Date: 2008-03-14 00:40:27
Also in: lkml

Sorry missing the patch. At Thomas's urging, this is inlined:
--- linux-2.6.24/kernel/sched.c	2008-02-25 15:32:05.000000000 -0800
+++ linux-2.6.24.working/kernel/sched.c	2008-03-13 13:53:24.000000000 -0700
@@ -1175,6 +1175,20 @@
 	return cpu_curr(task_cpu(p)) == p;
 }

+int task_spinnable(struct task_struct *p)
+{
+/*
+ * The use of task_curr can crash the system since the struct
thread_info seems
+ * to disappear when dereferenced arbitrarily, so becareful.
+ */
+#ifdef CONFIG_SMP
+	if (p && p->se.on_rq && task_curr(p))
+		return 1;
+#else
+	return 0;
+#endif
+}
+
 /* Used instead of source_load when we know the type == 0 */
 unsigned long weighted_cpuload(const int cpu)
 {
@@ -1239,6 +1253,11 @@
 		      *new_cfsrq = cpu_cfs_rq(old_cfsrq, new_cpu);
 	u64 clock_offset;

+//--billh
+//	if (old_cpu >= NR_CPUS)
+//		panic("bogus cpu id %u\n", old_cpu);
+//
+//
 	clock_offset = old_rq->clock - new_rq->clock;

 #ifdef CONFIG_SCHEDSTATS
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help