CVSROOT:        /cvs
Module name:    src
Changes by:     v...@cvs.openbsd.org    2020/10/25 04:55:42

Modified files:
        sys/kern       : subr_log.c 
        sys/sys        : msgbuf.h 

Log message:
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@

Reply via email to