Age | Commit message (Collapse) | Author |
|
|
|
signal), don't jump to unlocked_error: and do things that we don't need
to do (including messing up the internal state of the pipe). Just return.
ok niklas@ miod@
|
|
encapsulating all such access into wall-defined functions
that makes sure locking is done as needed.
It also cleans up some uses of wall time vs. uptime some
places, but there is sure to be more of these needed as
well, particularily in MD code. Also, many current calls
to microtime() should probably be changed to getmicrotime(),
or to the {,get}microuptime() versions.
ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others
"Oh, that is not your problem!" from miod@
|
|
testing for quite some time by brad + otto
|
|
- when allocating or growing a pipe buffer is not possible, do not panic
but report the error and handle it correctly. (1.73)
- "The pipe_write() code was locking the pipe without busying it first
in certain cases, and a close() by another process could potentially rip
the pipe out from under the (blocked) locking operation." (from Al Viro,
1.81)
- "Remove test in pipe_write() which causes write(2) to return EAGAIN
on a non-blocking pipe in cases where select(2) returns the file
descriptor as ready for write. This in turns causes libc_r, for
one, to busy wait in such cases.
Note: it is a quick performance fix, a more complex fix might be
required in case this turns out to have unexpected side effects."
(1.141)
|
|
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK
|
|
|
|
the same semantics as NetBSD anyway, so it's good to avoid name collissions.
- Always fdremove before freeing the file, not the other way around.
- falloc FREFs the file.
- have FILE_SET_MATURE FRELE the file (It feels like a good ortogonality to
falloc FREFing the file).
- Use closef as much as possible instead of ffree in error paths of
falloc:ing functions. closef is much more careful with the fd and can
deal with the fd being forcibly closed by dup2. Also try to avoid
manually calling *fo_close when closef can do that for us (this makes
some error paths mroe complicated (sys_socketpair and sys_pipe), but
others become simpler (sys_open)).
|
|
well (not at all) with shortages of the vm_map where the pages are mapped
(usually kmem_map).
Try to deal with it:
- group all information the backend allocator for a pool in a separate
struct. The pool will only have a pointer to that struct.
- change the pool_init API to reflect that.
- link all pools allocating from the same allocator on a linked list.
- Since an allocator is responsible to wait for physical memory it will
only fail (waitok) when it runs out of its backing vm_map, carefully
drain pools using the same allocator so that va space is freed.
(see comments in code for caveats and details).
- change pool_reclaim to return if it actually succeeded to free some
memory, use that information to make draining easier and more efficient.
- get rid of PR_URGENT, noone uses it.
|
|
(Look ma, I might have broken the tree)
|
|
any anyone. Every caller of falloc matures the fd when it's usable.
- Since every lookup in the fd table must now check this flag and all of
them do the same thing, move all the necessary checks into a function -
fd_getfile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- use pool for allocating pipe structures.
- use microtime instead of splhigh and time.
- improve locking.
- better handling of nonblocking.
- various efficiency fixes.
|
|
|
|
Also add a stat function for kqueue from FreeBSD.
|
|
|
|
|
|
okay deraadt@, millert@
from jlemon@freebsd.org:
extend kqueue down to the device layer, backwards compatible approach
suggested by peter@freebsd.org
|
|
okay art@, millert@
|
|
and out.
Make pread/pwrite in netbsd & linux thread safe - which is the whole point
anyway.
|
|
|
|
|
|
EWOULDBLOCK. turns out the two checking conditions were not the same,
and a certain use of rsync uncovered the bug by chewing all available
cpu time; fix from art
|
|
|
|
We never used it and some parts of it slowed the code down.
Generally clean up the pipe code.
|
|
|
|
|
|
sure that the fd_freefile hints stay in sync, otherwise free file
descriptors might not be overlooked by fdalloc(); ok millert@
|
|
|
|
|
|
that EFAULT return value is possible
|
|
|
|
|
|
|
|
This allows this code to compile on sparc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
given by -Wall -Wstrict-prototypes -Wmissing-prototypes
|
|
The old pipes can be used with the "OLD_PIPE" config option.
|