Re: [vserver] Assigning whole CPUs to contexts

From: Daniel Hokka Zakrisson <daniel_at_hozac.com>
Date: Wed 23 Apr 2008 - 17:23:31 BST
Message-ID: <46786.192.168.101.12.1208967811.squirrel@intranet>

Jiri Denemark wrote:
> Hello,
>
> 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.

If this is what you want, using the scheduler parameters is just
unnecessary overhead. Setup cpusets instead, e.g.:
echo 0 > /etc/vservers/<guest0>/cpuset/cpus
echo 0 > /etc/vservers/<guest0>/cpuset/mems
echo cpu0 > /etc/vservers/<guest0>/cpuset/name
echo 1 > /etc/vservers/<guest1>/cpuset/cpus
echo 0 > /etc/vservers/<guest1>/cpuset/mems
echo cpu1 > /etc/vservers/<guest1>/cpuset/name

Note that mems for guest1 might be different - it depends on whether your
system is NUMA or not.

This also assumes that you have /dev/cpuset mounted.

-- 
Daniel Hokka Zakrisson
Received on Wed Apr 23 22:38:27 2008
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 23 Apr 2008 - 22:38:33 BST by hypermail 2.1.8