X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23C6B3894C38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1598617760; bh=u4SeF2Diy6PJJOSQXE+HpOg5qO40ZPxmLXp6KrnC5bA=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Hi808QXzNesnrt8GJniKgyJ+nVGuJ6Q4TiCB2TU/57WJ+7vTUZB8kScCx4LaNb5uz cxk9iLjxYMGFU9SIVeiT02Bv01cubXdQ4hQb7dDng5vWSh23tHv1C9n3XOOFUOfIV3 tGF3ZrmIaCGoXBf2vsd7FRs6D4smy04amta88AwA= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7402B3857009 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fw2EvTKearM+ANiqblTNMG1HiQpCRAXHeiXPhYE7GBIntpwBz0cpHZ04WU2mawWCchdPOLOoCr6KLyH3sj67HqahdWdZZXwbnwUrZsEIARhlf0E7lHnlQ3OWt07otN8C80d+FjYO6NrfhE1/eeKLDrldgQwDWtgZmV1cBz+p5iJEqdTYedKszKHc/e0+TgSGAaMkrUFR4Y3xSUESmRGv75LNiMPI7MSkzc5oJvCChI8Bt379eLBh2ofMlkxzP9rfXUtFyXAibGCwnoD6VQ+8XUukGTl1y+/w7EB3vslMCXnzXfuStGSqAPEykgXj1Ay0XpdhyBg4Kk400tFVsqY1QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+gdZQCM1Dl2IIY8UF57nyQWBw9P1Akxlri1NNetG3sE=; b=dUMfixBdDr5Hvci9tjqmMzqLVV/ekOhhBpRYEjc3jQmKrc+EE96k1Iw9M7ewpnbrq9o+IrHTf5QF4iVeNgatlx7CQpAyxpS4vFFcqLu1pFtllFAHz+rYsdaspkMiGsu6EkdcU6fSjtW4+FdMzT+mOUr9Y8MT36zAoxAOpi3+eQ+okkyKU613UlKRDKPwFCu9bqTs93RA3VrSfI3ixMFBq9Re17oJzWqcQiNPgjARUtHZYmettvbIRgjMUIZondVth3jKSz4+rYAf9tWrgzYCk3LuPmjULItNJ/M5toL/xWblqg7AUufQ/Ca9iRYkc8nRuxtuaOrFWNNVLJm8tnwjmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none Subject: Re: Sv: Sv: Limit for number of child processes To: sten DOT kristian DOT ivarsson AT gmail DOT com, cygwin AT cygwin DOT com References: <000401d67ba0$8b1f33b0$a15d9b10$@gmail.com> <20200826175724 DOT GQ3272 AT calimero DOT vinschen DOT de> <000701d67c6c$10bcf720$3236e560$@gmail.com> <6d698a32-06bb-a47b-58e6-ceeecca722c9 AT cornell DOT edu> <001101d67d16$aa5db9f0$ff192dd0$@gmail.com> Message-ID: <6242991f-e5ec-150b-bd6c-15a8c348c7cf@cornell.edu> Date: Fri, 28 Aug 2020 08:29:13 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 In-Reply-To: <001101d67d16$aa5db9f0$ff192dd0$@gmail.com> Content-Language: en-US X-ClientProxiedBy: MN2PR16CA0020.namprd16.prod.outlook.com (2603:10b6:208:134::33) To MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by MN2PR16CA0020.namprd16.prod.outlook.com (2603:10b6:208:134::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Fri, 28 Aug 2020 12:29:14 +0000 X-Originating-IP: [2604:6000:b407:7f00:246a:b67a:c107:307] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fd6e647e-620e-47b3-773e-08d84b4df9a3 X-MS-TrafficTypeDiagnostic: MN2PR04MB5646: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AgPxQ39FUOOZBYdH/ga8Mib4yatwX40uXzcRd+OxUZLQsE1uDvhHDrpwyJTYy7C4lBlIAREbnhGWrvqX4VtOuUip/9uwmyPGTCbXtCPIyW6wrbYJXA77R7KcGIWdT4oorxS8NfaZVFA0KP8LesYK4PwDvB2oV8wKPAZFCpyMdBgnFeepe6wpqDvLXQlUstax4S6zwU/kwrwCxXd+RMXjNUPBUCxJgSv1bZxT+GT6pK51FXSJFTpolZMRJZXrSMmX+xXtdccHF1NuSyB7nfDg3UMTchhGGRVTiGn5bk5gMM1njDAq3c11KGTlvnNDSfkoyvusTyhY9EPN3xaO/46MGb4LjFFiU8UNaktuJMTl8enWX+r/2QBC+D4fjNOs1Lyp X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR04MB6176.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(366004)(396003)(376002)(136003)(346002)(36756003)(8676002)(956004)(2616005)(2906002)(186003)(478600001)(8936002)(66556008)(31696002)(86362001)(66946007)(66476007)(52116002)(316002)(75432002)(83380400001)(6486002)(31686004)(5660300002)(53546011)(786003)(16576012)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: V1BCHuOJYJJqWmEV/ltbtlkzpxUb0dEh72PyGvn7Jsu1UPOenVAJPZ6sgfRPb1lnlQ6YGAhTAJTDyJ9sGxCWgqC3eJXG4NCAVR2rFIf8lI9VHSgiLseYO2LuLpkoUvfBPY48OLRrT7sZR5TRCJ044PVSQdeixudX2Fut1TZegZI4KVMSJKUsH/K5cC+d9v43mMybDvOpsHGv2ap2PxwRSHFvvGjh3Dy10gx2OJbUEjiMTa4P08eszJJdH9WpbTCgTQ89rC+i6FFBqpMDf1werGoZFqYpHWzjs9mhZqfSoflqTD7dz751r/TVnVx6XiEKNghJPFCacOJgLkym3moSZEko/1uN4MFlP1PVZan+MZVbKOhzrggcpgOgOuROe5Ma/XQEFhGNqeDSkrMjOqDWJOjFz2kEkDhD3dN08weBzoaUKPqzw+MBvJaqvAZtwLI0M+6/CMQg28VeSPX3ZnLWyjuMdEx2QHugEMS7LN8fZCgxYlh3jwRoK81gIWSjxfce2V/2KT6hTJsoBlEko3GlmfzVQJSFD3+pZKYM7lVzzjLT2ShYPzKpmnEgIsRhtGTCFXIxKBOMqvQZxMTlv2/wr0UBPHlXyw51oFVDzbCARW4apyiK54dkiRH2MD6V2NnNcJn87poIizQ0wQjAqAh6rlta5frnp92IFZGEeOELotffI2Kx6o6wIN8MBEHuk4DdDT3tmtuNLEWzTQd1XH639Q== X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: fd6e647e-620e-47b3-773e-08d84b4df9a3 X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2020 12:29:14.8158 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S6uB6IY8W/pjbheQGQOA0T2PWDdB7L2xsdFKuHKvn9TnpJmccyn0LtoX5E1Zx9pxsYk7zMzs0Jm9vO5+NgSb+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5646 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_ILLEGAL_IP, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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 AT cygwin DOT 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: , From: Ken Brown via Cygwin Reply-To: Ken Brown Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" On 8/28/2020 4:38 AM, sten DOT kristian DOT ivarsson AT gmail DOT com 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. > > > I wonder what kind of performance issue ? Nevertheless, that old commit > didn't make the number of possible children more dynamic though, when it was > still restricted to NPROCS (or ZOMBIEMAX/NZOMBIES), it was just not > allocated on the stack. But yes, accessing dynamic allocated memory can > theoretically be slower than stack allocated memory, but without measuring > it one cannot tell ;-) Todays hardware is pretty good at prefetching etc, > but as I said, it needs measurements I don't know for sure, but I doubt if it had anything to do with memory access. My guess is that the performance hit came from the need to free the allocated memory after every fork call (see sigproc_fixup_after_fork). Ken -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple