LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 09-24-2007, 01:49 PM   #1
tryon16
LQ Newbie
 
Registered: Sep 2007
Posts: 3

Rep: Reputation: 0
Run all OS processes on one core in multicore processor


Hi,

On shared memory multiprocessors or multicores, is it possible to run all OS processes one core and application threads on the rest of the cores?
I'd like to have one core handle OS and control flow type of work and the others serve as workers(just like what IBM Cell does)
When worker cores have exceptions, I would like that exception to be passed to OS-running core and have it to take care of it.

I guess I can bound specific application threads to dedicated processors by using processor affinity. But was not sure if I could filter all other "non-application processes" or os-processes and bound them to one core.

I am thinking of modifying scheduler. There I expect to see all the processes/threads(regardless of it being OS or application). Before those processes are put into runqueue, I am hoping to set processor affinity to all the processes.

Do you think it makes sense? I will highly appreciate all your comments.

Thanks
 
Old 09-24-2007, 02:32 PM   #2
crashmeister
Senior Member
 
Registered: Feb 2002
Distribution: t2 - trying to anyway
Posts: 2,541

Rep: Reputation: 47
Something like that ?

I think there is something else with about the same goals out there but I don't remember where...
 
Old 09-26-2007, 10:54 PM   #3
jdiggitydogg
Member
 
Registered: Sep 2007
Posts: 42

Rep: Reputation: 15
[ deleted ]
I realized my posting wasn't helpful.

Last edited by jdiggitydogg; 09-26-2007 at 10:56 PM.
 
Old 09-26-2007, 11:21 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,109

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Quote:
Originally Posted by tryon16 View Post
Do you think it makes sense?
No.
The scheduler already attempts to re-dispatch on the same engine if possible to alleviate issues such as cache flush. I see no advantage in what you are attempting to do - but feel free to dive into the code; you may need some time and patience.

CKRM has effectively been supplanted by "containers" which I don't believe has reached the mainline yet. Has been to -mm, but updates caused it to drop out again. It may do some of what you want. Likewise cpusets, although this will suffer the same shortcoming you noted above for processor binding at the application level. Isolating your userspace to particular CPUs is likely to cause everything else to dispatch on the "other" CPU(s), but you can't guarantee it.
 
Old 09-27-2007, 10:00 AM   #5
TheDirtyScreech
Member
 
Registered: Jul 2007
Distribution: Gentoo, LFS
Posts: 42

Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
...
I see no advantage in what you are attempting to do - but feel free to dive into the code; you may need some time and patience.
...
He's looking to make a trade-off that gives up some CPU cycles to ensure that system processes aren't at all affected by any CPU-intense user process (encoding video, for example).

For an example, assume four CPUs. Under a normal OS with decent SMP support, when enough processes exist to eat 100% of CPU on all 4 CPUs, the system processes will be fighting with the userland processes for CPU time. This solution allows the use of all 400% (yes, I know it should be 100, but this better illustrates the situation for me) of CPU cycles to be used, so it is effecient in that it doesn't waste any CPU cycles.

The scenario tryon16 is looking for would allow the userland processes to eat up 300% of CPU cycles, while reserving the last CPU solely for system processes. In this way, the system processes aren't fighting for CPU cycles with the userland processes. This comes at the cost of not using all of your CPU cycles. Say that system processes only used 2% of a given processor's available cycles, then the max usage would be 302% compared to the 400% of the first scenario.

Obviously, the trade-off is guaranteeing CPU availability to system processes at the cost of inefficient CPU usage.

With all of that said, I would tend to agree that I don't think this would be useful. Even if you guarantee CPU availability to your system processes, as a user, you'll still be waiting on the userland processes. You won't be speeding things up, just slowing them down by offering less CPU for use. Furthermore, it takes a hell of a lot to get four cores to max out all CPU usage. Finally, when a userland process does something that requires system process (reading from disk, for example), it won't be using any CPU until it gets the information from the disk, thus kind of forcing the necessary system process(es) into the spotlight.

Just my two cents. I could be completely wrong.

As far as running like Cell does, that's a bit different than what I just described, but since there are a few Linux distros that run on PS3, it seems like it would be worthwhile to look at the architecture-specific code and clone that.

-TDS-
 
Old 09-27-2007, 11:50 PM   #6
tryon16
LQ Newbie
 
Registered: Sep 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you so much to all of you for sharing your thoughts with me.

I think I should have told you the reason why I am doing this.

I am working on "Error resilient" architecture. It is multicore and only one core is "over-designed" to guarantee to be reliable. The rest of the cores-the worker cores- are normal or "less-designed" such that reliability is not guranteed. Why am I doing this? Because it is a cheaper way to fabricate a chip(than to make all cores reliable) and it would be ok for certain area of applications that are "robust" in themselves.

Since worker cores are unreliable, I don't want to run OS-processes on them. It would be much more difficult to recover OS failure than the application failure. I want OS processes to run on "reliable" core only. This is why I want to sequester OS processes from worker cores.

*****************************************************************************

Do you think using processor affinity would not work? As I mentioned in the original posting, if I set affinities to all the process/threads before they are put into runqueue, would I achieve what I want?

I heard some people saying no. Then could you tell me in more detail.

Thank you very very much.
 
Old 10-02-2007, 05:13 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,109

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Quote:
Originally Posted by tryon16 View Post
I think I should have told you the reason why I am doing this.
Yes, maybe you should have.
My response was based on thinking you were planning on doing this on a "normal" multi-{core|cpu} machine. Not worth the effort for the average man in the street.
In your case, where you are probably already knee deep in kernel code, seems a reasonable option. Maybe setting "cpus_allowed" prior to dropping the task_struct on the runqueue might be one place to think about.
 
  


Reply


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
Kernel Panic on Intel Core 2 Duo E6700 Dual Core Processor nwongrat Linux - Hardware 2 01-08-2008 10:13 PM
A lot of processes run automatically when I run a single process. dalvirgautam Linux - Enterprise 4 12-01-2006 06:10 PM
LXer: ARM MPCore Multicore Processor Enables Next-Generation Triple-Play Gateway to the Home LXer Syndicated Linux News 0 10-23-2006 05:54 PM
Controling which processes can run exnt Linux - Security 2 09-13-2006 01:52 PM
dual processor system=more running processes? plisken Linux - Hardware 0 12-09-2004 03:48 PM


All times are GMT -5. The time now is 05:29 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration