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 297953857815 for ; Wed, 15 Sep 2021 09:57:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 297953857815 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 (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MGi6m-1meFBa3UBe-00Dphe for ; Wed, 15 Sep 2021 11:57:44 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 2AC68A80D6A; Wed, 15 Sep 2021 11:57:44 +0200 (CEST) Date: Wed, 15 Sep 2021 11:57:44 +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: <20210914170838.6393026ac3eaa4cd4e3d9618@nifty.ne.jp> <20210914185623.0488635bf6d1e925baee5fe8@nifty.ne.jp> <20210914191924.5092f63762d62c88431b5313@nifty.ne.jp> <20210914210507.be6c950c948033704542bc42@nifty.ne.jp> <20210915092100.796985ae33039f3184483450@nifty.ne.jp> <20210915094454.42ef1d085d9bf92a1af8d39a@nifty.ne.jp> <20210915095911.415d174ea38fb2d2ea8e5432@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210915095911.415d174ea38fb2d2ea8e5432@nifty.ne.jp> X-Provags-ID: V03:K1:7mA8KMIy4T0JBAE9tfXCRPgJQZEI0yMsUX34KgENb/IGDuHdYbH 3zPqu6+/YmvCNabT9WLVnfJKlY4Rlm//whstzGZQ25X4x+5PNWDnSz7yfAfTgKtvptDyUyu CioIThKzWU7DZ0CE8BBwRaZPtebKsr1AlF4Sqao2ZuqWWnPTKyyjzfunUImSxY5aHbcQO2q a1DUVEc7KuKFZcQxrI7UA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZsEMLMCnnh0=:CPga/5eSJ1T1BXGRJwLohI aTMAkIcx9S3WkhqAJzSrBVy9pVNE4ESUopO9ztMz/Y5B+12givKszrYDp9JLzb1zMt6k5B0as 4mL/aiWoeMkEw8S8QwA/jbdjUnrQ4K/DLcOi+dfi8eMdWtaKQ3sNtEnN249PMKR3dItRV6cnR /ZX9eC93mZakvP5zDntZV1P4KYujEOYxmcGgpw5engW6gkThZQzWuPbXx+LsUlZC+MZf0K5Kv i/bBceIFGGF/Oy6ik7oCpy99M+L+fsvkyB/qsxbmKLuoGj8H9NK2lveOhfGR1BrtVpk4qPchU eyLpiBmSplcCCcxay5hx8xZQUiFjtHF8zrqUk2NxEaHEWw+voG2EwtdGDhbHXAxsnM6qZkxzj /aw0wWLvq8IJKaPI9kj7kLm40UYMKGIyG7v85XAYhaOIHxkvJ1A295gb+QEkCkMIp5v9/L0a0 BsNOLmPeMK/CU4KhAe+TWU2WKfN2iqt4fFToYwF+HFdnHUXFySElKZwQ/xukC7CoNTg46hyQG QlnXt3XzZAGDlVvS9Hw/LLYZZBX/GxkT80tECFq8n8ajxzgTukJjfCQIRjgmGvKTa7X+Yf0cf 3UgS5cCXAmzHzXYgt28obySDk1Coo34oqQacsZVxJ564Qmro24sHi0TWxW6xkc5KaKymbQTkL Lwf/JLshznYjI+Aa1hH4NYcBNYRgx/h2IlPYkJucNixEaGg5kVcCpM4eEfXsC4ap6IDJtCzKF xNhtwhjy384s5sQt4WHdPcYDREOqSjIrNXpZEe0KK5OWCHKIIzJkTOF095Q= X-Spam-Status: No, score=-99.6 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, 15 Sep 2021 09:57:47 -0000 On Sep 15 09:59, Takashi Yano wrote: > On Wed, 15 Sep 2021 09:44:54 +0900 > Takashi Yano wrote: > > On Wed, 15 Sep 2021 09:21:00 +0900 > > Takashi Yano wrote: > > > I have one patch attched. This make select() on pipe faster a bit. > > > > Revised a bit. > > Add missing error handling. Patch pushed, but I wonder... > @@ -633,17 +633,15 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h, bool writing) > /* Note: Do not use NtQueryInformationFile() for query_hdl because > NtQueryInformationFile() seems to interfere with reading pipes > in non-cygwin apps. Instead, use PeekNamedPipe() here. */ ...so we're not using NtQueryInformationFile on the query_hdl... > - if (fh->get_device () == FH_PIPEW) > + if (fh->get_device () == FH_PIPEW && fpli.WriteQuotaAvailable == 0) > { > HANDLE query_hdl = ((fhandler_pipe *) fh)->get_query_handle (); > - if (query_hdl) > - { > - DWORD nbytes_in_pipe; > - PeekNamedPipe (query_hdl, NULL, 0, NULL, &nbytes_in_pipe, NULL); > - fpli.WriteQuotaAvailable = fpli.InboundQuota - nbytes_in_pipe; > - } > - else > + if (!query_hdl) > + return 1; /* We cannot know actual write pipe space. */ > + DWORD nbytes_in_pipe; > + if (!PeekNamedPipe (query_hdl, NULL, 0, NULL, &nbytes_in_pipe, NULL)) > return 1; > + fpli.WriteQuotaAvailable = fpli.InboundQuota - nbytes_in_pipe; > } > if (fpli.WriteQuotaAvailable > 0) ...but we're unconditionally using NtQueryInformationFile at the start of pipe_data_available. If this is the read side of the pipe, isn't there a chance that another (non-Cygwin) process is performing a blocking read and this call will hang? Btw., this doesn't work as expected: $ yes | /cygdrive/c/Windows/System32/more It just hangs until pressing Ctrl-C. Is that expected currently? Corinna