Bug 113182 - smp kernel hangs on dual processor system when fast printks are done
smp kernel hangs on dual processor system when fast printks are done
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2004-01-09 08:35 EST by anand suvernkar
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-01-09 08:42:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description anand suvernkar 2004-01-09 08:35:48 EST
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 ?


  Now, assuming that only one kernel thread can execute if I do
   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 ?

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
  write simplest module

2.and add the code I have mentioned above for verious problems in
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 08:42:33 EST
Hi I see it's you again ;)
Your code is buggy.
Comment 2 anand suvernkar 2004-01-09 08:51:35 EST
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.
  For the first case in which I put kernel thread in infinite loop on
a multiprocessor machine the code is
 int i,j,k;
 while (1);
 return 0;

2. For second case
 it is

extern unsigned int jiffies; 
 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.

Note You need to log in before you can comment on or make changes to this bug.