#
b9ae17a0 |
| 30-Dec-2024 |
guenther <guenther@openbsd.org> |
All the device and file type ioctl routines just ignore FIONBIO, so stop calling down into those layer from fcntl(F_SETFL) or ioctl(FIONBIO) and delete the "do nothing for this" stubs in all the *ioc
All the device and file type ioctl routines just ignore FIONBIO, so stop calling down into those layer from fcntl(F_SETFL) or ioctl(FIONBIO) and delete the "do nothing for this" stubs in all the *ioctl routines.
ok dlg@
show more ...
|
#
97390b9a |
| 24-Jul-2024 |
claudio <claudio@openbsd.org> |
Use a different mutex to protect the kqueue klist in logsoftc.
knote_locked() will call wakeup() and with it the SCHED_LOCK and by that makes log_mtx no longer a leaf lock. By using an own lock for
Use a different mutex to protect the kqueue klist in logsoftc.
knote_locked() will call wakeup() and with it the SCHED_LOCK and by that makes log_mtx no longer a leaf lock. By using an own lock for the klist we can keep log_mtx a leaf lock and with that printf(9) can be used in most contexts again. OK mvs@
show more ...
|
#
3f55e363 |
| 22-Sep-2023 |
mvs <mvs@openbsd.org> |
Make `logread_filterops' MP safe. For that purpose use `log_mtx' mutex(9) protecting message buffer.
ok bluhm
|
#
f2e7dc09 |
| 14-Jul-2023 |
claudio <claudio@openbsd.org> |
struct sleep_state is no longer used, remove it. Also remove the priority argument to sleep_finish() the code can use the p_flag P_SINTR flag to know if the signal check is needed or not. OK cheloha@
struct sleep_state is no longer used, remove it. Also remove the priority argument to sleep_finish() the code can use the p_flag P_SINTR flag to know if the signal check is needed or not. OK cheloha@ kettenis@ mpi@
show more ...
|
#
b2536c64 |
| 28-Jun-2023 |
claudio <claudio@openbsd.org> |
First step at removing struct sleep_state.
Pass the timeout and sleep priority not only to sleep_setup() but also to sleep_finish(). With that sls_timeout and sls_catch can be removed from struct sl
First step at removing struct sleep_state.
Pass the timeout and sleep priority not only to sleep_setup() but also to sleep_finish(). With that sls_timeout and sls_catch can be removed from struct sleep_state.
The timeout is now setup first thing in sleep_finish() and no longer as last thing in sleep_setup(). This should not cause a noticeable difference since the code run between sleep_setup() and sleep_finish() is minimal.
OK kettenis@
show more ...
|
#
1525749f |
| 02-Jul-2022 |
visa <visa@openbsd.org> |
Remove unused device poll functions.
Also remove unneeded includes of <sys/poll.h> and <sys/select.h>.
Some addenda from jsg@.
OK miod@ mpi@
|
#
87131069 |
| 18-Mar-2021 |
mvs <mvs@openbsd.org> |
Unlock sendsyslog(2). Console output still requires kernel lock to be held but this path is only followed while `syslogf' socket is not set.
New `syslogf_rwlock' used to protect `syslogf' access.
o
Unlock sendsyslog(2). Console output still requires kernel lock to be held but this path is only followed while `syslogf' socket is not set.
New `syslogf_rwlock' used to protect `syslogf' access.
ok bluhm@
show more ...
|
#
5fc6fc53 |
| 09-Mar-2021 |
bluhm <bluhm@openbsd.org> |
Early daemons like dhcpleased(8), slaacd(8), unwind(8), resolvd(8) are started before syslogd(8). This resulted in ugly sendsyslog(2) dropped logs and the real message was lost. Create a temporary s
Early daemons like dhcpleased(8), slaacd(8), unwind(8), resolvd(8) are started before syslogd(8). This resulted in ugly sendsyslog(2) dropped logs and the real message was lost. Create a temporary stash for log messages within the kernel. It has a limited size of 100 messages, and each message is truncated to 8192 bytes. When the stash is exhausted, the well-known dropped message is generated with a counter. After syslogd(8) has setup everything, it sends a debug line through libc to flush the kernel stash. Then syslogd receives all messages from the kernel before the usual logs. OK deraadt@ visa@
show more ...
|
#
436960cf |
| 08-Feb-2021 |
mpi <mpi@openbsd.org> |
Simplify sleep_setup API to two operations in preparation for splitting the SCHED_LOCK().
Putting a thread on a sleep queue is reduce to the following:
sleep_setup(); /* check condition or release
Simplify sleep_setup API to two operations in preparation for splitting the SCHED_LOCK().
Putting a thread on a sleep queue is reduce to the following:
sleep_setup(); /* check condition or release lock */ sleep_finish();
Previous version ok cheloha@, jmatthew@, ok claudio@
show more ...
|
#
51fe48f9 |
| 08-Jan-2021 |
visa <visa@openbsd.org> |
Fix boot-time crash on sparc64
On sparc64, initmsgbuf() is invoked before curcpu() is usable on the boot processor. Consequently, it is unsafe to use mutexes during the message buffer initialization
Fix boot-time crash on sparc64
On sparc64, initmsgbuf() is invoked before curcpu() is usable on the boot processor. Consequently, it is unsafe to use mutexes during the message buffer initialization. Avoid such use by skipping log_mtx when appending a newline from initmsgbuf().
Use mbp instead of msgbufp as the buffer argument to the putchar routine for consistency.
Bug reported and fix suggested by miod@
show more ...
|
#
9b0cf67b |
| 25-Dec-2020 |
visa <visa@openbsd.org> |
Refactor klist insertion and removal
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remai
Refactor klist insertion and removal
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists.
Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification.
OK mpi@
show more ...
|
#
1c34178b |
| 25-Oct-2020 |
visa <visa@openbsd.org> |
Serialize msgbuf access with a mutex.
This introduces a system-wide mutex that serializes msgbuf operations. The mutex controls access to all modifiable fields of struct msgbuf. It also covers logso
Serialize msgbuf access with a mutex.
This introduces a system-wide mutex that serializes msgbuf operations. The mutex controls access to all modifiable fields of struct msgbuf. It also covers logsoftc.sc_state.
To avoid adding extra lock order constraints that would affect use of printf(9), the code does not take new locks when the log mutex is held.
The code assumes that there is at most one thread using logread(). This keeps the logic simple. If there was more than one reader, logread() might return the same data to different readers. Also, log wakeup might not be reliable with multiple threads.
Tested in snaps for two weeks.
OK mpi@
show more ...
|
#
b85522ab |
| 18-Aug-2020 |
visa <visa@openbsd.org> |
Fix kn_data returned by filt_logread().
Take into account the circular nature of the message buffer when computing the number of available bytes. Move the computation into a separate function and us
Fix kn_data returned by filt_logread().
Take into account the circular nature of the message buffer when computing the number of available bytes. Move the computation into a separate function and use it with the kevent(2) and ioctl(2) interfaces.
OK mpi@
show more ...
|
#
f0e956f0 |
| 18-Aug-2020 |
visa <visa@openbsd.org> |
Remove an unnecessary field from struct msgbuf.
OK mvs@
|
#
9c969c9a |
| 07-Apr-2020 |
visa <visa@openbsd.org> |
Abstract the head of knote lists. This allows extending the lists, for example, with locking assertions.
OK mpi@, anton@
|
#
b8213689 |
| 20-Feb-2020 |
visa <visa@openbsd.org> |
Replace field f_isfd with field f_flags in struct filterops to allow adding more filter properties without cluttering the struct.
OK mpi@, anton@
|
#
1bae1a4b |
| 11-Jan-2020 |
mpi <mpi@openbsd.org> |
Convert infinite sleeps to tsleep_nsec(9).
ok bluhm@
|
#
36b1b8b4 |
| 08-Jan-2020 |
visa <visa@openbsd.org> |
Unify handling of ioctls FIOSETOWN/SIOCSPGRP/TIOCSPGRP and FIOGETOWN/SIOCGPGRP/TIOCGPGRP. Do this by determining the meaning of the ID parameter inside the sigio code. Also add cases for FIOSETOWN an
Unify handling of ioctls FIOSETOWN/SIOCSPGRP/TIOCSPGRP and FIOGETOWN/SIOCGPGRP/TIOCGPGRP. Do this by determining the meaning of the ID parameter inside the sigio code. Also add cases for FIOSETOWN and FIOGETOWN where there have been TIOCSPGRP and TIOCGPGRP before. These changes allow removing the ID translation from sys_fcntl() and sys_ioctl().
Idea from NetBSD
OK mpi@, claudio@
show more ...
|
#
43311663 |
| 02-Jan-2020 |
claudio <claudio@openbsd.org> |
Change /dev/log to use pgsigio(9) and sigio_init(9) like it was done for bpf(4) and tun(4) instead of using hand rolled code using csignal(). OK visa@
|
#
94321eb4 |
| 31-Dec-2019 |
visa <visa@openbsd.org> |
Use C99 designated initializers with struct filterops. In addition, make the structs const so that the data are put in .rodata.
OK mpi@, deraadt@, anton@, bluhm@
|
#
6ce17bc7 |
| 24-Dec-2019 |
bluhm <bluhm@openbsd.org> |
The console buffer is allocated during startup. initconsbuf() is only called from main(). There allocation must not fail, so better use M_WAITOK and remove error handling. As it is not a temporary
The console buffer is allocated during startup. initconsbuf() is only called from main(). There allocation must not fail, so better use M_WAITOK and remove error handling. As it is not a temporary buffer, M_TTYS is more appropriate. OK deraadt@ mpi@
show more ...
|
#
c85dcd2d |
| 24-Oct-2019 |
visa <visa@openbsd.org> |
Make log tick interval independent of hz and reduce the frequency so that the timeout would not be scheduled on every tick.
Discussed with and OK mpi@
|
#
ca6b003f |
| 20-Jun-2019 |
visa <visa@openbsd.org> |
Work around locking issues in logwakeup(). Instead of actually waking up waiters, just set a flag in logwakeup(). The flag is later noted through periodic polling. This lets the wakeup code run with
Work around locking issues in logwakeup(). Instead of actually waking up waiters, just set a flag in logwakeup(). The flag is later noted through periodic polling. This lets the wakeup code run with sufficient locking.
logwakeup() is a very tricky place to take locks because the function can be called in many different contexts. By not requiring locks in the routine helps to keep printf(9) as usable as possible.
OK mpi@
show more ...
|
#
baa0698d |
| 17-Jun-2019 |
guenther <guenther@openbsd.org> |
dosendsyslog() must only pass ktrgenio(9) userspace buffers that it can use copyin() on. While here: just put the struct iovec for ktrace on the stack instead of mallocing and freeing it.
problem d
dosendsyslog() must only pass ktrgenio(9) userspace buffers that it can use copyin() on. While here: just put the struct iovec for ktrace on the stack instead of mallocing and freeing it.
problem debugged by patrick@ ok deraadt@ mpi@
show more ...
|
#
4a4dc3ea |
| 30-Jul-2018 |
mpi <mpi@openbsd.org> |
Use FNONBLOCK instead of SS_NBIO to check/indicate that the I/O mode for sockets is non-blocking.
This allows us to G/C SS_NBIO. Having to keep the two flags in sync in a mp-safe way is complicated
Use FNONBLOCK instead of SS_NBIO to check/indicate that the I/O mode for sockets is non-blocking.
This allows us to G/C SS_NBIO. Having to keep the two flags in sync in a mp-safe way is complicated.
This change introduce a behavior change in sosplice(), it can now always block. However this should not matter much due to the socket lock being taken beforhand.
ok bluhm@, benno@, visa@
show more ...
|