This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
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
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
:
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2004-01-09 08:42:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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 ?

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 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.
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.