Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Remove p_nras from struct proc - use LIST_EMPTY(&p->...



details:   https://anonhg.NetBSD.org/src/rev/902cfae177cb
branches:  trunk
changeset: 554919:902cfae177cb
user:      dsl <dsl%NetBSD.org@localhost>
date:      Tue Nov 04 16:19:52 2003 +0000

description:
Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
(pad fields left in struct proc to avoid kernel bump)
Somehow this file escaped the earlier commit (in spite of being in the cvs diff
I did beforehand!)

diffstat:

 sys/sys/proc.h |  22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diffs (49 lines):

diff -r 341287f71bc0 -r 902cfae177cb sys/sys/proc.h
--- a/sys/sys/proc.h    Tue Nov 04 14:59:10 2003 +0000
+++ b/sys/sys/proc.h    Tue Nov 04 16:19:52 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.174 2003/10/09 14:00:34 yamt Exp $  */
+/*     $NetBSD: proc.h,v 1.175 2003/11/04 16:19:52 dsl Exp $   */
 
 /*-
  * Copyright (c) 1986, 1989, 1991, 1993
@@ -149,6 +149,8 @@
  * are always addressible except for those marked "(PROC ONLY)" below,
  * which might be addressible only on a processor on which the process
  * is running.
+ *
+ * Fields marked 'p:' are protected by the process's own p_lock.
  */
 struct proc {
        LIST_ENTRY(proc) p_list;        /* List of all processes */
@@ -179,21 +181,21 @@
        LIST_ENTRY(proc) p_sibling;     /* List of sibling processes. */
        LIST_HEAD(, proc) p_children;   /* Pointer to list of children. */
 
-       struct simplelock p_lwplock;    /* Lock on LWP-related state. */
+       struct simplelock p_lock;       /* Lock on proc state (p:) */
 
-       LIST_HEAD(, lwp) p_lwps;        /* Pointer to list of LWPs. */
+       LIST_HEAD(, lwp) p_lwps;        /* p: Pointer to list of LWPs. */
 
-       LIST_HEAD(, ras) p_raslist;     /* Pointer to RAS queue */
-       u_int p_nras;                   /* number of RASs */
-       struct simplelock p_raslock;    /* Lock for RAS queue */
+       LIST_HEAD(, ras) p_raslist;     /* p: Pointer to RAS queue */
+       u_int           p_nu;           /* unused: was number of RASs */
+       struct simplelock p_nu2;        /* unused: was Lock for RAS queue */
 
 /* The following fields are all zeroed upon creation in fork. */
 #define        p_startzero     p_nlwps
 
-       int             p_nlwps;        /* Number of LWPs */
-       int             p_nrlwps;       /* Number of running LWPs */
-       int             p_nzlwps;       /* Number of zombie LWPs */
-       int             p_nlwpid;       /* Next LWP ID */
+       int             p_nlwps;        /* p: Number of LWPs */
+       int             p_nrlwps;       /* p: Number of running LWPs */
+       int             p_nzlwps;       /* p: Number of zombie LWPs */
+       int             p_nlwpid;       /* p: Next LWP ID */
 
        struct sadata   *p_sa;          /* Scheduler activation information */
 



Home | Main Index | Thread Index | Old Index