Re: [PATCH 0/8] FIFO: bug fixes and small improvements

2020-08-04 Thread Corinna Vinschen
On Aug 4 08:54, Ken Brown via Cygwin-patches wrote: > The second patch in this series fixes a serious bug that has resulted > in observable hangs. The other patches are minor bug fixes or minor > performance improvements. > > Ken Brown (8): > Cygwin: FIFO: lock fixes > Cygwin: FIFO: fix timi

[PATCH 5/8] Cygwin: FIFO: don't read from pipes that are closing

2020-08-04 Thread Ken Brown via Cygwin-patches
Don't try to read from fifo_client_handlers that are in the fc_closing state. Experiments have shown that this always yields STATUS_PIPE_BROKEN, so it just wastes a Windows system call. Re-order the values in enum fifo_client_connect_state to reflect the new status of fc_closing. --- winsup/cygw

[PATCH 4/8] Cygwin: FIFO: reorganize some fifo_client_handler methods

2020-08-04 Thread Ken Brown via Cygwin-patches
Rename the existing set_state() to query_and_set_state() to reflect what it really does. (It queries the O/S for the pipe state.) Add a new set_state() method, which is a standard setter, and a corresponding getter get_state(). --- winsup/cygwin/fhandler.h | 9 -- winsup/cygwin/fhandl

[PATCH 3/8] Cygwin: FIFO: add a timeout to take_ownership

2020-08-04 Thread Ken Brown via Cygwin-patches
fhandler_fifo::take_ownership() is called from select.cc::peek_fifo and fhandler_fifo::raw_read and could potentially block indefinitely if something goes wrong. This is always undesirable in peek_fifo, and it is undesirable in a nonblocking read. Fix this by adding a timeout parameter to take_ow

[PATCH 6/8] Cygwin: FIFO: synchronize the fifo_reader and fifosel threads

2020-08-04 Thread Ken Brown via Cygwin-patches
The fifo_reader thread function and the function select.cc:peek_fifo() can both change the state of a fifo_client_handler. These changes are made under fifo_client_lock, so there is no race, but the changes can still be incompatible. Add code to make sure that only one of these functions can chan

[PATCH 0/8] FIFO: bug fixes and small improvements

2020-08-04 Thread Ken Brown via Cygwin-patches
The second patch in this series fixes a serious bug that has resulted in observable hangs. The other patches are minor bug fixes or minor performance improvements. Ken Brown (8): Cygwin: FIFO: lock fixes Cygwin: FIFO: fix timing issue with owner change Cygwin: FIFO: add a timeout to take_ow

[PATCH 8/8] Cygwin: FIFO: add a third pass to raw_read

2020-08-04 Thread Ken Brown via Cygwin-patches
Currently raw_read makes two passes through the list of clients. On the first pass it tries to read from the client from which it last read successfully. On the second pass it tries to read from all connected clients. Add a new pass in between these two, in which raw_read tries to read from all

[PATCH 7/8] Cygwin: FIFO: fix indentation

2020-08-04 Thread Ken Brown via Cygwin-patches
--- winsup/cygwin/fhandler_fifo.cc | 96 +- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 2b829eb6c..017d44e54 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fha

[PATCH 2/8] Cygwin: FIFO: fix timing issue with owner change

2020-08-04 Thread Ken Brown via Cygwin-patches
fhandler_fifo::take_ownership() tacitly assumes that the current owner's fifo_reader_thread will be woken up from WFMO when update_needed_evt is signaled. But it's possible that the the current owner's fifo_reader_thread is at the beginning of its main loop rather than in its WFMO call when that e

[PATCH 1/8] Cygwin: FIFO: lock fixes

2020-08-04 Thread Ken Brown via Cygwin-patches
Add some missing locks and remove one extra unlock. Clarify for some functions whether caller or callee acquires lock, and add appropriate comments. --- winsup/cygwin/fhandler_fifo.cc | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/winsup/cygwin/fhandl

Re: [PATCH] fhandler_proc.cc(format_proc_cpuinfo): add SERIALIZE instruction flag

2020-08-04 Thread Corinna Vinschen
On Aug 3 10:22, Brian Inglis wrote: > CPUID 7:0 EDX[14] serialize added in linux-next 5.8 by Ricardo Neri-Calderon: > The Intel architecture defines a set of Serializing Instructions (a > detailed definition can be found in Vol.3 Section 8.3 of the Intel "main" > manual, SDM). However, these instr

Re: [PATCH] fhandler_proc.cc(format_proc_cpuinfo): use _small_sprintf %X for microcode

2020-08-04 Thread Corinna Vinschen
On Aug 4 00:51, Brian Inglis wrote: > microcode is unsigned long long, printed by _small_sprintf using %x; > Cygwin32 used last 4 bytes of microcode for next field MHz, printing 0; > use correct _small_sprintf format %X to print microcode, producing > correct MHz value under Cygwin32 > --- > wins