From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by sourceware.org (Postfix) with ESMTPS id 319613858409 for ; Tue, 31 Aug 2021 15:20:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 319613858409 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 1MQvH5-1mffVm44Yh-00Nz7w for ; Tue, 31 Aug 2021 17:20:26 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 33628A80D9A; Tue, 31 Aug 2021 17:20:25 +0200 (CEST) Date: Tue, 31 Aug 2021 17:20:25 +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: <20210830170204.fa91eaf110f310f13b67abc3@nifty.ne.jp> <20210830210423.00df7f37473b0ac1251e880f@nifty.ne.jp> <932300c9-2e09-5ee5-bbb1-3c060d33e3e1@cornell.edu> <474e1343-9cba-6b3c-b952-c92004968d8f@cornell.edu> <20210831175215.def1505083d496e164fe7ca7@nifty.ne.jp> <20210831200517.ad3088c901ac430346824bb3@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210831200517.ad3088c901ac430346824bb3@nifty.ne.jp> X-Provags-ID: V03:K1:BmusJC3SPr2P5oq5Bh1fdPuo2YVdoY+144AX21u+BfABMq+AiGY 8mdU+9pE++cvBOz+bydvnnH+yFokGaQO7/qBPDU1uVrAp0l3uOCKrTvwn49xbhUnpOzoyEI rDApYPyX/2qr3aLC1m8cU80Vk8aNu2GadJjRrsi6laPMdL8Oz/OVSzgZzMAtSp0nrU0ALf7 EvJqTTIJ3sPqigFESQZmw== X-UI-Out-Filterresults: notjunk:1;V03:K0:B8Sp8PBucKQ=:/vP+oI3Htg8jglKS47FfaH 16gQpTBeZZdJuybxLCZnQ6Aw1O6J8jJuO1WBtFAm8MGOsc3gM6QI33vrXpFzXyEC6jLb4NS6v dS20AxLdGjvM1Lvr5aHWwesbWrIe9wtuGGrMkIl85VC55ZKAQdQRhOsqqetK36im3gm2N6LQZ aMfK4TbEEd3BJwLz8B/nIpoh3TRLd+7U7zenxY2aTA7/CnhyCHIF4XPRNAV1U35iGRQ4J62AI hUAdarQXxfMZUWdvPMKvVrkVYOI9Txa4KfPRz7P2p+PZC1tuZHJelI7iTDMaraLro/xzyIpMT kI9wY1rMM4TGucCdF6+9dA5RgldFZgDB1T/R782ipEkZdgezLUQkhqPHf+ZRn8l73pyN484E6 zXa8jCyclZD1+8BSUt+e4+wC94LGG9fGJ1zlG1YI49K7fIlFkeOEVSfhbd5uTpOIRXWutXW9j Gjh767Khm3Dzq78MMx3pryNMweXt1aD51ESLmSV3/xejYT+NwFqhf+4xhYT4dDeaTi/STcAyu PhSNBKe1CrwXF5ANRQ9O25l5q0S6H93NFYTZLSF6d48htnQMkZiBoFeeDZ2E/Ru9wvCSYI+fk 2lOAotmh0SOwU1DWbQH4Z1AiHhbIR86ezAwXE5FOGqCm4wTdr647XRx5tA7QM1LCgYBRDylUq UTHfI7cgJzTt6kI/SOOhuW7R3VvkTekrGYAPyfYoJ1x2OxXhM/y6Ab85j524j9mhpU1rXYgpw FqJKrotsRPscDdg0nyKk9if3B4h+i49kve1LHOL7LyIhsl2XlmsAX6vO1rQ= X-Spam-Status: No, score=-99.8 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, 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: Tue, 31 Aug 2021 15:20:28 -0000 On Aug 31 20:05, Takashi Yano wrote: > On Tue, 31 Aug 2021 11:04:05 +0200 > Corinna Vinschen wrote: > > On Aug 31 17:52, Takashi Yano wrote: > > > On Mon, 30 Aug 2021 17:19:44 +0200 > > > Corinna Vinschen wrote: > > > > On Aug 30 11:00, Ken Brown wrote: > > > > > On 8/30/2021 9:51 AM, Ken Brown wrote: > > > > > > On 8/30/2021 8:55 AM, Corinna Vinschen wrote: > > > > > > > On Aug 30 21:04, Takashi Yano wrote: > > > > > > > No worries.  The same should apply to the NtCreateFile side of the > > > > > > > pipe, btw. > > > > > > > > > > > > I'll add my thanks.  I should have checked the default flags that are > > > > > > typically used for other devices when I wrote nt_create.  I'm glad you > > > > > > caught this. > > > > > > > > > > > > So I'll reinstate the use of nt_create and then let Takashi recheck everything. > > > > > > > > > > I've done this now. I'm still not sure I've got all the flags right. For > > > > > unknown reasons, I've used FILE_SHARE_READ | FILE_SHARE_WRITE in the call to > > > > > NtCreateNamedPipeFile, and no sharing in the call to NtOpenFile. Should I > > > > > also use FILE_SHARE_READ | FILE_SHARE in NtOpenFile? Is sharing even > > > > > relevant in this context? > > > > > > > > This is only relevant if you want to open the pipe from another context, > > > > calling CreateNamedPipe/CreateFile. As long as the pipe is only > > > > duplicated, it shouldn't matter at all. > > > > > > > > But, as I just wrote in my previous mail, the FILE_SYNCHRONOUS_IO_NONALERT > > > > flag is probably a good thing for C# apps, but not for Cygwin, because it > > > > enforces synchronous operation. Sorry about that... > > > > > > With FILE_SYNCHRONOUS_IO_NONALERT, what kind of problems are you > > > specifically concerned about cygwin pipe? > > > > We're using asynchronous IO to be able to call WFMO and thus to be able > > to handle signals and thread cancellation events. Wit hsynchronous IO > > this is not possible. > > Thanks. How can I regenerate above issue? Stopping by Ctrl-C or killing > the process by kill seems to work even with FILE_SYNCHRONOUS_IO_NONALERT. It may depend on the thread you're running this in. But really, just call a blocking (SYNCHRONIZE + FILE_SYNCHRONOUS_IO_NONALERT) ReadFile in the main thread of a Cygwin app, and you'll see that neither Ctrl-C nor kill signalling will get through. > Where is the WFMO called for pipe handle? The cygwait function. Corinna