LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 07-24-2009, 05:50 PM   #1
senthil100
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Rep: Reputation: 0
kernel module migrate from single core to dual core


Hi,
I have a kernel module code that is working fine in an old single core intel PC with linux kernel 2.4.20-8 (RedHat9). Now, i have got a new PC which has got two processors ( I guess).
=======
# cat cpuinfo
processor : 0, vendor_id : GenuineIntel, model name: Intel(R) Pentium(R) 4 CPU 3.00GHz
processor : 1, vendor_id: GenuineIntel, model name: Intel(R) Pentium(R) 4 CPU 3.00GHz
========
I compiled my kernel module and inserted it using insmod.
I getting a kernel panic, which was not happening when I run my code in the old PC.
My kernel module does the following.
==================
Starts with module_init ()
As part of initialization, it does "dev_add_pack (&param);".
Whenever a packet is received, it results in calling "my_call_back_1".
my_call_back_1 constructs a ring buffer and calls "schedule_task (&q);".
When the scheduler schedules my_call_back_2 function, it takes care of processing the packet.
==================

When I send certain traffic to the "eth0", the kernel panic happens.
I see the backtrace as follows, where I see MULTIPLE context_thread.

Jul 24 10:37:35 localhost kernel: [<c01342a9>] context_thread [kernel] 0x149 (0xf7fc7f9c))
Jul 24 10:37:35 localhost kernel: [<c0134160>] context_thread [kernel] 0x0 (0xf7fc7fc4))
Jul 24 10:37:35 localhost kernel: [<c0134160>] context_thread [kernel] 0x0 (0xf7fc7fe0))
Jul 24 10:37:35 localhost kernel: [<c010759d>] kernel_thread_helper [kernel] 0x5 (0xf7fc7ff0))

Is this Jul 24 10:37:35 localhost kernel: [<c01342a9>] context_thread [kernel] 0x149 (0xf7fc7f9c))
Jul 24 10:37:35 localhost kernel: [<c0134160>] context_thread [kernel] 0x0 (0xf7fc7fc4))
Jul 24 10:37:35 localhost kernel: [<c0134160>] context_thread [kernel] 0x0 (0xf7fc7fe0))
Jul 24 10:37:35 localhost kernel: [<c010759d>] kernel_thread_helper [kernel] 0x5 (0xf7fc7ff0))

NOTE: Sometimes, I see "alloc_skb" in the callback trace, sometimes I see '__kfree_skb" in the callback trace and hence I am not sure whether both the processors are trying to access the same code.

I am not sure whether the issue is due to DUAL processor or dual core.
Any special care required w.r.t semaphores?
Are the interrupts from device is getting processed by both the processors simulatenously and resulting in race conditin?
Can anyone help me to resolve this issue?

regards,
Senthil.
 
Old 07-26-2009, 08:03 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Moved: This thread is more suitable in <Programming> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 07-28-2009, 03:59 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
On which core is Linux kernel running on Dual-core machine? kushalkoolwal Linux - Hardware 22 01-05-2009 02:33 PM
dual core and single core temperatures. justwantin Slackware 7 10-07-2008 04:45 AM
Kernel Panic on Intel Core 2 Duo E6700 Dual Core Processor nwongrat Linux - Hardware 2 01-08-2008 10:13 PM
single core to dual core matuk_444 SUSE / openSUSE 8 02-03-2007 02:50 PM
Dual processor vs. Dual core cs. single on home machine fincher69 Linux - Hardware 3 03-04-2005 12:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration