Bug 113182 - smp kernel hangs on dual processor system when fast printks are done
Summary: smp kernel hangs on dual processor system when fast printks are done
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-09 13:35 UTC by anand suvernkar
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-01-09 13:42:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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