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 40F84385840F for ; Fri, 3 Sep 2021 11:31:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 40F84385840F 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 1MRmsE-1mWg2I39QI-00T9My for ; Fri, 03 Sep 2021 13:31:08 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 397E1A80DE0; Fri, 3 Sep 2021 13:31:08 +0200 (CEST) Date: Fri, 3 Sep 2021 13:31:08 +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: <24138e20-aa97-cfea-bf48-198fc67755ea@cornell.edu> <9ba687eb-f4a0-18f8-b10b-76e7e51e123e@cornell.edu> <152bfc0c-2f72-c684-6fc5-aa7c36c136b8@cornell.edu> <20210903190046.663c60fb11c936e344821383@nifty.ne.jp> <20210903191340.c28ae366e79ca14799bacc1f@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210903191340.c28ae366e79ca14799bacc1f@nifty.ne.jp> X-Provags-ID: V03:K1:W+UvZXP1Vh0rfpSr44jINNyWNEgrhp8aJf7xpfjycsJ0o3iMNX+ jm5CiflwYO/14OODI7xx/zY8SjN/89rppncqsKt0GBiVROblZKnWGDasFN3BFP1sXnd+keT SG1SGvxl7/pniTpDg913FLC32OdRzqxLWcMG3sKdOQ1sRGw+N9/SsXAkVkiB/KDtERx/EHu DqXUWisVu9Pn8Df0tESIA== X-UI-Out-Filterresults: notjunk:1;V03:K0:dwh85lC4nVc=:HV1IaoKq9lxeC1psgViV1b eGGyRIT3EeW5F2MA2ziZOkvricubSz/BlmtS4ButHVo5xughnTajIKZlVFif8t25TwA8/mO2z qr13VoNRatWALN57WRl3hAmDWQQZh+lc/rYigsj1GwlYb7+F3a/ZwnlUywXE55HIby9IyNvQm HuTs2DAg5xtkK0FanSKrV6H6aQ7yZcgIeJMqzZuiAiFSnVouRHN3jNcz6UyPPROqNU0jJ1Pa2 DLrRRxuK7/696Z6kFm09X9znymP5Z6Rw82bvUYJge1rNfEsaXOpUIyAOb+sarbquQ5cjIuywy hjjBds4AqHbsca1wLnKugkn2NIYkMeKLhscz20X92iWE6YYLQpGg5yeUthh2tx9cO9gu5SPum N2i2zTqKTiCCb4U+a7HN5uPQryzDyziQL0q2NLP4Wx8Kiis1NPthrG/dlvgRAt2LPejMjgijA wDJK05VnUMxGVlvrr5RWHF8Ya7v66SX0fgyc/H0eOkss/Suklx71JDt7FNx8hC8c/bc3VE98P 02AhK7FmFym/vzFxShD3J1foigzTQjow4y8M76H8YJ7QrspmL94ODvLkQUeK1X7acPrAyPrI+ Crgkg+x8qXADEDFbWTAbgEoWDMMkehUOpCSDBY1JZTmmIilrXlFHN2uOmcbGuZbry27gsQgKo RzPgh6oWME8EiOYG5O5vjlqa69H+/oB2T7jF8ORaJqunJ34Gnm0IwuDzQebOEnVN7BbZZ5Dr8 DtBARD9sJPiNW5IC3qLNo1gO7Bz3fvHIT4Ox56w+tTLg6B4lwbbraumFG8s= 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_H3, RCVD_IN_MSPIKE_WL, 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: Fri, 03 Sep 2021 11:31:14 -0000 On Sep 3 19:13, Takashi Yano wrote: > On Fri, 3 Sep 2021 19:00:46 +0900 > Takashi Yano wrote: > > On Thu, 2 Sep 2021 21:35:21 +0200 > > Corinna Vinschen wrote: > > > On Sep 2 21:00, Corinna Vinschen wrote: > > > It's getting too late again. I drop off for tonight, but I attached > > > my POC code I have so far. It also adds the snippets from my previous > > > patch which fixes stuff Takashi found during testing. It also fixes > > > something which looks like a bug in raw_write: > > > > > > - ptr = ((char *) ptr) + chunk; > > > + ptr = ((char *) ptr) + nbytes_now; > > > > > > Incrementing ptr by chunk bytes while only nbytes_now have been written > > > looks incorrect. > > > > > > As for the reader, it makes the # of bytes to read dependent on the > > > number of reader handles. I don't know if that's such a bright idea, > > > but this can be changed easily. > > > > > > Anyway, this runs all my testcases successfully but they are anything > > > but thorough. > > > > > > Patch relativ to topic/pipe attached. Would you both mind to take a > > > scrutinizing look? > > > > Thanks. > > > > Your code seems that read() returns only the partial data even > > if the pipe stil has more data. Is this by design? > > > > This happes in both blocking and non-blocking case. > > The patch attached seems to fix the issue. I'm sorry, but I don't see what your patch is supposed to do in the first place. What I see is that it now calls NtQueryInformationFile even in the non-blocking case, which is not supposed to happen. I'm a bit puzzled what the actual bug is. The code changing len is only called if there's no data in the pipe. In that case we only request a partial buffer so as not to block the writer on select. If there *is* data in the pipe, it will just go straight to the NtReadFile code without changing len. Where's the mistake? Thanks, Corinna