| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
where critical. Some places still use ps_pread/ps_pwrite directly,
but only need changed when byte-order comes into the picture.
Also, change th_p in td_event_msg_t from a pointer type to
psaddr_t, so that events also work when psaddr_t is widened.
|
|
|
|
|
|
|
| |
the call never happens. This is necessary because malloc may be used
during exit handler processing.
Submitted by: davidxu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This caching allows for completely lock-free allocation/deallocation in the
steady state, at the expense of likely increased memory use and
fragmentation.
Reduce the default number of arenas to 2*ncpus, since thread-specific
caching typically reduces arena contention.
Modify size class spacing to include ranges of 2^n-spaced, quantum-spaced,
cacheline-spaced, and subpage-spaced size classes. The advantages are:
fewer size classes, reduced false cacheline sharing, and reduced internal
fragmentation for allocations that are slightly over 512, 1024, etc.
Increase RUN_MAX_SMALL, in order to limit fragmentation for the
subpage-spaced size classes.
Add a size-->bin lookup table for small sizes to simplify translating sizes
to size classes. Include a hard-coded constant table that is used unless
custom size class spacing is specified at run time.
Add the ability to disable tiny size classes at compile time via
MALLOC_TINY.
|
|
|
|
| |
PR: kern/126128
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
locked and unlocked completely in userland. by locking and unlocking mutex
in userland, it reduces the total time a mutex is locked by a thread,
in some application code, a mutex only protects a small piece of code, the
code's execution time is less than a simple system call, if a lock contention
happens, however in current implemenation, the lock holder has to extend its
locking time and enter kernel to unlock it, the change avoids this disadvantage,
it first sets mutex to free state and then enters kernel and wake one waiter
up. This improves performance dramatically in some sysbench mutex tests.
Tested by: kris
Sounds great: jeff
|
|
|
|
|
|
|
| |
use stack space to keep cleanup information, this eliminates overhead of
calling malloc() and free() in thread library.
Discussed on: thread@
|
|
|
|
|
|
| |
so that they get the benefit of the (limited) forward ABI compatibility.
MFC after: 1 week
|
|
|
|
| |
a semaphore.
|
|
|
|
|
| |
- Remove unused flags MUTEX_FLAGS_* and their code.
- Check validity of the timeout parameter in mutex_self_lock().
|
| |
|
|
|
|
| |
time in kernel(avoid VM lookup).
|
|
|
|
|
|
|
|
| |
testing it turns out 200 was too short to give good adaptive
performance.
Reviewed by: jeff
MFC after: 1 week
|
|
|
|
|
|
| |
for some const dequalifiers that needs more careful investigation.
Ok'ed by: davidxu
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
returns errno, because errno can be mucked by user's signal handler and
most of pthread api heavily depends on errno to be correct, this change
should improve stability of the thread library.
|
|
|
|
|
|
| |
implementation does not switch pointers when it resumes waiters.
Asked by: jeff
|
| |
|
|
|
|
| |
static branch prediction.
|
|
|
|
|
|
|
| |
eliminates internal mutex lock contention when most rwlock operations
are read.
Orignal patch provided by: jeff
|
| |
|
|
|
|
| |
Reviewed by: davidxu
|
|
|
|
| |
time clock id.
|
|
|
|
|
| |
otherwise rwlock is recursivly called when signal happens and the __error
was never resolved before.
|
|
|
|
| |
unbreak it. We should really start compiling this with warnings.
|
|
|
|
| |
any case safe.
|
|
|
|
|
|
| |
conformant to POSIX specification.
Bug reported by: modelnine at modelnine dt org
|
|
|
|
| |
for it, since the new thread will reduce it by itself.
|
|
|
|
| |
- Use a different sigmask variable name to avoid confusing.
|
|
|
|
| |
to speed up searching.
|
|
|
|
|
|
|
|
| |
_thr_suspend_check() which messes sigmask saved in thread structure.
- Don't suspend a thread has force_exit set.
- In pthread_exit(), if there is a suspension flag set, wake up waiting-
thread after setting PS_DEAD, this causes waiting-thread to break loop
in suspend_common().
|
|
|
|
| |
be masked when it is resumed.
|
|
|
|
| |
check waiter and semphore counter to see if we may wake up next thread.
|
| |
|
| |
|
|
|
|
|
|
| |
that there might be starvations, but because we have already locked the
thread, the cpuset settings will always be done before the new thread
does real-world work.
|
|
|
|
| |
error caused by nested SIGCANCEL stack, it is a bit complex.
|
|
|
|
|
|
|
| |
we set scheduling parameters and cpu binding fully in userland, and
because default scheduling policy is SCHED_RR (time-sharing), we set
default sched_inherit to PTHREAD_SCHED_INHERIT, this saves a system
call.
|
|
|
|
| |
of API.
|
|
|
|
|
|
|
|
| |
however if current thread is executing cancellation handler, signal
SIGCANCEL may have already been blocked, this is unexpected, unblock the
signal in new thread if this happens.
MFC after: 1 week
|
| |
|
| |
|
|
|
|
| |
get and set thread's cpu affinity mask.
|
|
|
|
|
|
| |
will work in simple cases, but may fail in more complicated ones.
Reviewed by: davidxu
|