Subject: [PATCH] Linux JOB for 2.6.10
Attached is a new JOB patch for 2.6.10. This version of JOB uses a whole new interface for communicating with user space.
A new small virtual filesystem called jobfs is implemented to replace the previous binary ioctl call interface.
Linux JOB provides grouping of processes in to inescapable containers. A job, identified by a unique job identifier (jid), is the collection of all processes that are descended from a point-of-entry process. Examples of such points-of-entry include telnet, rlogin, and console logins. A job differs from a session and process group since the job container (or group) is inescapable. Only root level processes, or those with the CAP_SYS_RESOURCE capability, can create new jobs or escape from a job.
Users of Linux JOB can create new jobs via the JOB library to track a group of processes as one entity. For example, a batch scheduler may want to track a bunch of processes, perhaps otherwise unrelated, as a job and perform action on that job.
This linux-2.6.10-job.patch should be applied after Process Aggregates (PAGG) patch, which Erik Jacobson just posted minutes ago.
We also provide the job userland library and command package.
Job library and command rpm package is the middle layer
between job kernel module and job applications, it communicates with kernel through the jobfs virtual filesystem, and it provides the SAME interface to JOB applications through /usr/lib/libjob.so as before via job ioctl calls. That ensures all current job applications should work without any change.
You can get the job library and command source rpm at ftp://oss.sgi.com/projects/pagg/download/job-1.5.0-0.2.src.rpm
Please visit http://oss.sgi.com/projects/pagg/ for more information about PAGG and JOB.
Thanks,
--
Limin Gu - Linux System Software
Silicon Graphics Inc., Mountain View, CA
Documentation/job.txt new file +104 -0
@@ -0,0 +1,104 @@ +Linux Jobs - A Process Aggregate (PAGG) Module +---------------------------------------------- + +1. Overview + +This document provides two additional sections. Section 2 provides a +listing of the manual page that describes the particulars of the Linux +job implementation. Section 3 provides some information about using +the user job library to interface to jobs. + +2. Job Man Page + + +JOB(7) Linux User's Manual JOB(7) + + +NAME + job - Linux Jobs kernel module overview + +DESCRIPTION + A job is a group of related processes all descended from a + point of entry process and identified by a unique job + identifier (jid). A job can contain multiple process + groups or sessions, and all processes in one of these sub- + groups can only be contained within a single job. + + The primary purpose for having jobs is to provide job + based resource limits. The current implementation only + provides the job container and resource limits will be + provided in a later implementation. When an implementa- + tion that provides job limits is available, this descrip- + tion will be expanded to provide further explanation of + job based limits. + + Not every process on the system is part of a job. That + is, only processes which are started by a login initiator + like login, rlogin, rsh and so on, get assigned a job ID. + In the Linux environment, jobs are created via a PAM mod- + ule. + + Jobs on Linux are provided using a loadable kernel module. + Linux jobs have the following characteristics: + + o A job is an inescapable container. A process cannot + leave the job nor can a new process be created outside + the job without explicit action, that is, a system + call with root privilege. + + o Each new process inherits the jid and limits [when + implemented] from its parent process. + + o All point of entry processes (job initiators) create a + new job and set the job limits [when implemented] + appropriately. + + o Job initiation on Linux is performed via a PAM session + module. + + o The job initiator performs authentication and security + checks. + + o Users can raise and lower their own job limits within + maximum values specified by the system administrator + [when implemented]. + + o Not all processes on a system need be members of a job. + + o The process control initialization process (init(1M)) + and startup scripts called by init are not part of a + job. + + + Job initiators can be categorized as either interactive or + batch processes. Limit domain names are defined by the + system administrator when the user limits database (ULDB) + is created. [The ULDB will be implemented in conjunction + with future job limits work.] + + Note: The existing command jobs(1) applies to shell "jobs" + and it is not related to the Linux Kernel Module jobs. + The at(1), atd(8), atq(1), batch(1), atrun(8), atrm(1)) + man pages refer to shell scripts as a job. a shell + script. + +SEE ALSO + job(1), jwait(1), jstat(1), jkill(1), jsethid(8), + jdetach(8), jattach(8) + + job_attachpid(3), job_getjid(3), job_getpidlist(3), + job_sethid(3), job_create(3), job_getjidcnt(3), + job_getprimepid(3), job_waitjid(3), job_detachjid(3), + job_getjidlist(3), job_getuid(3), job_detachpid(3), + job_getpidcnt(3), job_killjid(3) + + +3. User Job Library + +For developers who wish to make software using Linux Jobs, there exists +a user job library. This library contains functions for obtaining information +about running jobs, creating jobs, detaching, attaching, etc. + +The library is part of the job package and can be obtained from oss.sgi.com +using anonymous ftp. Look in the /projects/pagg/download directory. See the +README in the job source package for more information.
include/linux/job.h new file +153 -0
153 lines not on this page · raw message
init/Kconfig +25 -0
@@ -146,6 +146,31 @@ Linux Jobs module and the Linux Array Sessions module. If you will not be using such modules, say N. +config PAGG_JOB + tristate " Process aggregate based jobs" + depends on PAGG + help + The Job feature implements a type of process aggregate, + or grouping. A job is the collection of all processes that + are descended from a point-of-entry process. Examples of such + points-of-entry include telnet, rlogin, and console logins. + A job differs from a session and process group since the job + container (or group) is inescapable. Only root level processes, + or those with the CAP_SYS_RESOURCE capability, can create new jobs + or escape from a job. + + A job is identified by a unique job identifier (jid). Currently, + that jid can be used to obtain status information about the job + and the processes it contians. The jid can also be used to send + signals to all processes contained in the job. In addition, + other processes can wait for the completion of a job - the event + where the last process contained in the job has exited. + + If you want to compile support for jobs into the kernel, select + this entry using Y. If you want the support for jobs provided as + a module, select this entry using M. If you do not want support + for jobs, select N. + config SYSCTL bool "Sysctl support" ---help---
kernel/job.c new file +1733 -0
1,733 lines not on this page · raw message
kernel/Makefile +1 -0
@@ -19,6 +19,7 @@ obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o obj-$(CONFIG_COMPAT) += compat.o obj-$(CONFIG_PAGG) += pagg.o +obj-$(CONFIG_PAGG_JOB) += job.o obj-$(CONFIG_IKCONFIG) += configs.o obj-$(CONFIG_IKCONFIG_PROC) += configs.o obj-$(CONFIG_STOP_MACHINE) += stop_machine.o