LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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


Reply
  Search this Thread
Old 07-28-2009, 03:39 PM   #1
senthil100
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Rep: Reputation: 0
migrate an old kernel module (working in single core) to dual core - repost


--------------------------------------------------------------------------------

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.
 
  


Reply



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
kernel module migrate from single core to dual core senthil100 Programming 2 07-28-2009 03:59 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

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

All times are GMT -5. The time now is 11:41 PM.

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
Open Source Consulting | Domain Registration