From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by sourceware.org (Postfix) with ESMTPS id 583C43858D35 for ; Mon, 30 Aug 2021 12:55:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 583C43858D35 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 1MOzKk-1mdJ6C40Me-00PMLw for ; Mon, 30 Aug 2021 14:55:04 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 16092A80DB8; Mon, 30 Aug 2021 14:55:04 +0200 (CEST) Date: Mon, 30 Aug 2021 14:55:04 +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: <20210828184102.f2206a8a9e5fe5cf24bf5e45@nifty.ne.jp> <20210829180729.48b4e877f773cb3980c5766d@nifty.ne.jp> <20210830091314.f9a2cb71794d0f68cdb5eba7@nifty.ne.jp> <20210830092259.52f7d54fc3fa340738373af4@nifty.ne.jp> <20210830170204.fa91eaf110f310f13b67abc3@nifty.ne.jp> <20210830210423.00df7f37473b0ac1251e880f@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210830210423.00df7f37473b0ac1251e880f@nifty.ne.jp> X-Provags-ID: V03:K1:46GESg1PbufVSPyW2JE6U/QW5d8A06Pqyp3WWiV8NNo5p028TF6 o30kbOls+R4+TjwI6R4e4vrLEPCiT2C4t64W52aD/kNkXs+HpYExIodlSWbZRzzLfa0vlkg CfwTwalXNT4+swoVUMVOpUmeswudwch9P2UPfq5U268pgmPFdcAkzddgRdHSwvK3emJhyNQ ElCyBw8R4N2Cdt1MoX8Aw== X-UI-Out-Filterresults: notjunk:1;V03:K0:MA2xr/7o+Iw=:gm6x6oDY3qhb7tlE0Murcf sHsejZEm9+lT5Cq+OVLLVnhKp95qQ2XSvVS9xovj8Me9e8692eoyJzcGyo64q66VgbUsRTZgj /Oe5SOtLeVe8T8ia/bb8Zt77pWT/Ri4qILFlxwFKxTrTRljJ/fL+mb1w11xCn3jNtWJk7Lu77 22UHQm1J/I7oz0CUdkwLEFJZVnm8ahVMEX47XJSwpCXUUzvA65pq5q+Rr7GpljAUelPva5D44 CtHCIYLsySlCxWTl9s8eKwip72RsHiwHh6Yx+d73+BKS/1kf/zrhgnO7jg97ZJhoqzfZ0UILW cn+lxhxigPXHOFzd4GnY88IsKWnJyzh2yTpLiUDjk9ob4xXVDRJh6H0DTuNSOQELJis5yWa5g 8/eDbrBeaJMGkMyhOaFgaBW2USBTJNTHR5qLgArsp4cbraS1CEK7DsaQvqu3zUgbpPdXbB3Q8 7qf+431BYzGt7A8zKSylTTNcMCVaotzDIa4kAFTO9KDtvaQHliGrB2BTn0zK7qb47zGqLIbiL oRMyK2fYiT0O3hcuSGPZQMGrih2qbF8W4bgAZ1aRJ79zUx40uMNTd+l8e1tz6K61m3HEEHLQJ J1s0z6kOTRw1jx9e7SgLZokjj/kVyAUjS0zg/V/hR5u137PWmyVwBIIQFTrCMXAXgyYi5t3CM ILVsUqVCf94oqsCITJ2bogpDpGpegegrt6yL3gQRfy+d1zWHO/PZkKtw1myL3+2P0NOqRiS33 uG2oYhBlmu3C8FikqsCAP4wiV7JTXgwkyLHvLe2Jfi2bQfj9WglacJbN5So= X-Spam-Status: No, score=-100.0 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: Mon, 30 Aug 2021 12:55:17 -0000 On Aug 30 21:04, Takashi Yano wrote: > On Mon, 30 Aug 2021 12:20:30 +0200 > Corinna Vinschen wrote: > > [Move discussion to cygwin-developers] > > > > On Aug 30 17:02, Takashi Yano via Cygwin wrote: > > > [...] > > > Is naming the pipe really necessary? > > > > It's not, but CreatePipe is doing this anyway. > > > > "Anonymous pipes are implemented using a named pipe with a unique name." > > https://docs.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createpipe > > > > The reason CreateNamedPipe was used in the first place was that > > FILE_READ_ATTRIBUTES isn't set by CreatePipe for the write side > > of the pipe, however, it creates full duplex pipe: > > > > https://cygwin.com/pipermail/cygwin-patches/2004q3/004912.html > > > > Given the fact that CreatePipe is implemented in terms of > > NtCreateNamedPipeFile anyway, why should the pipe created with > > NtCreateNamedPipeFile fail where the pipe created with CreatePipe works? > > > > The only reason can be some missing flag, I think. Checking > > fhandler_pipe.cc::nt_create and comparing that with the default flags > > for files and other devices, it occurs to me that the SYNCHRONIZE stuff > > is missing. So, Takashi, what if you call NtCreateNamedPipeFile like > > this in nt_create: > > > > status = NtCreateNamedPipeFile (r, access | SYNCHRONIZE, &attr, &io, > > FILE_SHARE_READ | FILE_SHARE_WRITE, > > FILE_CREATE, FILE_SYNCHRONOUS_IO_NONALERT, > > pipe_type, FILE_PIPE_BYTE_STREAM_MODE, > > 0, 1, psize, psize, &timeout); > > > > Does that fix the above problems, too? > > Yes it does! Now, if CYGWIN=pipe_byte is also set, the piping issue > of C# program is gone! > > In fact, I've already tested adding the SYNCHRONIZE access flag, > but it didn't solve the problem. It seems that the cause was > that FILE_SYNCHRONOUS_IO_NONALERT was missing. > > Thank you for figuring out the solution! No worries. The same should apply to the NtCreateFile side of the pipe, btw. Corinna