From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by sourceware.org (Postfix) with ESMTPS id 1A12A3858402 for ; Tue, 14 Sep 2021 09:03:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A12A3858402 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 (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N8G6I-1muv2R424G-014BM0 for ; Tue, 14 Sep 2021 11:03:40 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 2D743A80D65; Tue, 14 Sep 2021 11:03:39 +0200 (CEST) Date: Tue, 14 Sep 2021 11:03:39 +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> <20210914043718.f420491c6723f3dc2e2d9753@nifty.ne.jp> <20210914170838.6393026ac3eaa4cd4e3d9618@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210914170838.6393026ac3eaa4cd4e3d9618@nifty.ne.jp> X-Provags-ID: V03:K1:oLp23x3MnNWeqt+/FHfCg4NUYK+NDyW5NgU3BKIcoMesN4IvqBJ jpEOx5oLKvEOdHLR1A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F_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, 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: Tue, 14 Sep 2021 09:03:43 -0000 On Sep 14 17:08, Takashi Yano wrote: > @@ -54,8 +54,12 @@ fhandler_pipe::set_pipe_non_blocking (bool nonblocking) > FILE_PIPE_INFORMATION fpi; > > fpi.ReadMode = FILE_PIPE_BYTE_STREAM_MODE; > - fpi.CompletionMode = nonblocking ? FILE_PIPE_COMPLETE_OPERATION > - : FILE_PIPE_QUEUE_OPERATION; > + /* If query_hdl is set, write pipe should check reader_closed() > + while raw_read(). If the pipe is blocking, raw_write() stops > + at NtWriteFile() and loses the chance to check it. Therefore, > + always set write pipe to non-blocking. */ > + fpi.CompletionMode = (nonblocking || query_hdl) > + ? FILE_PIPE_COMPLETE_OPERATION : FILE_PIPE_QUEUE_OPERATION; > status = NtSetInformationFile (get_handle (), &io, &fpi, sizeof fpi, > FilePipeInformation); > if (!NT_SUCCESS (status)) I don't quite follow the argument. Blocking pipes are using asynchronous IO, so they are in fact not blocking calls on the OS level. After calling NtWriteFile, the blocking variation will go into the subsequent waitret = cygwait (evt, INFINITE, cw_cancel | cw_sig); So, wouldn't you get the same effect by keeping the pipe in FILE_PIPE_QUEUE_OPERATION mode and just add a timeout to the above cygwait call and handle select_sem in a not yet existing WAIT_TIMEOUT conditional? Corinna P.S.: Maybe the cygwait call is just too simple. It would be nice if it had been defined to take an array of handles, rather than just a single handle. Another change we should keep in mind.