the openMosix miggroup feature
by Matt Rechenburg
download the patch
The migdrop feature is a small kernel patch which creates
an additional "miggroup"-/proc entry for each process.
If a new process is created the "miggroup" proc-file
contains "0". The value in this file can be easily set
by user-applications like "echo" or any other programs
which are using the regular open(), read() and write() functions.
The main ideas behind this new /proc-entry is that you can
now group your processes by setting the same value to their
"miggroup" file ( /proc/[PID]/miggroup ). Then those created
process-groups can be easily managed by administration-tools
and/or scripts (see examples below).
To my mind it would be usefull to provide this feature
by the kernel in a standardised behaviour.
Here i want to say thanks especially to Ettore Simone for the
"clustermask" feature. This patch was mainly created by looking
briefly at the changes he did.
Thanks of course also to Moshe Bar and all other developers for openMosix itself.
download the patch
the miggroup patch for openMosix 2.4.20
(apply it to the openMosix 2.4.20 kernel sources from the cvs (22.02.2003))
the miggroup patch for linux-2.4.20
(apply it to the clean vanilla 2.4.20 kernel sources from kernel.org)
Here are a few examples using the miggroup-scripts:
- make processes join a miggroup:
[root@node1 miggroup]# ./joingroup 1300 1332 1364 1396 1428 1460 1
miggroup = 1
processes = 1300 1332 1364 1396 1428 1460
process 1300 joins the miggroup 1 now
process 1332 joins the miggroup 1 now
process 1364 joins the miggroup 1 now
process 1396 joins the miggroup 1 now
process 1428 joins the miggroup 1 now
process 1460 joins the miggroup 1 now
- show all processes from a specific miggroup:
[root@node1 miggroup]# ./showgroup 1
1300 with commandline bash belongs to 1
1332 with commandline bash belongs to 1
1364 with commandline bash belongs to 1
1396 with commandline bash belongs to 1
1428 with commandline bash belongs to 1
1460 with commandline bash belongs to 1
- migrate a miggroup to another node:
[root@node1 miggroup]# ./migrategroup 1 2
migrate 1300 to 2
migrate 1332 to 2
migrate 1364 to 2
migrate 1396 to 2
migrate 1428 to 2
migrate 1460 to 2
- reset a specific miggroup:
[root@node1 miggroup]# ./resetgroup 1
All code-examples and applicatons are without guarantee.
Use this openMosix miggroup patch at your own risk and feel free to contribute your own ideas.
The Author of this kernel patch is not responsible for any mistakes and their consequences while using the patch on your system.
Matt Rechenburg (email@example.com)