From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m0.truegem.net (m0.truegem.net [69.55.228.47]) by sourceware.org (Postfix) with ESMTPS id D91FC3858D39 for ; Tue, 21 Sep 2021 21:10:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D91FC3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maxrnd.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=maxrnd.com Received: (from daemon@localhost) by m0.truegem.net (8.12.11/8.12.11) id 18LLAZF8005342 for ; Tue, 21 Sep 2021 14:10:35 -0700 (PDT) (envelope-from mark@maxrnd.com) Received: from 162-235-43-67.lightspeed.irvnca.sbcglobal.net(162.235.43.67), claiming to be "[192.168.1.100]" via SMTP by m0.truegem.net, id smtpdde4jl6; Tue Sep 21 14:10:30 2021 Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? To: cygwin-developers@cygwin.com References: <20210909211940.51ef391e27d43f0421962cb8@nifty.ne.jp> <20210909214246.cd1ff1a3062fea27e51ad4ae@nifty.ne.jp> <33386baf-3b2d-d57f-2ad3-1bd328ed7935@cornell.edu> <933038b4-7dc9-485f-ac87-598cedb00fc5@maxrnd.com> <20210921191038.ede0cd89201103b6ff7c42c3@nifty.ne.jp> From: Mark Geisert Message-ID: <2ab2d97a-1af7-7483-8ef7-165637f0c98c@maxrnd.com> Date: Tue, 21 Sep 2021 14:10:30 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: <20210921191038.ede0cd89201103b6ff7c42c3@nifty.ne.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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, 21 Sep 2021 21:10:39 -0000 Takashi Yano wrote: > On Tue, 21 Sep 2021 09:26:09 +0000 (UTC) > Mark Geisert wrote: >> Sep 21, 2021 1:31:28 AM Takashi Yano : >>> On Mon, 20 Sep 2021 17:39:54 -0400 >>> Ken Brown wrote: >>>> I'll push it tomorrow unless you find something that needs to be changed before >>>> then. >>> >>> * Add name check when cached information is used. >>> * Confirm Name.Buffer returned by NtQueryObject() is not NULL. >>> * Add error check for HeapAlloc(). >>> >> Sorry if this is a dumb question, but why HeapAlloc? If the buffer is only needed temporarily wouldn't alloca work? Or malloc? > > This function (temporary_query_hdl()) is called within a system call, > so calling another system call from it is not good idea I think. > For example, errno may be changed by malloc(). I've now had a chance to look at the surrounding code and I have no big issue with it. It's just uncommon to see HeapAlloc/HeapFree used within the Cygwin DLL because blocks allocated with it won't be free-able in the child after a fork. But for short-term use guaranteed to be localized in-process like what you're doing I guess it's OK. Carry on! ..mark