cygrunsrv + sshd + rsync = 20 times too slow -- throttled?

Ken Brown kbrown@cornell.edu
Fri Sep 10 10:57:00 GMT 2021


Hi Takashi,

On 9/9/2021 8:42 AM, Takashi Yano wrote:
> On Thu, 9 Sep 2021 21:19:40 +0900
> Takashi Yano wrote:
>> On Thu, 9 Sep 2021 17:05:49 +0900
>> Takashi Yano wrote:
>>> On Thu, 9 Sep 2021 12:41:15 +0900
>>> Takashi Yano wrote:
>>>> diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
>>>> index 6709fb974..c40573783 100644
>>>> --- a/winsup/cygwin/fhandler_fifo.cc
>>>> +++ b/winsup/cygwin/fhandler_fifo.cc
>>>> @@ -1047,6 +1047,12 @@ writer_shmem:
>>>>     ResetEvent (writer_opening);
>>>>     nwriters_unlock ();
>>>>   success:
>>>> +  if (!select_sem)
>>>> +    {
>>>> +      char name[MAX_PATH];
>>>> +      __small_sprintf(name, "semaphore-%W", get_pipe_name ()->Buffer);
>>>> +      select_sem = CreateSemaphore (&sec_none, 0, INT32_MAX, name);
>>>> +    }
>>>>     return 1;
>>>>   err_close_reader:
>>>>     saved_errno = get_errno ();
>>>
>>> Should this be:
>>>> +      select_sem = CreateSemaphore (sa_buf, 0, INT32_MAX, name);
>>> ?
>>
>> I revised the patch a bit.
> 
> Sorry, I revised the patch again.

Thanks!  This is an amazing speed-up.  Here's what I see on my system:

Using the HEAD of topic/pipe:

$ ./fifo_test 0

Total: 100MB in 7.646128 second, 13.078515MB/s

$ ./fifo_test 1

Total: 100MB in 5.472798 second, 18.272189MB/s

$ ./fifo_test 2

Total: 100MB in 0.191965 second, 520.928837MB/s

$ ./fifo_test 3
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr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_test 0

Total: 100MB in 0.074328 second, 1345.391630MB/s

$ ./fifo_test 1

Total: 100MB in 0.062126 second, 1609.632038MB/s

$ ./fifo_test 2

Total: 100MB in 0.013286 second, 7527.003124MB/s

$ ./fifo_test 3
wwwwrrrrrrrrrr
Total: 100MB in 0.014044 second, 7120.326396MB/s

I need to study your patch a little more, but then I'll push it if I don't see 
any problems.

Thanks again.  This is great.

Ken

P.S. I wrote this yesterday before you sent further revisions, but I forgot to 
send it.  I'll recheck the latest version shortly.


More information about the Cygwin-developers mailing list