From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on071d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::71d]) by sourceware.org (Postfix) with ESMTPS id 11C67388C025 for ; Fri, 28 Aug 2020 01:42:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 11C67388C025 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kTPwCi8Va/qKgghGSQB7cPhsyN4x3soXs7xVGAvCes1G951znwvS6ga7q9XivkCobg/r8IrrUD06wXfMQ/eorvP4AEUxqqH1SiPgkbN7LVvluVdUOJMkCl3AEAnuHCNuQYNGZ3eK2tlrw6PN7IJViHJrjrcOe+IuXQgtMDSNTwxXtO/Ca9P2yr+nNWvqUR2/uxK+gSvU3pgbpWTKpfSzl3lA5GnIhqlOvzml7WB2TEPnfNGmflxrbn2eqip5A1HxJcPzTP7FeKA35OhHw8Y6ljzHPKayAoXTeaBpH8zK1jCTdIzrnPQ6NDKiPU6eUufJxUqA7c2EEdASy/+euWWV1A== 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=wuGbxKjxqS5CIR3hD3CrMu8wzLwSfGezDRep9Njpi50=; b=OArr/Pjtjq3+DN+dJvazrc4xuoL/GXCQQWTwow9Dya1K2TYzlU4J2G2Gn5/uKFPmgQdljpkJAEasHsa5ya0Cicyrdbm+UI69Ovoc9vZe5weu8yTJC45Jp2MARYtZWinGC2ahrWGph0vhjEuAfy0ie5kJQtwLDbKBWgZolbmldtDpdiOF6ucdrnHf18elEIF9Y+dLuzAb9b2sEl8gdeeEDkzC5X3MlBqP7eyhrwUek6mpDK7H4XLIcqkWFwMl7F5aMsKfxbESm6VKnYsdX03MG9RZBkq00blPyQODnJnXFep3VCKYglpIT0mor9Tdj8ba8TVTB/sJY0FmdeVWWPYm+g== 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 Received: from MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) by MN2PR04MB6079.namprd04.prod.outlook.com (2603:10b6:208:de::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.21; Fri, 28 Aug 2020 01:42:50 +0000 Received: from MN2PR04MB6176.namprd04.prod.outlook.com ([fe80::184d:a265:1d48:499a]) by MN2PR04MB6176.namprd04.prod.outlook.com ([fe80::184d:a265:1d48:499a%7]) with mapi id 15.20.3305.032; Fri, 28 Aug 2020 01:42:49 +0000 Subject: Re: Sv: Limit for number of child processes To: sten.kristian.ivarsson@gmail.com, cygwin@cygwin.com References: <000401d67ba0$8b1f33b0$a15d9b10$@gmail.com> <20200826175724.GQ3272@calimero.vinschen.de> <000701d67c6c$10bcf720$3236e560$@gmail.com> From: Ken Brown Message-ID: <6d698a32-06bb-a47b-58e6-ceeecca722c9@cornell.edu> Date: Thu, 27 Aug 2020 21:42:48 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 In-Reply-To: <000701d67c6c$10bcf720$3236e560$@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR14CA0020.namprd14.prod.outlook.com (2603:10b6:610:60::30) 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 CH2PR14CA0020.namprd14.prod.outlook.com (2603:10b6:610:60::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.20 via Frontend Transport; Fri, 28 Aug 2020 01:42:49 +0000 X-Originating-IP: [2604:6000:b407:7f00:246a:b67a:c107:307] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9d4d89f-ec87-4d40-73ab-08d84af3abcd X-MS-TrafficTypeDiagnostic: MN2PR04MB6079: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: btAAW1cg/7tTjS8ddKfWNANjY1ilxIvENViyaSlV9Q2JCtkdW84e/yRkrEck/JfrUzuEu0Bn+1lctu/H/aTWdJpqAt0PRoLvUduzUJTEd8VQYXyw3b+4oT3o8xiP7qT37FyHK4+ayUxbBHjSu5wWy/MhcO7/aJqhyEWzstwaeUCkcpHDHrZ/E4WMx9qlItjcS5lu37JlHXloUBgJVwR2eN9nWCcb6Mx1Ql3JEUltaIsbrqdDegTgwOwzgbd46wJlhpnZYFDGHbHzV36SGRjxsFI80W2PyutUz3Yt89sJo9J3N96S6Ei/MsbPXB2j2u30RIU8gfoRp1QC2vQnf4sMAfQaIb52IRfpspNigO26/2K7BriRb7Go6ySqOdGzMKZn 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)(376002)(366004)(346002)(39860400002)(396003)(136003)(956004)(5660300002)(8676002)(83380400001)(16576012)(31696002)(478600001)(2616005)(31686004)(52116002)(66476007)(75432002)(66946007)(186003)(53546011)(86362001)(36756003)(316002)(786003)(66556008)(6486002)(8936002)(2906002)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: q6YCBftLACOHMrUFz0RC1TJrMmwAFeR5V9Z6agvoQ6wDy6lbgsnGN3KEQBL4l3eow5+5dx5gkowMi+uQSunj1hRUVRePTlxLlLOKacdcuW7GQhyY402eeDAWMiiFYH8bULWNFcP43PPvsU2J+KWbdI0MYd6mv+a3zJYX75Tr4DzHmN7JMQR8a15SZbSGWAVjSvYOEOBYAnwhNa9TqnfGEHu+Wuq15qRKk9W5QGYeQfEcZqkpnMllIk/1sLCf7OYgAT6la1uLs4fsS0bwBgqCJVvgERDkxfHhQSz5CAj5BlKg8EBpsd8sfhAhAgO+iU74FruIcwHteamHzo/0jY5sKNdl7GKWTQQazNZGECx33d3UZFoK8o0l1c2E2G7BpCJmGRWKqfjca6WsnpndbNxShHqpZH+YxbOzCDQ+2r3QgC38t/OdYO9oSzJW3boMA9zoAGBGVZVnwPajIWhuq8UcPYWuVRrsxq7nvxd/tL12SLR0N7WBnt5aWKJEe3SZdkuaqbvGX+oMeVQ5KQxCtWAz5j2TrxemFBvXadq+Mevqmm1414ULYdwkgaCW+p1ztcYijnlUUuO7tofi2FY1POrsV9HXKZc0zJRbwF7XHcG6smRgmOyY1EiRPcsAL4j/mIe4K+grkYn+Bzbem2yuN2RSVgujtDFvhKxJcHWOAtskCDz7E9Uh+w3KAhe0pogQpzeztLgrcAdpPJ+5cSeh+ITugg== X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: a9d4d89f-ec87-4d40-73ab-08d84af3abcd X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2020 01:42:49.5480 (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: 3V1VFHqBozv+C04uVbKwLTW7ODiZMTWtOMsi1RbFovCLGBEYbnrd4gZAQRd920l3D31+h/tI1sWiOIjTJXp8Gg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6079 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_ILLEGAL_IP, SPF_HELO_PASS, SPF_PASS, 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 01:42:56 -0000 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. Ken