Age | Commit message (Collapse) | Author |
|
stacks; report by Antoine Jacoutot; ok kurt@
|
|
|
|
applications that install their own thread stack red-zones with mprotect
PROT_NONE from entering the malloc pool when the pages are freed.
- round up requested thread stack size to closest page boundary to
simplify the red-zone calculations.
okay brad@
|
|
Adjust design of file descriptor table to eliminate races
with both opening and closing of file descriptor entries
and eliminates one class of deadlocks. One nice side effect
of this change in design should be better performance for
applications that open and close many file descriptors due
to reduced fd_table_lock contention and fd entry reuse.
- Add entry states to manage use of entry and eliminate
some closing races. fd entries are not deallocated upon
close() now.
- Call _thread_fd_table_init with one of five discreet
modes to properly initialize an entry and manage the
state transition to open.
- When closing an entry hold the entry spinlock locked
across the state transition and the _thread_sys_close
call to close another race.
- Introduce a new lock type FD_RDWR_CLOSE that transitions
either a closed entry or an open entry into closing state
and then waits for a RDWR lock so that the lock queue can
unwind normally. All subsequent fd lock attempts for that
entry are rejected with EBADF until the fd is fully closed,
or reopened by dup2(). Once a thread holds the FD_RDWR_LOCK
it is safe to close() it or dup2() on it.
- When a thread creates a new fd there is a window of time
when another thread could attempt to use the fd before the
creating thread has initialized the entry for it. This can
result in improper status_flags for the entry, so record
the entries init mode, detect when this has happened and
correct the status_flags when needed.
reviewed by marc@ & brad@, tested by several, okay brad@
|
|
|
|
File status flags should be shared for dup'ed file descriptors.
However fd_table_entry's should not be shared for dup'ed file
descriptors so they can be independently be closed without
interfering with dup'ed fd's.
- split out file status flags into its own structure
fs_flags to manage sharing of status flags between
dup'ed file descriptors.
- when duplicating a fd, initialize a new fd_table_entry
for the new fd, but share the status flags via status_flags.
- consolidate the code that sets the underlying system fd
to be non-blocking to a new function _thread_fs_flags_init()
- consolidate the code that sets the underlying system
fd back to blocking into a new function _thread_fs_flags_replace()
This change is needed as a prerequisite to the coming race
and deadlock corrections. okay marc@
|
|
instructions once every few runs. Problem noted by Botond Botyanszki.
ok marc@
|
|
to cast away constness whenever we want to pass in a string that is
already const -- we copy the string if we want to use it, so having it
be non-const in the first place does not make any sense.
From tholo@
ok tedu@
|
|
it need to be matched with a call to _thread_machdep_restore_float_state(),
so add missing one in _thread_machdep_init().
- 16-byte align fp frame
- call fwait() before save and and after restoring fp state.
lots of guidance and ok mickey@
|
|
suggested by kjell@; ok otto@ pat@ millert@ jaredy@
|
|
weak functions; ok millert@.
|
|
originally reported by Gergely Kovacs; help from dhartmei@;
ok tedu@ millert@
|
|
prevents userland from causing an overflow of tv_sec. okay marc@
|
|
|
|
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable
|
|
OK deraadt@
|
|
|
|
|
|
|
|
because of an unacceptable license:
the file was originally written by david leonard, who has kindly agreed
to us putting a (public domain) license on it: the original page did not
contain any license. thanks david.
this also includes some tweaks by me, so it does not exactly match
revision 1.2.
|
|
|
|
- Remove the macros MUTEX_TYPE_FAST and MUTEX_TYPE_COUNTING_FAST.
From stefanf FreeBSD
ok fgsch@
|
|
|
|
|
|
|
|
|
|
From FreeBSD
'looks ok' fgsch@ miod@
man page reviewed by jmc@
|
|
otto@'s diff for uvm_aobj.c.
Identical to a diff canacar@ developed independantly.
ok brad@ 'looks correct' fgsch@
|
|
otto@'s diff for uvm_aobj.c.
ok deraadt@ pedro@
|
|
patrick@
|
|
these functions seem never to have existed, and are certainly not
documented in pthread_mutexattr(3), the page to which they point.
|
|
- where two functions are documented in the same page, make sure we don;t
reference them both in SEE ALSO. kind of annoying to call up a second man
page and find it's the same as the last one (even more annoying to not
realise two pages are the same till you've finished reading twice ;)...
|
|
from freebsd pr #73887;
ok marc@
|
|
|
|
Solves a problem where select/poll calls would return early
without indicating any error. Tested by otto@ and kurt@ -- thanks.
|
|
ok marc@
|
|
From FreeBSD
ok marc@
|
|
* plug a memory leak and FD_UNLOCK properly in writev
ok marc
|
|
|
|
Patch from Kurt Miller <truk at optonline.net>
Commit reminder from millert@. OK brad@
|
|
|
|
|
|
|
|
To build you must:
cd /usr/src && make obj && make includes
cd lib/libc && make depend && make && NOMAN=1 sudo make install
cd /usr/src && make build
|
|
|
|
|
|
particular implementation of libpthread for libc. libc no longer
needs pthread.h to compile.
OK millert@, brad@, tedu@
|
|
|
|
|
|
Kurt Miller <truk at optonline.net>. Kurt says:
They're needed for the java hotspot compiler in the 1.3+ jdk
OK brad@
|