From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by sourceware.org (Postfix) with ESMTPS id 8965D3858407 for ; Wed, 8 Sep 2021 09:01:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8965D3858407 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 (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MYNS0-1mSj3549EA-00VLcA for ; Wed, 08 Sep 2021 11:01:54 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id EE59EA80D9E; Wed, 8 Sep 2021 11:01:52 +0200 (CEST) Date: Wed, 8 Sep 2021 11:01:52 +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: <20210825201845.07b6400b79dc5558a7761efe@nifty.ne.jp> <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: <20210908131141.bf63a795ce13c8dd8f5c13a8@nifty.ne.jp> X-Provags-ID: V03:K1:iipG1FLv8C6Sx3xEk7nsA3FCFFnHlqGxKht4MDezuCmU9QTzidD KlgoqpFLTXHS7FOnZAM9osEcvyqgSfnkw/Ue8RDr/qgekLTBr7KYBBbfkYUO4o4rke6Wdth U6DTGd5adbh+32sfVR4E2w3j4cORVnw55uL1MIN22xsPRwcgm7NA6aX/THvMxvUA5GWl7Ug Bks8q/sm/QqKZN68VQSBw== X-UI-Out-Filterresults: notjunk:1;V03:K0:tHfEdpTOgcY=:xgpv0O1jyzqv/g1bN3n6Fr YRd3buouX5KcrYyIO8SCgzpIJersSAzatYzAfa49nJH3cbNJbP7yYBhpDwqtJG1D2diuBgwNu 96msh90ko7b9mxbDGN7tH8dfHI9cmzJylgbU61hJHM6H7id64QD872IBy0EeUzmVCeMasMDt6 HBjcqkx1NPga22MZGoPZsbNZSVVq4p6WdfAz8xjWI0enWyUCn9b4WSApicft5Es+aCUShDqvU nl0Y+ByhCOyJnNVyUpSynvzyXB5NylJ9Hd0h0qvQNHhPw/sO6MiQuENWJru/sQi3iEW0rZUvd sUGcx6IRXPaHGfRQSbQ/fcfYmYARtkqJD0jbYnJu19Dowqt+PS23FMiobgj2CgZrN5XF/c7qb T9/MKdmMNHPWTBsgz0kG7BcvoWKvxPQXVMDc2GlHBFU5Oz4cyTr3vlBhCKQuobrOoBbDpfJeA kVVL05DYPB+XLausfIYh0cbHQt8DGjhqegat8Im7RWyDxuRSif9tuSAuQoyK+qxoYsmg4q2kw 70ITFxWSK5SC8eNDRgXNGRXGnEBnLMRe7ErRQgwd6wzQNmS8UoUN6TmS1oEY5V7vl7A+/6ivz 87ZD0cYJ3VOonFPIIoVWi+WLc5IMqZIHRicysQZWhJjo4srvS4M+/JlAWWxGuENtTngk9ovg1 Tu6uUHeRGcXJwgZ5PIFsc+AN6Px7laMloqM3Fjj7VlqnDI2GN9ukuPy3LY1WtKSJoXXycJklj EomCf0plNO13O4n7cB9uhQdBHVV6fSUpmK+ZvI7dYQyLXPiQ7Ckw12IRKqw= X-Spam-Status: No, score=-100.0 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, 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:02:00 -0000 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. Corinna