You are not logged in.

#1 2011-04-18 00:26:58

darkfoon
Member
Registered: 2007-08-29
Posts: 42

Odd scheduling behavior with Folding@Home [Mystery solved]

I have F@H set use 100% CPU and to run at the idle priority. When I check `top` it shows that the F@H process has a nice value of 19, and its priority is 39, and when no other applications are running, it takes up ~99% CPU.
In the past, this meant that whenever any other process on my system (usually with nice value of 0, or negative) that F@H would use up whatever remaining percentage of processor was left. For example, when I would run something that used 100% CPU, F@H would not run at all.

Now what happens, in the scenario where another process uses 100% CPU , F@H doesn't go idle until that other process is finished. Instead, F@H goes down to ~50% CPU and the other process, at a higher priority, only gets ~50% CPU.  When I kill the F@H process, the other process goes up to ~100% CPU.  This happens regardless of what the other process is. I tested this using bzip2 and srcds server running navigation generation.

The only things that have changed between how things used to be and how they are now are the kernel and srcds. Bzip2 hasn't been updated since then and neither has F@H (nor has the config changed in this time span either)

What it looks like to me is that the task scheduler, in order to prevent lowest-priority processes from never getting scheduled due to higher-priority processes taking precedence, is guaranteeing that the lowest priority task gets some CPU time.

My question is, has there been a change in the way the kernel scheduler works? Or is there an option that has changed in the Arch kernel26 package?

Thank you.

Last edited by darkfoon (2011-04-19 08:36:25)

Offline

#2 2011-04-18 00:28:36

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Odd scheduling behavior with Folding@Home [Mystery solved]


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2011-04-18 00:30:35

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

While I'm a happy user of the BFS patch in particular, you're not really answering his question....


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2011-04-18 00:34:05

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

touché


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2011-04-18 05:00:47

darkfoon
Member
Registered: 2007-08-29
Posts: 42

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

Thank you for the link to the kernel26-ck repos.
However, the Con Kolivas patches enhance responsiveness in desktop scenarios, and this isn't really a "desktop application" situation, as my Arch box is a home server. It runs without X and without monitor or keyboard mostly.
So I am not certain that kernel would solve this particular problem.

Maybe this thread belongs in the Kernel board (since my question is specifically about any possible changes in the kernel scheduler in the last 3 months)?

Offline

#6 2011-04-18 12:15:05

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

I think that can be caused by the "miracle" patch that is supposed to improve responsiveness. If I'm not wrong it should assign each process or groups of processes to individual cgroups and cpu time is split between cgroups and not processes. Then within each cgroup cpu time is split according to nice values. At least it's what I understood that patch would do.

See this http://www.phoronix.com/scan.php?page=a … ideo&num=1


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#7 2011-04-18 15:25:54

heftig
Developer
From: Germany
Registered: 2010-04-19
Posts: 159

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

Set F@H to be in the SCHED_IDLE scheduling class. You can do that using chrt.

Offline

#8 2011-04-18 22:05:58

darkfoon
Member
Registered: 2007-08-29
Posts: 42

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

R00KIE, that does appear to be what is going on.
Do you know of a way alter cgroups? Perhaps it would be simpler if I could just group together the competing processes.

I take it this is the default behavior for the kernel in the kernel26 package? So to change the scheduler I'll have to recompile from sources. Or is there an option where I can change the scheduler on a running system (via sysfs)?

heftig, I tried you suggestion, however when F@H is the only process running, it's in the SCHED_IDLE class, and when I run something else to use 100% CPU, it's scheduling class is SCHED_OTHER and refuses to change to SCHED_IDLE.

Offline

#9 2011-04-19 08:35:57

darkfoon
Member
Registered: 2007-08-29
Posts: 42

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

I found the sysctl interface and disabled the new scheduling.

From all the reading I did on the topic, thanks for the link R00KIE, I must have updated just before the 2.6.38 kernel went out on Arch. So this was quite a surprise to me when I update and suddenly F@H is preventing my other processes from getting all their resources.

Thank you all for the help!

Offline

#10 2011-04-19 09:09:16

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

R00KIE wrote:

I think that can be caused by the "miracle" patch that is supposed to improve responsiveness. If I'm not wrong it should assign each process or groups of processes to individual cgroups and cpu time is split between cgroups and not processes. Then within each cgroup cpu time is split according to nice values. At least it's what I understood that patch would do.

See this http://www.phoronix.com/scan.php?page=a … ideo&num=1

Very good catch, I'd read about that but couldn't make the connection.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#11 2011-04-19 12:26:10

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

ngoonee wrote:
R00KIE wrote:

I think that can be caused by the "miracle" patch that is supposed to improve responsiveness. If I'm not wrong it should assign each process or groups of processes to individual cgroups and cpu time is split between cgroups and not processes. Then within each cgroup cpu time is split according to nice values. At least it's what I understood that patch would do.

See this http://www.phoronix.com/scan.php?page=a … ideo&num=1

Very good catch, I'd read about that but couldn't make the connection.

Thanks smile
What I can't seem to find is any utility to manage cgroups, not that I have a big need for it but at least would be nice to play with it and learn for when I need it.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#12 2011-04-19 14:57:59

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

R00KIE wrote:

manage cgroups

Try ulatencyd.

Offline

#13 2011-04-19 19:37:27

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Odd scheduling behavior with Folding@Home [Mystery solved]

brebs wrote:

Thanks, I'll take a look at it and hopefuly learn something smile


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB