From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by sourceware.org (Postfix) with ESMTPS id B35E9386180A for ; Wed, 8 Sep 2021 09:26:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B35E9386180A Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mt7st-1nCi510fft-00tRXL for ; Wed, 08 Sep 2021 11:26:22 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 8270CA80D9E; Wed, 8 Sep 2021 11:26:21 +0200 (CEST) Date: Wed, 8 Sep 2021 11:26:21 +0200 From: Corinna Vinschen To: cygwin-developers@cygwin.com Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: <20210826062934.54f2f2216021c095bb7ba13b@nifty.ne.jp> <3b560051-ab27-f392-ca4b-d1fd9b5733b0@cornell.edu> <20210827202440.47706fc2fc07c5e9a1bc0047@nifty.ne.jp> <20210907122631.65452be8d021ec72259431d5@nifty.ne.jp> <20210907195023.31ad8194457bb90c2b6971b4@nifty.ne.jp> <20210908090748.3e70ed5aea3fa3c320b5ae0d@nifty.ne.jp> <20210908131141.bf63a795ce13c8dd8f5c13a8@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:6FSNlvZtTTvDSBvrV1NukYT07l08Ajl9Ql7ZdWcrYpd9Xw3ePzq LqOkySmTJekqWOrOIPVtVvcYGtrgoIjh1ATyAPXoj57Ks2qAasFGYQDhj7DKQ2xQRCFOYJJ c++rS7P9ACxFeyzzeJUUcy2c8vIvLEHYd2LuLffn6NJvHGt/KV5Huyt9fWVHQ35TrtZmgdW 6gDA3LahU+M68+2WxakWg== X-UI-Out-Filterresults: notjunk:1;V03:K0:SHis62tFkgg=:90jkonhAUOHbhKjamlUQxi rYmtCoUpSmtl2PQ+37XcuzIQ75+2OElCB4YCS0ekbuPXrHXROYl3XVbBpybOdYJ9nbodQiDCP IbBe81ArWQbuCd1MhWebdabIft7gv6Qckoq+ZBxfPeLtlSvG7zNS8jadxGt+EAUBmy4QrSYbY NpGjq7e2N/OYe5E2mYOobu8HbLND7l0TjQFwmAivwaA1pGl9lUEc53FlrdwQfYpPJETrn780r MxUmQHcU32qAm8D7TN9oMTeAmxLi7BAcm+mMSwUw00TGrujMcF9J7nI6Q+jWiBDWFQ1YUY5Ue hJ+Tr2PdQwSm5LNML0qy5DK/0Sl9qZSdNdPJgFiha59I16lz5jpuMo1/1SPlsyXK/PEvA98a6 yPLRYLmwHFHXRR+O8khW5/B69fVeIamYjgU1CL4k4RpwD6pyPslGmHdjeea+kDEXoPItftfiZ e+Bp551SPMffcWEWLV528DIgXGCih9+B8hBehrQSt6hgQZju9nHZ45LSRcvXV6WtVsrPv3sDL rNHgHNhl3HifcNq2/yEFBtyegAf+Gxo7VvRKNNYiMVKFI7hivNoov/4W9sWu/BMI0ilUgGXJt la4ZGo3ZVILjWjeFZaI3x2Ec2ck87yJLd9r1J1OskpuQnSW6LRLO2lzAtwCvr4diCAxMWVrO6 LRGJ0+4gfWLoXJGLJfEBTI0IbIgudU76XSFJ0xLJCv2J3rNsvkXDO+DLhqH1jE7mRqbxB8HVK jsPFy6o4zCKd8p8d0x/K+cQYYyCSynBv/WvRK8y80wz3uLzwbquNlvTsHKI= X-Spam-Status: No, score=-99.7 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 09:26:25 -0000 On Sep 8 11:01, Corinna Vinschen wrote: > On Sep 8 13:11, Takashi Yano wrote: > > On Wed, 8 Sep 2021 09:07:48 +0900 > > Takashi Yano wrote: > > > On Tue, 7 Sep 2021 19:50:23 +0900 > > > Takashi Yano wrote: > > > > > > > @@ -796,7 +792,8 @@ pipe_cleanup (select_record *, select_stuff *stuff) > > > > pi->stop_thread = true; > > > > SetEvent (pi->bye); > > > ~~~~~~~~~~~~~~~~~~~ > > > This is not correct. SetEvent() wakes-up one of thread_pipe()s, > > > but it may be other thread than one which should be stopped. > > > > > > > pi->thread->detach (); > > > > - CloseHandle (pi->bye); > > > > + if (me->fh->get_select_evt () == NULL) > > > > + CloseHandle (pi->bye); > > > > } > > > > delete pi; > > > > stuff->device_specific_pipe = NULL; > > > > > > I think it also should be > > > > + for (ULONG i = 0; i < get_obj_handle_count (select_evt); i++) > > > > + SetEvent (select_evt); > > > > > > Actually I want to use PulseEvent() here if it is not **UNRELIABLE**. > > > https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/28648-pulseevent-is-an-unreliable-function > > > > > > Does using semaphore object instead of event, and releasing > > > resources equal to the number of handles make sense? > > > > No it does not. One thread may consume semaphore multiple times.... > > What exactly is the problem in the code which results in high CPU > load? Can you explain this a bit? Maybe we need an entirely > different approach to avoid that. I saw your new patch, but I don't see the problem. I typed a lot of keys in mintty quickly and what happens is that the load of mintty goes up to 9% on a 4 CPU system, but only temporarily while typing. How do you reproduce the problem? Thanks, Corinna