by Ning Li

There is no conflict between lottery scheduling, which is one way to implement
proportional-share resource allocation, resource containers, which is a
mechanism to better count all system resources consumed by a independent
activity, and scheduler activation, which provides, as the title of the paper,
more "effective kernel support for user-level management of parallelism".

Since resource containers are a facility for resource management and lottery
scheduling is a policy for doing resource management, we could just try to
find out, in a system utilizing scheduler activation, where resource
management is needed, and how it's better done with resource containers and
lottery scheduling.

In systems using scheduler activation, the operating system kernel provides
each user-level thread system with its own virtual multi-processor. The
user-level thread system works with the abstraction of a dedicated physical
machine, except that the kernel may change the number of processors in that
machine during the execution of the program.

There are mainly two resource management problems involved:
1 - The kernel's allocation of processors to address spaces.
The kernel has to decide how many processors to give each address
space's virtual multiprocessor.

2 - Each address space's user-level thread system decides which threads
to run on its allocated processors.
This is done as user-level thread system would if the application
were running on the bare physical machine.

Also, the kernel notifies the user-level thread system whenever the kernel
changes the number of processors assigned to it; the kernel also notifies the
thread system whenever a user-level thread blocks or wakes up in the kernel
(kernel vectors events to appropriate thread scheduler). And, the user-level
thread system notifies the kernel when the application needs more or fewer
processors.

Although the above notification (communication) between kernel and user-level
thread system plays an important role in those 2 resource management problems
(changing resources to be managed), utilization of the resource and other info
is still greatly needed to do a better resource management job. Resource
containers are what we need. They are to contain all the system resources used
by an application. The resource consumption of a thread is charged to the
associated resource principal.

With resource containers, user-level thread system can schedule thread based
on the combined resource allocations and usage of all the containers it is
currently handling. With resource containers, kernel can allocate processors
based on the combined allocation and usage of each virtual multiprocess on
each address space.

With the information provided by resource containers, the resource manager
that wants to do proportional-share can use lottery scheduling.