diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-08-04 18:14:19 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-08-04 18:14:19 +0000 |
commit | 0bd932a38d92baf8b3366b1c86413e178f43d921 (patch) | |
tree | 4107cc739e37abb46f2ddfa97f81470b789ff051 /sys/sys/resourcevar.h | |
parent | 97dc3be9d1d100ff9b272bd53d1b13d35c4d5af7 (diff) | |
download | FreeBSD-src-0bd932a38d92baf8b3366b1c86413e178f43d921.zip FreeBSD-src-0bd932a38d92baf8b3366b1c86413e178f43d921.tar.gz |
Annotate locking strategy for 'struct uidinfo'.
Diffstat (limited to 'sys/sys/resourcevar.h')
-rw-r--r-- | sys/sys/resourcevar.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/sys/resourcevar.h b/sys/sys/resourcevar.h index d0669f6..9fb4aa4 100644 --- a/sys/sys/resourcevar.h +++ b/sys/sys/resourcevar.h @@ -85,15 +85,20 @@ struct plimit { #define LIM_UNLOCK(lim) mtx_unlock((lim)->pl_mtx) #define LIM_LOCK_ASSERT(lim, f) mtx_assert((lim)->pl_mtx, (f)) -/* +/*- * Per uid resource consumption + * + * Locking guide: + * (a) Constant from inception + * (b) Locked by ui_mtxp + * (c) Locked by global uihashtbl_mtx */ struct uidinfo { - LIST_ENTRY(uidinfo) ui_hash; - rlim_t ui_sbsize; /* socket buffer space consumed */ - long ui_proccnt; /* number of processes */ - uid_t ui_uid; /* uid */ - u_int ui_ref; /* reference count */ + LIST_ENTRY(uidinfo) ui_hash; /* (c) hash chain of uidinfos */ + rlim_t ui_sbsize; /* (b) socket buffer space consumed */ + long ui_proccnt; /* (b) number of processes */ + uid_t ui_uid; /* (a) uid */ + u_int ui_ref; /* (b) reference count */ struct mtx *ui_mtxp; /* protect all counts/limits */ }; |