<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Balbir</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Balbir"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Balbir"/>
	<updated>2026-06-13T16:32:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Containers/Mini-summit_2008&amp;diff=6220</id>
		<title>Containers/Mini-summit 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Containers/Mini-summit_2008&amp;diff=6220"/>
		<updated>2008-07-22T10:46:31Z</updated>

		<summary type="html">&lt;p&gt;Balbir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There will be a containers mini-summit at the [http://www.linuxsymposium.org/2008/ OLS'08]. This page is for organizing this mini-summit. Feel free to edit.&lt;br /&gt;
&lt;br /&gt;
'''When''': 22nd of July 2008, 8:30-16:30&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Where''': Ottawa, ON, Canada, Novotel Hotel (Albion A).&lt;br /&gt;
&lt;br /&gt;
== Proposal ==&lt;br /&gt;
&lt;br /&gt;
The mini-summit proposal sent to OLS organizers. '''See [[/Proposal|proposal]]'''.&lt;br /&gt;
&lt;br /&gt;
== Topics to discuss ==&lt;br /&gt;
&lt;br /&gt;
* Device accessibility cgroup (maybe with remap ability)&lt;br /&gt;
* TTYs&lt;br /&gt;
* Syslog&lt;br /&gt;
* Checkpoint/restart&lt;br /&gt;
* Memory controllers&lt;br /&gt;
* more?..&lt;br /&gt;
&lt;br /&gt;
== List of attendees ==&lt;br /&gt;
Please fill in your name here if you are going to attend, or email kir at openvz dot org if you are too lazy. Surely the list is not final, so put your name even if you are not sure you can make it.&lt;br /&gt;
&lt;br /&gt;
This list is in no particular order.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Put this in three columns if browser is smart enough --&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;-moz-column-count:3; -webkit-column-count:3; column-count:3; text-align: left; background: #fefef0; border: 1px solid #ddddc0;&amp;quot;&amp;gt;&lt;br /&gt;
# Pavel Emelyanov&lt;br /&gt;
# Denis Lunev&lt;br /&gt;
# Andrey Mirkin&lt;br /&gt;
# Serge Hallyn&lt;br /&gt;
# Dave Hansen&lt;br /&gt;
# Daniel Lezcano&lt;br /&gt;
# Srivatsa Vaddagiri&lt;br /&gt;
# Balbir Singh&lt;br /&gt;
# Sukadev Bhattiprolu&lt;br /&gt;
# Paul Menage&lt;br /&gt;
# Eric W. Biederman&lt;br /&gt;
# Oren Laadan&lt;br /&gt;
# Yamamoto Takashi&lt;br /&gt;
# Kamezawa Hiroyuki&lt;br /&gt;
# Benjamin Thery&lt;br /&gt;
# Herbert Pötzl&lt;br /&gt;
# Oleg Nesterov&lt;br /&gt;
# Dhaval Giani&lt;br /&gt;
# Bart Trojanowski&lt;br /&gt;
# Joseph Ruscio&lt;br /&gt;
# Constant Chan&lt;br /&gt;
# Linda Knippers&lt;br /&gt;
# Satoshi Uchida&lt;br /&gt;
# Masahiko Takahashi&lt;br /&gt;
# Martine Silbermann&lt;br /&gt;
# Benoit des Ligneris&lt;br /&gt;
# Patrick Naubert&lt;br /&gt;
# Daisuke Nishimura&lt;br /&gt;
# Sudhir Kumar&lt;br /&gt;
# Munehiro Ikeda&lt;br /&gt;
# Kamalesh Babulal&lt;br /&gt;
# John Schulz&lt;br /&gt;
# Poornima Nayak&lt;br /&gt;
# Gyuil Cha&lt;br /&gt;
# YoungHo Kim&lt;br /&gt;
# Rob Woolley&lt;br /&gt;
# Daniel Robbins&lt;br /&gt;
# Jason Baron&lt;br /&gt;
# Subrata Modak&lt;br /&gt;
# Veerendra C&lt;br /&gt;
# Joe MacDonald&lt;br /&gt;
# Andrew Theurer&lt;br /&gt;
# Myron Stowe&lt;br /&gt;
# Peter Teoh&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Agenda ==&lt;br /&gt;
&lt;br /&gt;
* Namespaces/Containers  (8:30am-11am)&lt;br /&gt;
** sysfs issues (and any /proc issues)&lt;br /&gt;
*** uevents/hotplug&lt;br /&gt;
** Network namespaces issues&lt;br /&gt;
*** multiple namespaces in one process&lt;br /&gt;
** Device namespace design?&lt;br /&gt;
** User namespace&lt;br /&gt;
** Additional needed namespaces&lt;br /&gt;
*** Small namespaces ''What to do with small subsystem that might need virtualization. E.g. in openvz we have FUSE, binfmt_misc and some other small stuff virtualized. But how to merge it in mainline? Create a separate namespace for each? Mere them into one? How to call this then?''&lt;br /&gt;
** Handling filesystem/namespace synchronization  (not sure what the issue is)&lt;br /&gt;
** Container design&lt;br /&gt;
*** How to enter a container&lt;br /&gt;
*** Nature of a 'container' — kernel object or userspace fiction&lt;br /&gt;
&lt;br /&gt;
* Cgroups+Resource management  (11:30-2pm)&lt;br /&gt;
** Cgroup implementation&lt;br /&gt;
*** Locking (don't let cgroup_lock() become the BKL)&lt;br /&gt;
*** Transactional attachment&lt;br /&gt;
*** &amp;quot;procs&amp;quot; file&lt;br /&gt;
*** User-space notification API&lt;br /&gt;
**** Resource counter hit soft/hard limit&lt;br /&gt;
**** Task entered/left cgroup&lt;br /&gt;
**** OOM occurred&lt;br /&gt;
*** Binary statistics API&lt;br /&gt;
** Existing cgroups&lt;br /&gt;
*** Memory (Balbir's NOTE: I would prefer to take some of this discussion to my memory controller BoF on Wednesday. Lets discuss this at the end)&lt;br /&gt;
**** Supporting over-commit and guarantees&lt;br /&gt;
**** Soft-limits&lt;br /&gt;
**** Hierarchical borrowing - in kernel or userspace?&lt;br /&gt;
**** Per-cgroup refault information?&lt;br /&gt;
*** Kernel memory&lt;br /&gt;
*** Device&lt;br /&gt;
*** Memrlimit&lt;br /&gt;
**** Some push-back over this - can we give real use cases?&lt;br /&gt;
*** CPU scheduler&lt;br /&gt;
** Additional cgroups and their design&lt;br /&gt;
*** Swap (separate subsystem or merge with memory?)&lt;br /&gt;
*** Disk I/O (several proposed designs)&lt;br /&gt;
*** Network traffic classification&lt;br /&gt;
*** Freezer&lt;br /&gt;
*** Signaller&lt;br /&gt;
*** OOM Handler&lt;br /&gt;
** libcg - userspace explotation of control groups/resource management&lt;br /&gt;
*** Overview so far&lt;br /&gt;
*** Is kernel-based reclassification needed?&lt;br /&gt;
*** Real use-cases&lt;br /&gt;
*** Future directions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Checkpoint/Restart  (2:30pm-5pm)&lt;br /&gt;
** Documentation : Look at &amp;quot;See Also&amp;quot; section below&lt;br /&gt;
** Goals and expectations of this summit&lt;br /&gt;
*** identify, discuss and (if possible) agree on the general design&lt;br /&gt;
*** identify, discuss and (if possible) agree on the technical points&lt;br /&gt;
*** decide on priorities for different components (eg. high, medium, low)  such that the final outcome is a practical road-map that would keep us busy for (at least) until the next OLS (though the &amp;quot;O&amp;quot; may change ;)&lt;br /&gt;
** What are the problems that the linux community can solve with the checkpoint/restart ?&lt;br /&gt;
** Preparing the kernel internals&lt;br /&gt;
*** How we implement it without affecting long term maintainability ?&lt;br /&gt;
*** What are the kernel subsystems, process resources and framework for CR ?&lt;br /&gt;
*** Which pieces to target first ?&lt;br /&gt;
&lt;br /&gt;
The following technical points can be discussed during the mini-summit if we have time or later at the OLS.&lt;br /&gt;
&lt;br /&gt;
** Checkpointing / Restarting&lt;br /&gt;
*** Reaching a quescient point - network, processes, aio, avoiding side effects of quiesce/revive&lt;br /&gt;
*** Checkpoint - signal handler ? syscall ? crfs ? process hierarchy, resource dependencies, system and process resources&lt;br /&gt;
*** Restarting - New binary format handler ? converting between formats (from older kernel to newer)&lt;br /&gt;
*** Notification to processes which explicitly wish to be notified about quiesce, checkpoint and restart - container state ? new signals ?&lt;br /&gt;
** Determining the userspace API - Posix 1003.1m ?&lt;br /&gt;
** Passing the kernel internal state to/from userspace - coredump like file ? swap per container ? netlinks, CR filesystem ? army of different call for the CR (proc, existing syscalls, ...)&lt;br /&gt;
** Hopefully we can continue to discuss in the next days and get a bit of a hackfest going during OLS :)&lt;br /&gt;
&lt;br /&gt;
== Moderators ==&lt;br /&gt;
&lt;br /&gt;
* Namespaces/containers: Serge Hallyn, Dave Hansen&lt;br /&gt;
* Cgroups and resource management: Paul Menage, Balbir Singh, Dhaval Giani&lt;br /&gt;
* Checkpoint/restart: Daniel Lezcano, Oren Laadan&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* http://www.linuxsymposium.org/2008/cfp.php — OLS call for papers&lt;br /&gt;
* https://lists.linux-foundation.org/pipermail/containers/2008-January/009688.html&lt;br /&gt;
* http://openvz.org/pipermail/devel/2008-July/012891.html&lt;br /&gt;
* Checkpoint/Restart&lt;br /&gt;
** Zap : http://www.ncl.cs.columbia.edu/publications/usenix2007_fordist.pdf&lt;br /&gt;
** Metacluster : http://lxc.sourceforge.net/doc/ols2006/lxc-ols2006.pdf&lt;br /&gt;
** OpenVZ : [[Checkpointing and live migration]]&lt;br /&gt;
** Checkpoint/Restart technology : http://en.wikipedia.org/wiki/Application_checkpointing&lt;br /&gt;
** Virtual Servers and Checkpoint/Restart in Mainstream Linux : Sigops document&lt;br /&gt;
** Remote fork: http://www.cse.nd.edu/~dthain/courses/classconf/wowsys2004/talks/rfork.pdf&lt;br /&gt;
** Vmadump : http://bproc.sourceforge.net/c268.html&lt;br /&gt;
** Posix CR : http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/0650/bks/SGI_Admin/CPR_OG/sgi_html/ch03.html&lt;br /&gt;
** An OS services overview : http://sw-eng.falls-church.va.us/itsg/P08V31.htm&lt;br /&gt;
&lt;br /&gt;
[[Category: Containers]]&lt;br /&gt;
[[Category: Events]]&lt;/div&gt;</summary>
		<author><name>Balbir</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Containers/UBC_discussion&amp;diff=2341</id>
		<title>Containers/UBC discussion</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Containers/UBC_discussion&amp;diff=2341"/>
		<updated>2006-09-18T17:49:37Z</updated>

		<summary type="html">&lt;p&gt;Balbir: Add accounting information update thoughts&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;; unified interface for mem, cpu, disk I/O&lt;br /&gt;
: It is still not clear whether we need unified interface.&lt;br /&gt;
: Having one syscall for setting values for different resources seems OK if leaving alone the meaning of the &amp;quot;value&amp;quot; notion.&lt;br /&gt;
&lt;br /&gt;
; memory reclamation&lt;br /&gt;
: Pending to be implemented on top of BC.&lt;br /&gt;
&lt;br /&gt;
; moving tasks across beancounters&lt;br /&gt;
: Required changes:&lt;br /&gt;
# saving bc on vma instead of mm&lt;br /&gt;
# can two threads in a process be in different BC contexts?&lt;br /&gt;
# changing mm-&amp;gt;bc in set_bc_id().&lt;br /&gt;
&lt;br /&gt;
; what is implied by the term &amp;quot;guarantee&amp;quot;&lt;br /&gt;
# container will be able to touch that number of pages - I think this one (Hansendc)&lt;br /&gt;
# container will be able to map that number of pages&lt;br /&gt;
# container will not be killed unless it touches that number of pages&lt;br /&gt;
# anything else&lt;br /&gt;
&lt;br /&gt;
; make it possible to charge full user page to its allocator and keep it charged till unmapped&lt;br /&gt;
&lt;br /&gt;
; Consider creating resource groups via the use of aggregation (aggregated BC)&lt;br /&gt;
&lt;br /&gt;
== Top Level Design - thoughts on how to accomplish the goal ==&lt;br /&gt;
# Create a BC per thread group&lt;br /&gt;
# Associate a group of BC's with an aggregated BC (we can call this a BC resource group)&lt;br /&gt;
# Enable migration of tasks by charging and un-charging aggregated BC when a BC moves across from one aggregated BC to another&lt;br /&gt;
# Change set_bcid() to create aggregated BC's instead of BC's&lt;br /&gt;
&lt;br /&gt;
== Accounting information ==&lt;br /&gt;
# Is it possible to merge vm_acct_memory() with the accounting information in beancounters?&lt;br /&gt;
&lt;br /&gt;
[[Category:UBC]]&lt;/div&gt;</summary>
		<author><name>Balbir</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Containers/Guarantees_for_resources&amp;diff=2340</id>
		<title>Containers/Guarantees for resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Containers/Guarantees_for_resources&amp;diff=2340"/>
		<updated>2006-09-18T17:46:38Z</updated>

		<summary type="html">&lt;p&gt;Balbir: Changed the algorithm to compile and give correct results&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:UBC]]&lt;br /&gt;
&lt;br /&gt;
This page describes how guarantees for resources can be implemented.&lt;br /&gt;
&lt;br /&gt;
= How to guarantee a guarantee =&lt;br /&gt;
It's not obvious at the first glance, but ''there are only two ways of how a guarantee can be provided'':&lt;br /&gt;
# reserve desired amount in advance&lt;br /&gt;
# limit consumers to keep some amount free&lt;br /&gt;
&lt;br /&gt;
The first way has the followong disadvantages:&lt;br /&gt;
; Reservation is impossible for certain resources&lt;br /&gt;
: such as CPU time, disk or network bandwidth and similar can not be just reserved as their amount instantly increases;&lt;br /&gt;
&lt;br /&gt;
; Reserved amount is essentially a limit, but much more strict&lt;br /&gt;
: cutting off X megabytes from RAM implies that all the rest groups are limited in their RAM consumption;&lt;br /&gt;
&lt;br /&gt;
; Reservation reduces containers density&lt;br /&gt;
: if one wants to run some identical containers, each requiring 100Mb on 1Gb system, reservations can be done for only 10 containers, and starting the 11th is impossible.&lt;br /&gt;
&lt;br /&gt;
On the other hand, ''limiting'' of containers can provide guarantees for them as well.&lt;br /&gt;
&lt;br /&gt;
= Providing a guarantee through limiting =&lt;br /&gt;
The idea of getting a guarantee is simple:&lt;br /&gt;
&lt;br /&gt;
{{out|if any group &amp;lt;math&amp;gt;g_i&amp;lt;/math&amp;gt; requires a &amp;lt;math&amp;gt;G_i&amp;lt;/math&amp;gt; units of resource from &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; units available then limiting all the rest groups with &amp;lt;math&amp;gt;R - G_i&amp;lt;/math&amp;gt; units provides a desired guarantee}}&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; groups in the system this implies solving a linear equation set to get limits &amp;lt;math&amp;gt;L_i&amp;lt;/math&amp;gt; like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{cases}&lt;br /&gt;
L_2 + L_3 + \ldots + L_N = R - G_1 \\&lt;br /&gt;
L_1 + L_3 + \ldots + L_N = R - G_2 \\&lt;br /&gt;
\ldots \\&lt;br /&gt;
L_1 + L_2 + \ldots + L_{N-1} = R - G_N \\&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a matrix form this looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
A L = G\;&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
A = \begin{bmatrix}&lt;br /&gt;
 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; \cdots &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; \cdots &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
 &amp;amp; &amp;amp; \cdots \\&lt;br /&gt;
 1 &amp;amp; 1 &amp;amp; 1 &amp;amp; \cdots &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
,&lt;br /&gt;
L = \begin{bmatrix} L_1 \\ L_2 \\ \vdots \\ L_N \end{bmatrix}&lt;br /&gt;
,&lt;br /&gt;
G = \begin{bmatrix} R - G_1 \\ R - G_2 \\ \vdots \\ R - G_N \end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and thus the solution is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
L = A^{-1}G\;&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Skipping boring calculations, the reverse matrix &amp;lt;math&amp;gt;A^{-1}\;&amp;lt;/math&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
A^{-1} = \frac {1} {N - 1} \left( A - (N - 2) E \right)&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This solutions looks huge, but the &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt; vector is calculated in &amp;lt;math&amp;gt;O(N)&amp;lt;/math&amp;gt; time:&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void calculate_limits(int N, int *g, int *l)&lt;br /&gt;
{&lt;br /&gt;
        int sum;&lt;br /&gt;
        int i;&lt;br /&gt;
&lt;br /&gt;
        if (N == 1) {&lt;br /&gt;
                l[0] = R;&lt;br /&gt;
                return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        sum = 0;&lt;br /&gt;
        for (i = 0; i &amp;lt; N; i++)&lt;br /&gt;
                sum += R - g[i];&lt;br /&gt;
        for (i = 0; i &amp;lt; N; i++)&lt;br /&gt;
                l[i] = (sum - (R - g[i]) - (N - 2) * (R - g[i]))/(N - 1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of this approach ==&lt;br /&gt;
&lt;br /&gt;
This approach has only one disadvantage: O(n) time needed to start a new container.&lt;/div&gt;</summary>
		<author><name>Balbir</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Containers/Guarantees_for_resources&amp;diff=2336</id>
		<title>Containers/Guarantees for resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Containers/Guarantees_for_resources&amp;diff=2336"/>
		<updated>2006-09-18T08:26:52Z</updated>

		<summary type="html">&lt;p&gt;Balbir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:UBC]]&lt;br /&gt;
&lt;br /&gt;
This page describes how guarantees for resources can be implemented.&lt;br /&gt;
&lt;br /&gt;
= How to guarantee a guarantee =&lt;br /&gt;
It's not obvious at the first glance, but ''there are only two ways of how a guarantee can be provided'':&lt;br /&gt;
# reserve desired amount in advance&lt;br /&gt;
# limit consumers to keep some amount free&lt;br /&gt;
&lt;br /&gt;
The first way has the followong disadvantages:&lt;br /&gt;
; Reservation is impossible for certain resources&lt;br /&gt;
: such as CPU time, disk or network bandwidth and similar can not be just reserved as their amount instantly increases;&lt;br /&gt;
&lt;br /&gt;
; Reserved amount is essentially a limit, but much more strict&lt;br /&gt;
: cutting off X megabytes from RAM implies that all the rest groups are limited in their RAM consumption;&lt;br /&gt;
&lt;br /&gt;
; Reservation reduces containers density&lt;br /&gt;
: if one wants to run some identical containers, each requiring 100Mb on 1Gb system, reservations can be done for only 10 containers, and starting the 11th is impossible.&lt;br /&gt;
&lt;br /&gt;
On the other hand, ''limiting'' of containers can provide guarantees for them as well.&lt;br /&gt;
&lt;br /&gt;
= Providing a guarantee through limiting =&lt;br /&gt;
The idea of getting a guarantee is simple:&lt;br /&gt;
&lt;br /&gt;
{{out|if any group &amp;lt;math&amp;gt;g_i&amp;lt;/math&amp;gt; requires a &amp;lt;math&amp;gt;G_i&amp;lt;/math&amp;gt; units of resource from &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; units available then limiting all the rest groups with &amp;lt;math&amp;gt;R - G_i&amp;lt;/math&amp;gt; units provides a desired guarantee}}&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; groups in the system this implies solving a linear equation set to get limits &amp;lt;math&amp;gt;L_i&amp;lt;/math&amp;gt; like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{cases}&lt;br /&gt;
L_2 + L_3 + \ldots + L_N = R - G_1 \\&lt;br /&gt;
L_1 + L_3 + \ldots + L_N = R - G_2 \\&lt;br /&gt;
\ldots \\&lt;br /&gt;
L_1 + L_2 + \ldots + L_{N-1} = R - G_N \\&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a matrix form this looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
A L = G\;&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
A = \begin{bmatrix}&lt;br /&gt;
 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; \cdots &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; \cdots &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
 &amp;amp; &amp;amp; \cdots \\&lt;br /&gt;
 1 &amp;amp; 1 &amp;amp; 1 &amp;amp; \cdots &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
,&lt;br /&gt;
L = \begin{bmatrix} L_1 \\ L_2 \\ \vdots \\ L_N \end{bmatrix}&lt;br /&gt;
,&lt;br /&gt;
G = \begin{bmatrix} R - G_1 \\ R - G_2 \\ \vdots \\ R - G_N \end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and thus the solution is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
L = A^{-1}G\;&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Skipping boring calculations, the reverse matrix &amp;lt;math&amp;gt;A^{-1}\;&amp;lt;/math&amp;gt; is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
A^{-1} = \frac {1} {N - 1} \left( A - (N - 2) E \right)&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This solutions looks huge, but the &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt; vector is calculated in &amp;lt;math&amp;gt;O(N)&amp;lt;/math&amp;gt; time:&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void calculate_limits(int N, int *g, int *l)&lt;br /&gt;
{&lt;br /&gt;
        int sum;&lt;br /&gt;
&lt;br /&gt;
        sum = 0;&lt;br /&gt;
        for (i = 0; i &amp;lt; N; i++)&lt;br /&gt;
                sum += g[i];&lt;br /&gt;
        for (i = 0; i &amp;lt; N; i++)&lt;br /&gt;
                l[i] = sum - (R - g[i]) - (N - 2) * (R - g[i]);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Disadvantages of this approach =&lt;br /&gt;
&lt;br /&gt;
This approach has the following disadvantages&lt;br /&gt;
&lt;br /&gt;
# Lets consider initialization - When we create &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; groups initially, we need to spend &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; time to assign guarantees.&lt;br /&gt;
# Everytime a limit or a guarantee changes, we need to recalculate guarantees to ensure that the change will not break any guarantees&lt;br /&gt;
# The same thing as stated above, when a resource group is created or deleted&lt;br /&gt;
&lt;br /&gt;
This can lead to some instability, a change in one group propagates to all other groups.&lt;/div&gt;</summary>
		<author><name>Balbir</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Containers/UBC_discussion&amp;diff=2288</id>
		<title>Containers/UBC discussion</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Containers/UBC_discussion&amp;diff=2288"/>
		<updated>2006-09-13T18:34:46Z</updated>

		<summary type="html">&lt;p&gt;Balbir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;; unified interface for mem, cpu, disk I/O&lt;br /&gt;
: It is still not clear whether we need unified interface.&lt;br /&gt;
: Having one syscall for setting values for different resources seems OK if leaving alone the meaning of the &amp;quot;value&amp;quot; notion.&lt;br /&gt;
&lt;br /&gt;
; memory reclamation&lt;br /&gt;
: Pending to be implemented on top of BC.&lt;br /&gt;
&lt;br /&gt;
; moving tasks across beancounters&lt;br /&gt;
: Required changes:&lt;br /&gt;
# saving bc on vma instead of mm&lt;br /&gt;
# can two threads in a process be in different BC contexts?&lt;br /&gt;
# changing mm-&amp;gt;bc in set_bc_id().&lt;br /&gt;
&lt;br /&gt;
; what is implied by the term &amp;quot;guarantee&amp;quot;&lt;br /&gt;
# container will be able to touch that number of pages - I think this one (Hansendc)&lt;br /&gt;
# container will be able to map that number of pages&lt;br /&gt;
# container will not be killed unless it touches that number of pages&lt;br /&gt;
# anything else&lt;br /&gt;
&lt;br /&gt;
; make it possible to charge full user page to its allocator and keep it charged till unmapped&lt;br /&gt;
&lt;br /&gt;
; Consider creating resource groups via the use of aggregation (aggregated BC)&lt;br /&gt;
''Top Level Design - thoughts on how to accomplish the goal''&lt;br /&gt;
# Create a BC per thread group&lt;br /&gt;
# Associate a group of BC's with an aggregated BC (we can call this a BC resource group)&lt;br /&gt;
# Enable migration of tasks by charging and un-charging aggregated BC when a BC moves across from one aggregated BC to another&lt;br /&gt;
# Change set_bcid() to create aggregated BC's instead of BC's&lt;/div&gt;</summary>
		<author><name>Balbir</name></author>
		
	</entry>
</feed>