patch-1.3.73 linux/arch/i386/kernel/process.c

Next file: linux/arch/i386/kernel/setup.c
Previous file: linux/arch/i386/kernel/irq.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.72/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
@@ -149,6 +149,20 @@
 	{
 		if(cpu_data[smp_processor_id()].hlt_works_ok && !hlt_counter && !need_resched)
 			__asm("hlt");
+                if(0==(0x7fffffff & smp_process_available)) 
+                	continue;
+                while(0x80000000 & smp_process_available);
+	        cli();
+                while(set_bit(31,&smp_process_available))
+                	while(test_bit(31,&smp_process_available));
+                if (0==(0x7fffffff & smp_process_available)){
+                        clear_bit(31,&smp_process_available);
+                        sti();
+                        continue;
+                }
+                smp_process_available--;
+                clear_bit(31,&smp_process_available);
+                sti();
 		idle();
 	}
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this