LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-28-2018, 02:45 AM   #1
Yuc
Member
 
Registered: Nov 2018
Posts: 38

Rep: Reputation: Disabled
Can anybody tell me some references on how the linux kernel works with a multi-core processor


Can anybody tell me some references on how the linux kernel works with a multi-core processor.

thank you.
 
Old 12-28-2018, 03:03 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,407

Rep: Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055
I would suggest you make some effort to research this yourself. Use your favourite search engine.
Then ask specific questions where you lack understanding.
 
Old 12-28-2018, 03:26 AM   #3
Yuc
Member
 
Registered: Nov 2018
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
I would suggest you make some effort to research this yourself. Use your favourite search engine.
Then ask specific questions where you lack understanding.
Sorry,I tried,but failed.

I searched the question using Baidu(the only engine I can use)
:how the linux decides which core to use when running a program in a mutli-core processor?

the results shows in the attachment.

none of them hits my question.
Attached Thumbnails
Click image for larger version

Name:	1228.PNG
Views:	8
Size:	52.1 KB
ID:	29324  

Last edited by Yuc; 12-28-2018 at 03:27 AM.
 
Old 12-28-2018, 04:05 AM   #4
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 3,977

Rep: Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111
Quote:
Originally Posted by Yuc View Post
)
:how the linux decides which core to use when running a program in a mutli-core processor?
This is a much more specific question than your title “how the linux kernel works with a multi-core processor”.

As far as I know, the kernel doesn’t distinguish between CPUs and CPU cores when it comes to scheduling processes. Check out the Completely Fair Scheduler, which is the algorithm used these days. There is also a section in the kernel documentation, but I don’t know how up to date it is.

Note that CPU scheduling is probably different on a NUMA system, where it’s important that a process uses memory that is “close to” its CPUs. Also, users can affect the scheduling algorithm with affinity.
 
1 members found this post helpful.
Old 12-28-2018, 04:08 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,407

Rep: Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055Reputation: 3055
Quote:
Originally Posted by Yuc View Post
I searched the question using Baidu(the only engine I can use)
Hmmm - this could be awkward; maybe even links we supply will be blocked to you.
A quick search of "linux process scheduler" returned this - might be a start.

The scheduler is one of the more complex subsystems of the kernel.
 
1 members found this post helpful.
Old 12-28-2018, 10:05 AM   #6
Yuc
Member
 
Registered: Nov 2018
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
This is a much more specific question than your title “how the linux kernel works with a multi-core processor”.

As far as I know, the kernel doesn’t distinguish between CPUs and CPU cores when it comes to scheduling processes. Check out the Completely Fair Scheduler, which is the algorithm used these days. There is also a section in the kernel documentation, but I don’t know how up to date it is.

Note that CPU scheduling is probably different on a NUMA system, where it’s important that a process uses memory that is “close to” its CPUs. Also, users can affect the scheduling algorithm with affinity.
Actually,I was confused on how the program was excuted in the multi-core processor,let's say a cpu has two cores A and B, whether there will be a case that the program was excuted in core A and then it was suspended by the scheduler and next time the scheduler resume it but give it to core B?

Ah...!!!,I was seriously messed by such questions.
 
Old 12-28-2018, 10:15 AM   #7
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 3,247

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Look at the documentation for taskset.
 
Old 12-28-2018, 08:06 PM   #8
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 3,977

Rep: Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111
Quote:
Originally Posted by Yuc View Post
Actually,I was confused on how the program was excuted in the multi-core processor,let's say a cpu has two cores A and B, whether there will be a case that the program was excuted in core A and then it was suspended by the scheduler and next time the scheduler resume it but give it to core B?
Usually processes are not tied to CPUs. They can be suspended, then rescheduled on a different CPU. This behaviour can be controlled by the user, with a concept named affinity, and I guess (but don't know) that the kernel also takes NUMA into account.
 
Old 12-29-2018, 12:55 AM   #9
Yuc
Member
 
Registered: Nov 2018
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Hmmm - this could be awkward; maybe even links we supply will be blocked to you.
A quick search of "linux process scheduler" returned this - might be a start.

The scheduler is one of the more complex subsystems of the kernel.
Thank you for your help.I found a post which is reposted by somebody that answerd my question well.I'd like to share it with you but unfortunately it was written in Chinese, here is the url:https://blog.csdn.net/dake_160413/ar...tails/79409758

The original maybe in English,I had emailed the author of the original to offer the origial url. As long as it was in English I will notice you.
 
Old 12-29-2018, 12:57 AM   #10
Yuc
Member
 
Registered: Nov 2018
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
Usually processes are not tied to CPUs. They can be suspended, then rescheduled on a different CPU. This behaviour can be controlled by the user, with a concept named affinity, and I guess (but don't know) that the kernel also takes NUMA into account.
Thank you for your help.I found a post which is reposted by somebody that answerd my question well.I'd like to share it with you but unfortunately it was written in Chinese, here is the url:https://blog.csdn.net/dake_160413/ar...tails/79409758

The original maybe in English,I had emailed the author of the original to offer the origial url. As long as it was in English I will notice you.
 
Old 12-29-2018, 12:58 AM   #11
Yuc
Member
 
Registered: Nov 2018
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
Look at the documentation for taskset.
OK,I will try,thank you.
 
Old 12-29-2018, 02:34 AM   #12
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 3,977

Rep: Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111
Quote:
Originally Posted by Yuc View Post
Thank you for your help.I found a post which is reposted by somebody that answerd my question well.I'd like to share it with you but unfortunately it was written in Chinese, here is the url:https://blog.csdn.net/dake_160413/ar...tails/79409758

The original maybe in English,I had emailed the author of the original to offer the origial url. As long as it was in English I will notice you.
The correct URL is http://blog.sina.com.cn/s/blog_a57410a8010172w7.html.

I translated it like this: https://translate.google.com/transla...8010172w7.html.
 
Old 12-29-2018, 02:56 AM   #13
Yuc
Member
 
Registered: Nov 2018
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
And this one too. URL:https://www.ibm.com/developerworks/c...dom/index.html

By the way,do you have a twitter,facebook or wechat? If you wouldn't mind I'd like to friend with you.I feel great to talk with you on such questions.

Last edited by Yuc; 12-29-2018 at 06:18 AM.
 
Old 12-29-2018, 06:29 AM   #14
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 3,977

Rep: Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111Reputation: 1111
Quote:
Originally Posted by Yuc View Post
And this one too. URL:https://www.ibm.com/developerworks/c...dom/index.html

By the way,do you have a twitter,facebook or wechat? If you wouldn't mind I'd like to friend with you.I feel great to talk with you on such questions.
I feel flattered. I sent you a Linuxquestions email.
 
  


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
best practice Multihead, multi-screen, multi-display or multi-monitor-Debian 8 lgtrean Linux - Software 1 10-14-2015 10:53 AM
[SOLVED] what's the difference between a multi-cpu , multi-core and a multi-thread system ? entz Linux - Hardware 11 12-20-2011 05:49 PM
Pls tell me which version is correct for Quad core processor Ashfaque_21 Linux - General 2 06-10-2008 03:00 AM
how can two process can be scheduled in two different processor in multi processor ? bishalpoudyal Programming 4 08-31-2006 03:22 PM
can anybody tell me some forums for learning c? bluebean Programming 2 01-11-2005 02:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:07 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