Whitespace cleanups, and a few comment changes to get everything to fit
back in 80 columns again after the locking descriptions were added. Submitted by: bde
This commit is contained in:
parent
e8ae57d589
commit
3886aa1d19
@ -108,14 +108,14 @@ struct pargs {
|
||||
u_char ar_args[0]; /* Arguments. */
|
||||
};
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Description of a process.
|
||||
*
|
||||
* This structure contains the information needed to manage a thread of
|
||||
* control, known in UN*X as a process; it has references to substructures
|
||||
* containing descriptions of things that the process uses, but may share
|
||||
* with related processes. The process structure and the substructures
|
||||
* are always addressable except for those marked "(PROC ONLY)" below,
|
||||
* are always addressable except for those marked "(CPU)" below,
|
||||
* which might be addressable only on a processor on which the process
|
||||
* is running.
|
||||
*
|
||||
@ -134,8 +134,8 @@ struct pargs {
|
||||
* i - by curproc or the master session mtx
|
||||
* j - locked by sched_lock mtx
|
||||
* k - either by curproc or a lock which prevents the lock from
|
||||
* going way, such a (d,e).
|
||||
* l - the attaching proc or attaching proc parent.
|
||||
* going away, such as (d,e)
|
||||
* l - the attaching proc or attaching proc parent
|
||||
* m - Giant
|
||||
* n - not locked, lazy
|
||||
*/
|
||||
@ -147,10 +147,10 @@ struct proc {
|
||||
/* substructures: */
|
||||
struct pcred *p_cred; /* (b) Process owner's identity. */
|
||||
struct filedesc *p_fd; /* (b) Ptr to open files structure. */
|
||||
struct pstats *p_stats; /* (b) Accounting/statistics (PROC ONLY). */
|
||||
struct pstats *p_stats; /* (b) Accounting/statistics (CPU). */
|
||||
struct plimit *p_limit; /* (m) Process limits. */
|
||||
struct vm_object *p_upages_obj;/* (c) Upages object. */
|
||||
struct procsig *p_procsig; /* (c) Signal actions, state (PROC ONLY). */
|
||||
struct procsig *p_procsig; /* (c) Signal actions, state (CPU). */
|
||||
#define p_sigacts p_procsig->ps_sigacts
|
||||
#define p_sigignore p_procsig->ps_sigignore
|
||||
#define p_sigcatch p_procsig->ps_sigcatch
|
||||
@ -173,13 +173,13 @@ struct proc {
|
||||
#define p_startzero p_oppid
|
||||
|
||||
pid_t p_oppid; /* (c) Save parent pid during ptrace. XXX */
|
||||
int p_dupfd; /* (c) Sideways return value from fdopen. XXX */
|
||||
int p_dupfd; /* (c) Sideways ret value from fdopen. XXX */
|
||||
struct vmspace *p_vmspace; /* (b) Address space. */
|
||||
|
||||
/* scheduling */
|
||||
u_int p_estcpu; /* (j) Time averaged value of p_cpticks. */
|
||||
int p_cpticks; /* (j) Ticks of cpu time. */
|
||||
fixpt_t p_pctcpu; /* (j) %cpu for this process during p_swtime */
|
||||
fixpt_t p_pctcpu; /* (j) %cpu during p_swtime. */
|
||||
struct callout p_slpcallout; /* (h) Callout for sleep. */
|
||||
void *p_wchan; /* (j) Sleep address. */
|
||||
const char *p_wmesg; /* (j) Reason for sleep. */
|
||||
@ -191,7 +191,7 @@ struct proc {
|
||||
u_int64_t p_runtime; /* (c) Real time in microsec. */
|
||||
u_int64_t p_uu; /* (c) Previous user time in microsec. */
|
||||
u_int64_t p_su; /* (c) Previous system time in microsec. */
|
||||
u_int64_t p_iu; /* (c) Previous interrupt time in usec. */
|
||||
u_int64_t p_iu; /* (c) Previous interrupt time in microsec. */
|
||||
u_int64_t p_uticks; /* (j) Statclock hits in user mode. */
|
||||
u_int64_t p_sticks; /* (j) Statclock hits in system mode. */
|
||||
u_int64_t p_iticks; /* (j) Statclock hits processing intr. */
|
||||
@ -204,7 +204,7 @@ struct proc {
|
||||
struct vnode *p_textvp; /* (b) Vnode of executable. */
|
||||
|
||||
char p_lock; /* (c) Process lock (prevent swap) count. */
|
||||
struct mtx p_mtx; /* (k) Process structure lock. */
|
||||
struct mtx p_mtx; /* (k) Lock for this struct. */
|
||||
u_char p_oncpu; /* (j) Which cpu we are on. */
|
||||
u_char p_lastcpu; /* (j) Last cpu we were on. */
|
||||
char p_rqindex; /* (j) Run queue index. */
|
||||
@ -235,14 +235,14 @@ struct proc {
|
||||
#define p_startcopy p_sigmask
|
||||
|
||||
sigset_t p_sigmask; /* (c) Current signal mask. */
|
||||
stack_t p_sigstk; /* (c) Stack pointer and on-stack state variable. */
|
||||
stack_t p_sigstk; /* (c) Stack pointer and on-stack flag. */
|
||||
|
||||
int p_magic; /* (b) Magic number. */
|
||||
u_char p_priority; /* (j) Process priority. */
|
||||
u_char p_usrpri; /* (j) User-priority based on p_cpu and p_nice. */
|
||||
u_char p_usrpri; /* (j) User priority based on p_cpu and p_nice. */
|
||||
u_char p_nativepri; /* (j) Priority before propagation. */
|
||||
char p_nice; /* (j/k?) Process "nice" value. */
|
||||
char p_comm[MAXCOMLEN+1]; /* (b) Process name */
|
||||
char p_comm[MAXCOMLEN + 1]; /* (b) Process name. */
|
||||
|
||||
struct pgrp *p_pgrp; /* (e?/c?) Pointer to process group. */
|
||||
struct sysentvec *p_sysent; /* (b) System call dispatch information. */
|
||||
@ -253,10 +253,10 @@ struct proc {
|
||||
/* End area that is copied on creation. */
|
||||
#define p_endcopy p_addr
|
||||
|
||||
struct user *p_addr; /* (k) Kernel virtual addr of u-area (PROC ONLY). */
|
||||
struct user *p_addr; /* (k) Kernel virtual addr of u-area (CPU). */
|
||||
struct mdproc p_md; /* (k) Any machine-dependent fields. */
|
||||
|
||||
u_short p_xstat; /* (c) Exit status for wait; also stop signal. */
|
||||
u_short p_xstat; /* (c) Exit status for wait; also stop sig. */
|
||||
u_short p_acflag; /* (c) Accounting flags. */
|
||||
struct rusage *p_ru; /* (a) Exit information. XXX */
|
||||
|
||||
@ -395,10 +395,10 @@ sigonstack(size_t sp)
|
||||
}
|
||||
|
||||
/* STOPEVENT() is MP safe. */
|
||||
#define STOPEVENT(p,e,v) do { \
|
||||
#define STOPEVENT(p, e, v) do { \
|
||||
if ((p)->p_stops & (e)) { \
|
||||
mtx_enter(&Giant, MTX_DEF); \
|
||||
stopevent(p,e,v); \
|
||||
stopevent((p), (e), (v)); \
|
||||
mtx_exit(&Giant, MTX_DEF); \
|
||||
} \
|
||||
} while (0)
|
||||
@ -423,12 +423,12 @@ sigonstack(size_t sp)
|
||||
faultin(p); \
|
||||
} else \
|
||||
PROC_UNLOCK(p); \
|
||||
} while(0)
|
||||
} while (0)
|
||||
#define PRELE(p) do { \
|
||||
PROC_LOCK(p); \
|
||||
(--(p)->p_lock); \
|
||||
PROC_UNLOCK(p); \
|
||||
} while(0)
|
||||
} while (0)
|
||||
|
||||
#define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash])
|
||||
extern LIST_HEAD(pidhashhead, proc) *pidhashtbl;
|
||||
@ -470,11 +470,11 @@ extern struct vm_zone *proc_zone;
|
||||
* the range 100-256 Hz (approximately).
|
||||
*/
|
||||
#define ESTCPULIM(e) \
|
||||
min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * (PRIO_MAX - PRIO_MIN) \
|
||||
- PPQ) + INVERSE_ESTCPU_WEIGHT - 1)
|
||||
#define INVERSE_ESTCPU_WEIGHT 8 /* 1 / (priorities per estcpu level) */
|
||||
#define NICE_WEIGHT 1 /* priorities per nice level */
|
||||
#define PPQ (128 / NQS) /* priorities per queue */
|
||||
min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * (PRIO_MAX - PRIO_MIN) - \
|
||||
PPQ) + INVERSE_ESTCPU_WEIGHT - 1)
|
||||
#define INVERSE_ESTCPU_WEIGHT 8 /* 1 / (priorities per estcpu level). */
|
||||
#define NICE_WEIGHT 1 /* Priorities per nice level. */
|
||||
#define PPQ (128 / NQS) /* Priorities per queue. */
|
||||
|
||||
struct mtx;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user