From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by sourceware.org (Postfix) with ESMTPS id 4AF363858400 for ; Wed, 1 Sep 2021 08:13:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4AF363858400 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 (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MZTVu-1mWu793nWA-00WVIg for ; Wed, 01 Sep 2021 10:13:01 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 6F6E8A80D99; Wed, 1 Sep 2021 10:13:01 +0200 (CEST) Date: Wed, 1 Sep 2021 10:13:01 +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: <932300c9-2e09-5ee5-bbb1-3c060d33e3e1@cornell.edu> <474e1343-9cba-6b3c-b952-c92004968d8f@cornell.edu> <20210831175215.def1505083d496e164fe7ca7@nifty.ne.jp> <20210831200517.ad3088c901ac430346824bb3@nifty.ne.jp> <20210901113911.7fac8e3399319f311d691146@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:t6rMEL66KZH7if3ySW/uBzWkKrprw9/JUzmy7pGwqqy8+ImYJ8K wW4t6epY4ZB6Nxmi4CsnOXkPbsakm/yKzq/AmrvE7h8+cBRcwvkwwOK7Uav+iueTWopybEm pKUCyFnbzbwLMLfzRrJdBYGfmHC67j83dRkyF9QDfb/Z2OVO/Ok8Ex0ZPPuczRTif5muAoi batBuwpvHK0tMdIgcGepw== X-UI-Out-Filterresults: notjunk:1;V03:K0:9twUMKrOzcs=:PqHtZUF4xmqo2Hp3rCNKJe qhnrGdUMkDXgmt3eI9BNKdPLzoJV6p1Uxsz6rKfXsUZ4YwHA8Kf+Eio269QPKwJR5+IQIYblU sx/14aYfBL8M1ambkFT5gji2IZQ+gqTFVJNZbEztgiPGRSomB1WkK3kY/sbM3vW1kNOPKQk5u eqMPeSRt9oBRuBF5M0oY7PLMFv5EssxRlSjEDbZCvGXuqlHCwOT0X8l9sk02kqqJTcrANrc1i AFZl46Jw+pF7q1GTaQVBUJTkQzo1Sno0uT9bF6iHNWixKskv6IV4jzt7PsnPoDk21WjiHzoI6 2YVKN7kTSzP1MiOtkcyjhdENyTYkHKSzhZlT0L7hCvYMF8I36veB/LRIcg8D7t9RZee+H7t2Y XyxEkZP35wAYODxL173zZTXXpbHqIuBOKte09ru1c7RfZDrDVzfT0D/OWoWkFQCkACnKT6Yaq FL/cl0HGxCt1aoeD28aMovGFPBA9FN19fUk3+ZJiFtdMq8hMRYAwCrGk8yehrUyhDLJxzPqkL 3QYN6gaRcivEehXCnUc5gmzc0IrmUGnYazzrQhtVDIgBurWkDpty5jg31hDQT1H3gWpD7qgw8 V7+w1DcX9U1p55juLH0ClWWp0x1uLuXaMpk/JRTnD06tgHcyh2peXux4duIyfd3bhoTpPXOM9 8/SInGaGzbdGFwy4tzq7UxIOB73Cv1aA69woRtaXMtE8eMXHnruj8U6CvToEn/Me4erkoGVNp 0EQ8p5lX2g4eWZdodTAKRVbKHjQI+jfXYVHiZ211iPu2UW+s5mrfFgs2oPQ= X-Spam-Status: No, score=-100.1 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, 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, 01 Sep 2021 08:13:04 -0000 On Sep 1 10:03, Corinna Vinschen wrote: > On Sep 1 11:39, Takashi Yano wrote: > > On Tue, 31 Aug 2021 17:20:25 +0200 > > Corinna Vinschen wrote: > > > 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: > > > > > > 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. > > > > I confirmed the issue with FILE_SYNCHRONOUS_IO_NONALERT. > > There's, of course, a workaround. If you start a thread for each > synchronous ReadFile/WriteFile, you can cygwait in the caller for the > thread, rather than for the event object of the async IO. If a signal > or a thread cancellation request arrives, you can then call > CancelSynchronousIo on the ReadFile/WriteFile thread and wait for thread > termination. I implemented something along these lines in > fhandler_disk_file::mand_lock. > > Maybe something to consider? It would certainly fix the C# issue, > but I'm reluctant to do the thread juggle for each read/write. Oh, yeah, there's still the problem that NtQueryInformationFile on the read side hangs when called during a synchronous ReadFile, as I learned two days ago... Corinna