summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2016-01-09 14:08:10 +0000
committerdchagin <dchagin@FreeBSD.org>2016-01-09 14:08:10 +0000
commit939deb433656eadcd7e74873a32a38411367cdc8 (patch)
tree098f09b40a7709202e8662e68db796b52cf431ce /sys/fs
parent8120f17059427acef6857f4445f402c4646a266a (diff)
downloadFreeBSD-src-939deb433656eadcd7e74873a32a38411367cdc8.zip
FreeBSD-src-939deb433656eadcd7e74873a32a38411367cdc8.tar.gz
To facillitate an upcoming Linuxulator merging partially
MFC r275121 (by kib). Only merge the syntax changes from r275121, PROC_*LOCK() macros still lock the same proc spinlock. The process spin lock currently has the following distinct uses: - Threads lifetime cycle, in particular, counting of the threads in the process, and interlocking with process mutex and thread lock. The main reason of this is that turnstile locks are after thread locks, so you e.g. cannot unlock blockable mutex (think process mutex) while owning thread lock. - Virtual and profiling itimers, since the timers activation is done from the clock interrupt context. Replace the p_slock by p_itimmtx and PROC_ITIMLOCK(). - Profiling code (profil(2)), for similar reason. Replace the p_slock by p_profmtx and PROC_PROFLOCK(). - Resource usage accounting. Need for the spinlock there is subtle, my understanding is that spinlock blocks context switching for the current thread, which prevents td_runtime and similar fields from changing (updates are done at the mi_switch()). Replace the p_slock by p_statmtx and PROC_STATLOCK(). Discussed with: kib
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/procfs/procfs_status.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c
index a97e0a9..5a00ee1 100644
--- a/sys/fs/procfs/procfs_status.c
+++ b/sys/fs/procfs/procfs_status.c
@@ -125,9 +125,9 @@ procfs_doprocstatus(PFS_FILL_ARGS)
if (p->p_flag & P_INMEM) {
struct timeval start, ut, st;
- PROC_SLOCK(p);
+ PROC_STATLOCK(p);
calcru(p, &ut, &st);
- PROC_SUNLOCK(p);
+ PROC_STATUNLOCK(p);
start = p->p_stats->p_start;
timevaladd(&start, &boottime);
sbuf_printf(sb, " %jd,%ld %jd,%ld %jd,%ld",
OpenPOWER on IntegriCloud