diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2008-03-12 06:31:06 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2008-03-12 06:31:06 +0000 |
commit | c5aa6b581d3bb4c466526bc0144c0e56ee852901 (patch) | |
tree | 20ec4b3ab190fc07828f6c3f536e039ecdead59a /sys/sys/proc.h | |
parent | df4691b98481b2379d249c3e4bb094b445e9196c (diff) | |
download | src-c5aa6b581d3bb4c466526bc0144c0e56ee852901.tar.gz src-c5aa6b581d3bb4c466526bc0144c0e56ee852901.zip |
- Pass the priority argument from *sleep() into sleepq and down into
sched_sleep(). This removes extra thread_lock() acquisition and
allows the scheduler to decide what to do with the static boost.
- Change the priority arguments to cv_* to match sleepq/msleep/etc.
where 0 means no priority change. Catch -1 in cv_broadcastpri() and
convert it to 0 for now.
- Set a flag when sleeping in a way that is compatible with swapping
since direct priority comparisons are meaningless now.
- Add a sysctl to ule, kern.sched.static_boost, that defaults to on which
controls the boost behavior. Turning it off gives better performance
in some workloads but needs more investigation.
- While we're modifying sleepq, change signal and broadcast to both
return with the lock held as the lock was held on enter.
Reviewed by: jhb, peter
Notes
Notes:
svn path=/head/; revision=177085
Diffstat (limited to 'sys/sys/proc.h')
-rw-r--r-- | sys/sys/proc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h index c147415a1562..76d76450e2c3 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -335,7 +335,7 @@ do { \ #define TDF_SINTR 0x00000008 /* Sleep is interruptible. */ #define TDF_TIMEOUT 0x00000010 /* Timing out during sleep. */ #define TDF_IDLETD 0x00000020 /* This is a per-CPU idle thread. */ -#define TDF_UNUSEDx40 0x00000040 /* --available-- */ +#define TDF_CANSWAP 0x00000040 /* Thread can be swapped. */ #define TDF_SLEEPABORT 0x00000080 /* sleepq_abort was called. */ #define TDF_KTH_SUSP 0x00000100 /* kthread is suspended */ #define TDF_UBORROWING 0x00000200 /* Thread is borrowing user pri. */ @@ -782,7 +782,7 @@ MALLOC_DECLARE(M_ZOMBIE); } while (0) /* Check whether a thread is safe to be swapped out. */ -#define thread_safetoswapout(td) (TD_IS_SLEEPING(td) || TD_IS_SUSPENDED(td)) +#define thread_safetoswapout(td) ((td)->td_flags & TDF_CANSWAP) /* Control whether or not it is safe for curthread to sleep. */ #define THREAD_NO_SLEEPING() do { \ |