#
cfe30d02 |
| 19-Jun-2013 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge fresh head.
|
#
1d7466bc |
| 13-Jun-2013 |
Konstantin Belousov <kib@FreeBSD.org> |
Fix two issues with the spin loops in the umtx(2) implementation.
- When looping, check for the pending suspension. Otherwise, other usermode thread which races with the looping one, could try to
Fix two issues with the spin loops in the umtx(2) implementation.
- When looping, check for the pending suspension. Otherwise, other usermode thread which races with the looping one, could try to prevent the process from stopping or exiting.
- Add missed checks for the faults from casuword*(). The code is structured in a way which makes the loops exit if the specified address is invalid, since both fuword() and casuword() return -1 on the fault. But if the address is mapped readonly, the typical value read by fuword() is different from -1, while casuword() returns -1. Absent the checks for casuword() faults, this is interpreted as the race with other thread and causes non-interruptible spinning in the kernel.
Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
show more ...
|
Revision tags: release/8.4.0 |
|
#
1e367efa |
| 19-Apr-2013 |
Jilles Tjoelker <jilles@FreeBSD.org> |
sem: Restart the POSIX sem_* calls after signals with SA_RESTART set.
Programs often do not expect an [EINTR] return from sem_wait() and POSIX only allows it if the signal was installed without SA_R
sem: Restart the POSIX sem_* calls after signals with SA_RESTART set.
Programs often do not expect an [EINTR] return from sem_wait() and POSIX only allows it if the signal was installed without SA_RESTART. The timeout in sem_timedwait() is absolute so it can be restarted normally.
The umtx call can be invoked with a relative timeout and in that case [ERESTART] must be changed to [EINTR]. However, libc does not do this.
The old POSIX semaphore implementation did this correctly (before r249566), unlike the new umtx one.
It may be desirable to avoid [EINTR] completely, which matches the pthread functions and is explicitly permitted by POSIX. However, the kernel must return [EINTR] at least for signals with SA_RESTART clear, otherwise pthread cancellation will not abort a semaphore wait. In this commit, only restore the 8.x behaviour which is also permitted by POSIX.
Discussed with: jhb MFC after: 1 week
show more ...
|
#
69e6d7b7 |
| 12-Apr-2013 |
Simon J. Gerraty <sjg@FreeBSD.org> |
sync from head
|
#
d52d7aa8 |
| 21-Mar-2013 |
Attilio Rao <attilio@FreeBSD.org> |
Fix a bug in UMTX_PROFILING: UMTX_PROFILING should really analyze the distribution of locks as they index entries in the umtxq_chains hash-table. However, the current implementation does add/dec the
Fix a bug in UMTX_PROFILING: UMTX_PROFILING should really analyze the distribution of locks as they index entries in the umtxq_chains hash-table. However, the current implementation does add/dec the length counters for *every* thread insert/removal, measuring at all really userland contention and not the hash distribution.
Fix this by correctly add/dec the length counters in the points where it is really needed.
Please note that this bug brought us questioning in the past the quality of the umtx hash table distribution. To date with all the benchmarks I could try I was not able to reproduce any issue about the hash distribution on umtx.
Sponsored by: EMC / Isilon storage division Reviewed by: jeff, davide MFC after: 2 weeks
show more ...
|
#
876a84e8 |
| 18-Mar-2013 |
Martin Matuska <mm@FreeBSD.org> |
MFC @248461
|
#
1fc8c346 |
| 09-Mar-2013 |
Attilio Rao <attilio@FreeBSD.org> |
Improve UMTX_PROFILING: - Use u_int values for length and max_length values - Add a way to reset the max_length heuristic in order to have the possibility to reuse the mechanism consecutively witho
Improve UMTX_PROFILING: - Use u_int values for length and max_length values - Add a way to reset the max_length heuristic in order to have the possibility to reuse the mechanism consecutively without rebooting the machine - Add a way to quick display top5 contented buckets in the system for the max_length value. This should give a quick overview on the quality of the hash table distribution.
Sponsored by: EMC / Isilon storage division Reviewed by: jeff, davide
show more ...
|
Revision tags: release/9.1.0 |
|
#
300675f6 |
| 27-Nov-2012 |
Alexander Motin <mav@FreeBSD.org> |
MFC
|
#
e477abf7 |
| 27-Nov-2012 |
Alexander Motin <mav@FreeBSD.org> |
MFC @ r241285
|
#
a10c6f55 |
| 11-Nov-2012 |
Neel Natu <neel@FreeBSD.org> |
IFC @ r242684
|
#
23090366 |
| 04-Nov-2012 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Sync from head
|
#
ba4be211 |
| 28-Oct-2012 |
Davide Italiano <davide@FreeBSD.org> |
The fields of struct timespec32 should be int32_t and not uint32_t. Make this change.
Reviewed by: bde, davidxu Tested by: pho MFC after: 1 week
|
#
24bf3585 |
| 04-Sep-2012 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge head r233826 through r240095.
|
#
d7f97db7 |
| 12-Aug-2012 |
David Xu <davidxu@FreeBSD.org> |
Some style fixes inspired by @bde.
|
#
e8afbca2 |
| 11-Aug-2012 |
David Xu <davidxu@FreeBSD.org> |
tvtohz will print out an error message if a negative value is given to it, avoid this problem by detecting timeout earlier.
Reported by: pho
|
#
6a068746 |
| 15-May-2012 |
Alexander Motin <mav@FreeBSD.org> |
MFC
|
#
3d328873 |
| 30-Apr-2012 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge head r233826 through r234834.
|
#
38f1b189 |
| 26-Apr-2012 |
Peter Grehan <grehan@FreeBSD.org> |
IFC @ r234692
sys/amd64/include/cpufunc.h sys/amd64/include/fpu.h sys/amd64/amd64/fpu.c sys/amd64/vmm/vmm.c
- Add API to allow vmm FPU state init/save/restore.
FP stuff discussed with: kib
|
#
331805a5 |
| 15-Apr-2012 |
Davide Italiano <davide@FreeBSD.org> |
Fix some style bugs introduced in a previous commit (r233045)
Reported by: glebius, jmallet Reviewed by: jmallet Approved by: gnn (mentor) MFC after: 2 days
|
#
7ab97117 |
| 10-Apr-2012 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge head r233826 through r234091.
|
Revision tags: release/8.3.0_cvs, release/8.3.0 |
|
#
8931e524 |
| 05-Apr-2012 |
David Xu <davidxu@FreeBSD.org> |
In sem_post, the field _has_waiters is no longer used, because some application destroys semaphore after sem_wait returns. Just enter kernel to wake up sleeping threads, only update _has_waiters if i
In sem_post, the field _has_waiters is no longer used, because some application destroys semaphore after sem_wait returns. Just enter kernel to wake up sleeping threads, only update _has_waiters if it is safe. While here, check if the value exceed SEM_VALUE_MAX and return EOVERFLOW if this is true.
show more ...
|
#
17ce6063 |
| 05-Apr-2012 |
David Xu <davidxu@FreeBSD.org> |
umtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses a mutex after a thread has unlocked it, it event writes data to the mutex memory to clear contention bit, there is a race that oth
umtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses a mutex after a thread has unlocked it, it event writes data to the mutex memory to clear contention bit, there is a race that other threads can lock it and unlock it, then destroy it, so it should not write data to the mutex memory if there isn't any waiter. The new operation UMTX_OP_MUTEX_WAKE2 try to fix the problem. It requires thread library to clear the lock word entirely, then call the WAKE2 operation to check if there is any waiter in kernel, and try to wake up a thread, if necessary, the contention bit is set again by the operation. This also mitgates the chance that other threads find the contention bit and try to enter kernel to compete with each other to wake up sleeping thread, this is unnecessary. With this change, the mutex owner is no longer holding the mutex until it reaches a point where kernel umtx queue is locked, it releases the mutex as soon as possible. Performance is improved when the mutex is contensted heavily. On Intel i3-2310M, the runtime of a benchmark program is reduced from 26.87 seconds to 2.39 seconds, it even is better than UMTX_OP_MUTEX_WAKE which is deprecated now. http://people.freebsd.org/~davidxu/bench/mutex_perf.c
show more ...
|
#
8833b15f |
| 03-Apr-2012 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge head r232686 through r233825 into projects/pf/head.
|
#
8b1eafa7 |
| 31-Mar-2012 |
David Xu <davidxu@FreeBSD.org> |
Remove stale comments.
|
#
b29d7d9b |
| 30-Mar-2012 |
David Xu <davidxu@FreeBSD.org> |
Remove trailing semicolon, it is a typo.
|