Bug 113182

Summary: smp kernel hangs on dual processor system when fast printks are done
Product: Red Hat Enterprise Linux 3 Reporter: anand suvernkar <suvernkar>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 3.0CC: petrides, riel
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-01-09 13:42:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description anand suvernkar 2004-01-09 13:35:48 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2)
Gecko/20030208 Netscape/7.02

Description of problem:

I have a set of related questions

1.  My machine is dual processor dell Machine. /proc/cpuinfo shows 2
processors.  So my understanding of smp kernel says that linux should
allow 2 kernel threads to run. So even if one gets caught into
infinite loop, scheduler shpuld be able to schedule other processes on
the other processor. 

  But it doesn't seem to happen if I write a simple module in the
module_init function of which I add a simple infinite loop.
  while (1).
  The machine gets hung. Even though it seems to accepts interrupts
generated by NIC i.e. even though I can ping to the machine, I cant
login neither can I any input from keyboard is accepted at the console.
 
   So should be other processes scheduled on other processor ?

2.

  Now, assuming that only one kernel thread can execute if I do
  
  current=jiffies
   while (jiffies - current < 100)
     printk(" ###############");

then again there occurs a hang for some time 100 millseconds and 
then the messages sudfdenly come,

And if I gve very large difference
 while (jiffies - current < 10000)
     printk(" ###############");

the machine gets hung permanently. It even doesnt show any message.
  Now I added a delay of 200 ms before printk just to check avoid some
stress on printk and even  then I faced same problem.

I think I am doing / assuming something very wrong 
Can someone explain this phenomenon to me ?
Thanks
Anand

Version-Release number of selected component (if applicable):
2.4.21-4.ELsmp

How reproducible:
Always

Steps to Reproduce:
1.
  write simplest module

2.and add the code I have mentioned above for verious problems in
module_init.
3.load the module
    

Actual Results:  system hung

Expected Results:  no hang and  messages on console

Additional info:

Comment 1 Arjan van de Ven 2004-01-09 13:42:33 UTC
Hi I see it's you again ;)
Your code is buggy.


Comment 2 anand suvernkar 2004-01-09 13:51:35 UTC
I am really sorry if I am missing something. 
  The problem I had mentioned earlier was different. This problem is 
might be a narrowed version of earlier problem.
 The code is actually onlye 10 lines.
1.
  For the first case in which I put kernel thread in infinite loop on
a multiprocessor machine the code is
module_init()
{
 int i,j,k;
 while (1);
 return 0;
}

2. For second case
 it is

extern unsigned int jiffies; 
 module_init()
{
 int i,j,k;

  unsigned int current=jiffies;
 while (jiffies - current < 10000)
     printk(" ###############");
 return 0;
}

Please let me know what is the bug in this code.