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 67C85386F433 for ; Fri, 28 Aug 2020 08:35:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 67C85386F433 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=corinna-cygwin@cygwin.com Received: from calimero.vinschen.de ([217.91.18.234]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M4b5s-1kDEYZ1qPm-001lOu for ; Fri, 28 Aug 2020 10:35:53 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id B6D91A83A7B; Fri, 28 Aug 2020 10:35:51 +0200 (CEST) Date: Fri, 28 Aug 2020 10:35:51 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Sv: Limit for number of child processes Message-ID: <20200828083551.GF3272@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <000401d67ba0$8b1f33b0$a15d9b10$@gmail.com> <20200826175724.GQ3272@calimero.vinschen.de> <000701d67c6c$10bcf720$3236e560$@gmail.com> <6d698a32-06bb-a47b-58e6-ceeecca722c9@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6d698a32-06bb-a47b-58e6-ceeecca722c9@cornell.edu> X-Provags-ID: V03:K1:1R38VzyC8XW4oiyqklcNvbizoBBM+t/Pz3F/IMVfU97VO4UuhUH +f5+53slgCyS/WDXpJ1zFnj7hkQ00UN4USMq14UgJT3WEaJe12sOnKTxd4oBLp7LtM6gNUA lG12ZeTMz7Nq7xhN/WRe0RtaI5m51+Bwy6/lqnpvHRecWz6pq62q30U3QzIQNfTYLWqdC5j GvU+oT6hCpXovN8fHCCZg== X-UI-Out-Filterresults: notjunk:1;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MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 08:35:56 -0000 On Aug 27 21:42, Ken Brown via Cygwin wrote: > On 8/27/2020 8:17 AM, Kristian Ivarsson via Cygwin wrote: > > Hi Corinna > > > > > > Dear cygwin folks > > > > > > > > It seems like there's a limit of the number of possible child > > > > processes defined to 256 with 'NPROCS' in //winsup/cygwin/child_info.h > > > > used in 'cprocs' in //winsup/cygwin/sigproc.cc > > > > > > > > 256 is quite few possible children in an enterprise environment and > > > > perhaps the limit should be limited by the physical resources or > > > possibly Windows ? > > > > > > The info has to be kept available in the process itself so we need this > > > array of NPROCS * sizeof (pinfo). > > > > > > Of course, there's no reason to use a static array, the code could just as > > > well use a dynamically allocated array or a linked list. It's just not > > > the way it is right now and would need a patch or rewrite. > > > > > > As for the static array, sizeof pinfo is 64, so the current size of the > > > array is just 16K. We could easily bump it to 64K with NPROCS raised to > > > 1024 for the next Cygwin release, at least on 64 bit. > > > I don't think we should raise this limit for 32 bit Cygwin, which is kind > > > of EOL anyway, given the massive restrictions. > > > > I don't know the exact purpose of this and how the cprocs is used, but I'd > > prefer something totally dynamic 7 days out of 7 or otherwise another limit > > would just bite you in the ass some other day instead ;-) > > > > A linked list could be used if you wanna optimize (dynamic) memory usage but > > an (amortized) array would probably provide faster linear search but I guess > > simplicity of the code and external functionality is the most important > > demands for this choice > > Any change here (aside from just increasing NPROCS) would have to be done > with care to avoid a performance hit. I looked at the history of changes to > sigproc.cc, and I found commit 4ce15a49 in 2001 in which a static array > something like cprocs was replaced by a dynamically allocated buffer in > order to save DLL space. This was reverted 3 days later (commit e2ea684e) > because of performance issues. Yup, that's one of the problems to keep in mind. Corinna -- Corinna Vinschen Cygwin Maintainer