From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by sourceware.org (Postfix) with ESMTPS id 9CB183858407 for ; Mon, 13 Sep 2021 09:43:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CB183858407 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 (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MN5W9-1mg0Jz3Ijl-00J1S1 for ; Mon, 13 Sep 2021 11:42:58 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 418A2A80D76; Mon, 13 Sep 2021 11:42:58 +0200 (CEST) Date: Mon, 13 Sep 2021 11:42:58 +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: <33386baf-3b2d-d57f-2ad3-1bd328ed7935@cornell.edu> <20210911075734.aaf37697ba7db2ad14d911a3@nifty.ne.jp> <20210911113517.f74fc3ac1971bbf04c7a9bd1@nifty.ne.jp> <695ce1f4-4f7d-f3f3-6dd3-087467d67b28@cornell.edu> <20210912174849.3d38107568065a95aeb19c7c@nifty.ne.jp> <20210912200423.667e40eb1adc52461bbefa20@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Provags-ID: V03:K1:it4FlfrglzIedkvNp8epsl7mEA8Dt+dRMIdBCwMhU7+sJ6tIDIj 8nZc3u+PYRy0gbWPXGo6vcFqZdwqoHKfLlKI/qPFmp5gUFgBe23AEEsQTVl1cEt5IIKekNZ ja+gMQTOGws6lg4HTMqh4QataG9trSseZXb4D+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ONE, 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: Mon, 13 Sep 2021 09:43:02 -0000 [Guys, is it asked too much to trim your mails to the required context, rather than always performing a Full Quote? Pretty please...] On Sep 12 17:46, Ken Brown wrote: > On 9/12/2021 11:10 AM, Ken Brown wrote: > > On 9/12/2021 7:04 AM, Takashi Yano wrote: > > > On Sun, 12 Sep 2021 17:48:49 +0900 > > > Takashi Yano wrote: > > > > Hmm. Then, what about PoC code attached? This returns to Corinna's > > > > query_hdl, and counts read/write handles to detect closing reader side. > > > > > > > > If the number of read handles is equal to number of write handles, > > > > only the pairs of write handle and query_hdl are alive. So, read pipe > > > > supposed to be closed. > > > > > > > > This patch depends another patch I posted a few hours ago. > > > [...] > > I don't see how this solves the problem.  In the case we were worried > > about where we have a non-Cygwin reader, the writer has no query_hdl, > > and you're just always reporting write ready, aren't you?  Or am I > > missing something? > > BTW, we could just decide that always reporting write ready in this corner > case is acceptable. But then we could just do that without going back to > query_hdl. The problem with the corner case is, how to find out? You could have arbitrarily complex process trees with the pipe inherited by grand children, one of which is a non-Cygwin process. How does a Cygwin process tree member learn about that fact, if it didn't start the non-Cygwin process by itself? Looks like we have three choices: - Reintroducing query_hdl as in Takashi's patch. - select timeouts - always return "pipe writable" I think we might try Takashi's idea for as start, no? Didn't we also have a problem with C# in terms of non-blocking pipes? I wonder if we could just do the following: As soon as we spawn a non-Cygwin process, just call set_pipe_non_blocking(false) for all pipes. Blocking vs. nonblocking mode is a per-handle thingy anyway. What do you think? Corinna