From patchwork Tue Jan 11 15:34:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1578544 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JYFBR0Q7Kz9s9c for ; Wed, 12 Jan 2022 02:35:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7421882A71; Tue, 11 Jan 2022 16:35:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id B825580FDA; Tue, 11 Jan 2022 16:35:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id B08DD80FDA for ; Tue, 11 Jan 2022 16:34:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C705A1FB; Tue, 11 Jan 2022 07:34:58 -0800 (PST) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.196.172]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 06C823F774; Tue, 11 Jan 2022 07:34:57 -0800 (PST) From: Andre Przywara To: Tom Rini , Simon Glass Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH] genboardscfg: limit to 240 jobs Date: Tue, 11 Jan 2022 15:34:50 +0000 Message-Id: <20220111153450.912230-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean When genboardscfg.py is run on machines with 255 or more cores, the process will consume more than 1024 file descriptors, which is a common standard ulimit for user processes. As a consequence it will fail with a lenghty Python trace, with the almost hidden message: OSError: [Errno 24] Too many open files It's somewhat questionable whether that level of parallelity is actually useful for genboardscfg, so we limit the *default* number of jobs to the safe number of 240, to avoid the problem. If a user persists, she can still force a higher number via the -j parameter - hopefully having raised the ulimit accordingly beforehand. Signed-off-by: Andre Przywara Reviewed-by: Heinrich Schuchardt Reviewed-by: Simon Glass Reviewed-by: Simon Glass --- tools/genboardscfg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py index 4ee7aa1f89..07bf681d1d 100755 --- a/tools/genboardscfg.py +++ b/tools/genboardscfg.py @@ -430,7 +430,7 @@ def main(): # Add options here parser.add_option('-f', '--force', action="store_true", default=False, help='regenerate the output even if it is new') - parser.add_option('-j', '--jobs', type='int', default=cpu_count, + parser.add_option('-j', '--jobs', type='int', default=min(cpu_count, 240), help='the number of jobs to run simultaneously') parser.add_option('-o', '--output', default=OUTPUT_FILE, help='output file [default=%s]' % OUTPUT_FILE)