[vserver] Assigning whole CPUs to contexts

From: Jiri Denemark <jirka_at_ics.muni.cz>
Date: Wed 23 Apr 2008 - 16:58:11 BST
Message-ID: <20080423155811.GA30904@elg.home>


What is the best way of assigning whole CPUs to contexts? Simplified example:
2 contexts on 2-CPU machine, each context should be provided with a single
CPU. If only one context is running, it can still consume only one CPU, the
other one stays idle.

sched_hard flag is set for both contexts. tokens-min is 1 and tokens-max is
100 for all configurations.

Try 1: using fill-rate and interval I can assign 50% of total CPU power to
each of the contexts, e.g. fill-rate 5, interval 10. The problem is when just
a single process is running (I mean really consuming CPU) in the context, it
only gets 50% of a single CPU. Using idle-time works for this situation but
does not work for a single process in one context and two processes in the
other context. And what is even weirder, in this situation the process in the
first context gets 50% of a single CPU and each of the processes in the second
context gets only 25% of a single CPU. That is, half of the total CPU power is
idle. However, if two processes are running in each of the contexts, each of
them gets 50% of a single CPU and everything is working as expected.

Try 2: using per-CPU scheduling parameters. The first context is configured as
follows: CPU0: fill-rate 10, interval 10; CPU1: fill-rate 0, interval 10. That
is it should get full power of CPU0 and nothing else. The second context is
configured in a similar way, but it gets full CPU1 and no CPU0. This works
perfectly for a single running process in each context (or single process in
one context and no process in the other). However, strange things happen when
a second process is started in any of the contexts. It seems the kernel is
confused and tries to assign the second process to the second CPU, which
results in the process being blocked. Strangely enough, sometimes even the
first process gets blocked and the whole system is idle.

util-vserver: 0.30.213

Any hint how to tune the scheduler better to meet my requirements, what else
should I try or any other advice will be gratefully appreciated.


Being schizophrenic is better than living alone.
Received on Thu Apr 24 22:40:15 2008
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 24 Apr 2008 - 22:40:17 BST by hypermail 2.1.8