Is a single core process reassigned to some other core automatically when the core utilization is high in linux?

0

1

Generally, by default, if a single core process starts to have high core utilization, will it be reassigned to some other core which can handle and unless it is exclusively defined not to with in the script?

And how does soft and hard affinity fit here?

Thanks!

EDIT: what I meant was if a core has already too may tasks to perform and its cpu utilization is high, will it give it's task to some other core who has no tasks to do?

GP92

Posted 2015-11-02T14:00:06.830

Reputation: 453

What would be the point of moving it to a different core? Are you imagining a system were some cores are faster than others? – David Schwartz – 2015-11-02T14:04:56.487

@DavidSchwartz No, what I meant was if a core has already too may tasks to perform and its cpu utilization is high, will it give it's task to some other core who has no tasks to do? Can you explain it to me in summary, how the tasks are assigned to a core? – GP92 – 2015-11-02T14:08:54.170

1Processes/threads can jump from core to core whenever the scheduler so chooses. There are many scheduler implementations, so this might be too broad to answer. – Sami Kuhmonen – 2015-11-02T14:15:26.210

@DavidSchwartz I realize that a cpu utilization is based on how much time it takes for the core to perform a task. The reason for having my question is there is one question by user - "we have an application which supports only single core and it takes high cpu usage 100% and so, it slows down. And as ours is multi user application, at the same time, if some other user opens the same application, is it possible if it is assigned to same core and will it affect the performance?" So, I am trying to understand to answer that question from user. – GP92 – 2015-11-02T14:15:38.253

Answers

2

Basically, you're asking if the scheduler is stupid or sensible. The scheduler is sensible. It constantly moves tasks from core to core as needed to keep as many cores busy as it can and honor the priority settings.

David Schwartz

Posted 2015-11-02T14:00:06.830

Reputation: 58 310

If I can add a question in this same post - so, soft affinity controls how frequently the task keeps jumping right?? – GP92 – 2015-11-02T14:33:00.237

@JeevanPatnaik "Soft affinity" usually just means that a scheduler will, all other things being equal, schedule a task back on the same core it last ran on. – David Schwartz – 2015-11-02T14:35:34.497