From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-05.nifty.com (conssluserg-05.nifty.com [210.131.2.90]) by sourceware.org (Postfix) with ESMTPS id B97B2385841B for ; Mon, 18 Oct 2021 12:02:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B97B2385841B Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from Express5800-S70 (z221123.dynamic.ppp.asahi-net.or.jp [110.4.221.123]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 19IC2IgK015341 for ; Mon, 18 Oct 2021 21:02:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 19IC2IgK015341 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1634558538; bh=0WmzXfy/9iNuE9cD6tO77vdp6dEP1Sdm2Sv3bz/HNts=; h=Date:From:To:Subject:In-Reply-To:References:From; b=MSceynCgyom6NW7MCvY32xfBkxveOvb/T5PRiR4rUjRGN02D6ocU0JxyQlf1RJArv cyrtP/gJyn/8vCVMo8qRo4WCCey28+iOYh/0qet5guDS3vikVff719OCNgutW6qALO T9fTTkom2O6CPt1f7/TPSjnSdXrteaHHtc3KORohQv3ppm6lbqoNkLxfeSg4UeOkrH KWtIQ21H2qpbVFqhvCa4T5Q0nI5cpNJaKHGHhh4ycDEO73RBvGh9VzaDu9yKSTkmWQ E94wxmp/O7QM1UoPTWH40lKmfHZVBHNf1nl50R+4C4jqWVUIcOwynDWh0Ut+nSgOd9 DBTjuXzPen2GA== X-Nifty-SrcIP: [110.4.221.123] Date: Mon, 18 Oct 2021 21:02:31 +0900 From: Takashi Yano To: cygwin-developers@cygwin.com Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? Message-Id: <20211018210231.a10c2fe9aea003d21094e073@nifty.ne.jp> In-Reply-To: References: <61adb3e0-9ef5-50ee-d422-6ee718d633c8@cornell.edu> <20210921082230.4e7f2421c729c0f74b4a8cfe@nifty.ne.jp> <20210921173035.d3f61cb132b7dab80fed352c@nifty.ne.jp> <682e0f1f-7a5e-be88-6f96-32284423bc94@cornell.edu> <20210922003614.3a39a2e91632a58105a99fde@nifty.ne.jp> <20210923172601.8fcd5304f606b96377ce75f0@nifty.ne.jp> <20210924000318.d5a248f6efb4362eda6fa243@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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, 18 Oct 2021 12:02:35 -0000 Hi Corinna, On Mon, 18 Oct 2021 12:51:37 +0200 Corinna Vinschen wrote: > The patch looks basically ok, but we shouldn't use PSAPI calls inside > Cygwin. I'm a bit fuzzy on the details, but we had some problems with > PSAPI way back when. > > One of them, prominently, is the fact that the entry points have changed > in the past. EnumProcess from psapi.dll is now k32_EnumProcess from > kernel32.dll or whatever, since the headers are using PSAPI_VERSION 2 as > default. Linking against that will break Vista. If you change this to > PSAPI_VERSION 1, OTOH, you will have to add the psapi symbols to > autoload.cc. > > Why don't you just use winpids, as in: > > winpids pids; > pids.set (true); > for (int i = 0; i < pids.npids; ++i) > ... > pids.reset (); > > This will use NtQuerySystemInformation (SystemProcessInformation) under > the hood. Of course, winpids adds a bit of unnecessary overhead by > checking for procinfo stuff, so maybe you may want to use > NtQuerySystemInformation (SystemProcessInformation) directly and > just copy/paste the minimally required code from the `else' branch in > winpids::enum_processes. Thanks for reviewing the code. I will make a patch which replaces EnumProcesses() with NtQuerySystemInformation (SystemProcessInformation). -- Takashi Yano