migrate an old kernel module (working in single core) to dual core - repost
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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 (¶m);".
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.
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?