Subject: Virtual Contexts for Tasks (2.4.2x) From: Herbert Poetzl To: linux-kernel@vger.kernel.org Date: 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)