Virtual Contexts for Tasks (2.4.2x)

Herbert Poetzl (herbert@13thfloor.at)
Tue, 10 Jun 2003 05:18:26 +0200


I thought it would be interesting to abstract
the current task concept, by adding an additional
layer (in lack of imagination) called 'virtual'
between the physical machine and the actual tasks.
(think like N times /sbin/init on one machine ...)

Although this idea is not new at all, the current
implementations lack some (read several) features
and a lot of simplicity.

I made a 'proof of concept' implementation for the
2.4.20/21-rc7 kernel, to have something to talk
about, which does the following:

- new struct_virtual introduced
- initial struct_virtual (default at boot time)
- init_task, child_reaper, nr_threads, nr_running,
max_threads, last_pid, and total_forks are
moved to the struct_virtual
- extended scheduler to honor virtuals
- related extern declarations removed
- related macros adjusted accordingly

- new syscall to create a virtual
- new syscall to migrate a task to some virtual
- firts virtual task (init) becomes child_reaper
- automatic disposal of virtual if virtual
init task dies/is killed (after waiting
for children)

I guess the implementation is suboptimal, but I
needed something to verify the concept, so
please comment!

patches and example tool can be found at
http://www.13thfloor.at/VServer/Virtual/

best,
Herbert

PS: the virt-tool tries to implement the pivot_root
method suggested by Linus (instead of chroot)
but it failed to unmount the old hierarchy ...
(guess because of open file descriptors)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/