From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-05.nifty.com (conssluserg-05.nifty.com [210.131.2.90]) by sourceware.org (Postfix) with ESMTPS id C191C3857C7B for ; Wed, 15 Sep 2021 10:49:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C191C3857C7B Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from Express5800-S70 (z221123.dynamic.ppp.asahi-net.or.jp [110.4.221.123]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 18FAmvs7001499 for ; Wed, 15 Sep 2021 19:48:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 18FAmvs7001499 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1631702938; bh=KK6T4B1tPVoSURiQfOGrF38+dL2vMmEIn/3ufp4reGk=; h=Date:From:To:Subject:In-Reply-To:References:From; b=kQeFSyRvfJJyn8fSxHkqMlHevkzQSgWNBlYBUA3PGKHPvjBKaRQywDzFcjizKJMCs 4wai1Ymt0Yix1uUbuxZYA2mnGiKCTz9yn3S0IYLK1nF/anv075KRQ8DYx+sUE3GsIu EuEGxVOqHJeWCdEv81HXWX0tSIaD72FM/a3Hr4Z3CvIPAySA3Ah2AMdVoBJxfwXa7K sPuFki/cfMpfTQDD+pG+ZFTtGf7Dlia28IAc0hfl5aGORhwUbbPz8xq3gn3oJASNft JQ6XkRw4JvuR61SPEEDyKErQRpofiM9jKtUUakWGhBxLsa+LWF8zVBiNhZBOcgbukm eYjBQwfPIzH6A== X-Nifty-SrcIP: [110.4.221.123] Date: Wed, 15 Sep 2021 19:48:58 +0900 From: Takashi Yano To: cygwin-developers@cygwin.com Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? Message-Id: <20210915194858.845bcd54c0c63246b40703a8@nifty.ne.jp> In-Reply-To: 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> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 10:49:23 -0000 On Wed, 15 Sep 2021 11:57:44 +0200 Corinna Vinschen wrote: > On Sep 15 09:59, Takashi Yano wrote: > > @@ -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? I will check that. > Btw., this doesn't work as expected: > > $ yes | /cygdrive/c/Windows/System32/more > > It just hangs until pressing Ctrl-C. Is that expected currently? Indeed. However, this also does not work in cygwin 3.2.0, while yes AAAAAA | /cygdrive/c/Windows/System32/more works... I am not sure why so far. -- Takashi Yano