From nobody Sat May 4 05:34:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+42326+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42326+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1560406674; cv=none; d=zoho.com; s=zohoarc; b=BNGboJ+ep/fOPduRtIsQ+hLYov6eDEGwiqUvEvMC2e7r+Sv4ghj6ymuBZEho/kEI3whK8/KbmNEj29toLGnnh/ckw99skQDFO/SzGeKfo9eq5quDmZS2ts5jkASgBPWUWCz+KzSaYcfW+kW80P1SPWfY8WUAf86eMEWotXE941s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560406674; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=hrJlVT4n5dVa4OjL+LYvQ4+WNz/9mw0twLDv5AfqzLQ=; b=X9whmTMyJ8eL98lZ5cSyLYW3YzvXRZrVCb8GHvOfvaEPSel+zCccbPdEncZFX3osuabbO30lJS/ZVDbBHrGsK2vTp8N0RZTruA6aEY1nGQCqYD19IUvjVQZeXPlyBio56YaWOfo/EqijcwMP7/Wu5O/bS22iX0FG0VCVQBQRoUM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42326+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1560406674040100.45248841465718; Wed, 12 Jun 2019 23:17:54 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Wed, 12 Jun 2019 23:17:52 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 23:17:52 -0700 X-ExtLoop1: 1 X-Received: from cchiu4-mobl1.gar.corp.intel.com ([10.5.240.33]) by orsmga007.jf.intel.com with ESMTP; 12 Jun 2019 23:17:50 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Michael Kubacki , Nate DeSimone , Liming Gao Subject: [edk2-devel] [PATCH] Platform/Intel: Dynamic NUMBER_OF_PROCESSORS in build. Date: Thu, 13 Jun 2019 14:14:39 +0800 Message-Id: <20190613061439.10144-1-chasel.chiu@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1560406673; bh=QfJymeuOnEhfU4o5qt5Hj9VJXroTUnlhPymmWF6uSoo=; h=Cc:Date:From:Reply-To:Subject:To; b=Gmt1MrZ/B67/jrpmHCWejniA0PyBTHEzbFlfd9xLQlHaGCglIQRtVYzKUuSoZxMyEt+ Blyg9r7X50gW0GuZLQZswfybcM5BxcmHppjMH3PSSxO+mQT/my7F0cRc4xUQ9l8epr4E1 PJZ9eLRAQeq8RgNoQJ3VDxh2i2TLBndRVNo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1913 To improve build performance by default the maximum processors should be used for building. To support this, NUMBER_OF_PROCESSORS in build.cfg has new definition: 0 =3D AUTO. Maximum of processors will be used. non-zero =3D limit or force the number of processors. Test: tried several NUMBER_OF_PROCESSORS settings and the build parameter can be updated accordingly also builds successfully. Cc: Michael Kubacki Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Chasel Chiu Reviewed-by: Nate DeSimone --- Platform/Intel/build.cfg | 2 +- Platform/Intel/build_bios.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Platform/Intel/build.cfg b/Platform/Intel/build.cfg index 6c23e5eabc..fc6e4fe824 100644 --- a/Platform/Intel/build.cfg +++ b/Platform/Intel/build.cfg @@ -46,7 +46,7 @@ FSP_TEST_RELEASE =3D FALSE SECURE_BOOT_ENABLE =3D FALSE REBUILD_MODE =3D BUILD_ROM_ONLY =3D -NUMBER_OF_PROCESSORS =3D 1 +NUMBER_OF_PROCESSORS =3D 0 =20 =20 [PLATFORMS] diff --git a/Platform/Intel/build_bios.py b/Platform/Intel/build_bios.py index 09eceddeff..864511ac4d 100644 --- a/Platform/Intel/build_bios.py +++ b/Platform/Intel/build_bios.py @@ -21,6 +21,7 @@ import shutil import argparse import traceback import subprocess +import multiprocessing from importlib import import_module =20 try: @@ -345,7 +346,12 @@ def build(config): print(" BUILD_ROM_ONLY =3D ", config.get("BUILD_ROM_ONLY")) print("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D") =20 - command =3D ["build", "-n", config["NUMBER_OF_PROCESSORS"]] + NumberOfProcessors =3D config["NUMBER_OF_PROCESSORS"] + if config["NUMBER_OF_PROCESSORS"] =3D=3D "0": + # 0 means AUTO, maximum number of processors will be set + NumberOfProcessors =3D str(multiprocessing.cpu_count()) + print ("Number of processors set to " + NumberOfProcessors) + command =3D ["build", "-n", NumberOfProcessors] =20 if config["REBUILD_MODE"] and config["REBUILD_MODE"] !=3D "": command.append(config["REBUILD_MODE"]) --=20 2.13.3.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42326): https://edk2.groups.io/g/devel/message/42326 Mute This Topic: https://groups.io/mt/32049549/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-