From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: bob.c.feng@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Thu, 13 Jun 2019 00:39:20 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2019 00:39:20 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 13 Jun 2019 00:39:20 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 13 Jun 2019 00:39:19 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 13 Jun 2019 00:39:19 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.104]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.188]) with mapi id 14.03.0415.000; Thu, 13 Jun 2019 15:39:17 +0800 From: "Bob Feng" To: "devel@edk2.groups.io" , "Chiu, Chasel" CC: "Kubacki, Michael A" , "Desimone, Nathaniel L" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH] Platform/Intel: Dynamic NUMBER_OF_PROCESSORS in build. Thread-Topic: [edk2-devel] [PATCH] Platform/Intel: Dynamic NUMBER_OF_PROCESSORS in build. Thread-Index: AQHVIa/NVst21dj/akijSf44vkVkQqaZMIrg Date: Thu, 13 Jun 2019 07:39:17 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D16014EB05@SHSMSX101.ccr.corp.intel.com> References: <20190613061439.10144-1-chasel.chiu@intel.com> In-Reply-To: <20190613061439.10144-1-chasel.chiu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Chasel, Patch looks good. For the process number, build.py does the same thing as this patch. If pas= s -n 0 to build.py, build.py will set the processor number to multiprocessi= ng.cpu_count() Thanks, Bob -----Original Message----- From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Chiu= , Chasel Sent: Thursday, June 13, 2019 2:15 PM To: devel@edk2.groups.io Cc: Kubacki, Michael A ; Desimone, Nathaniel = L ; Gao, Liming Subject: [edk2-devel] [PATCH] Platform/Intel: Dynamic NUMBER_OF_PROCESSORS= in build. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1913 To improve build performance by default the maximum processors should be u= sed 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 --- 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 6c2= 3e5eabc..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 i= ndex 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"]) -- 2.13.3.windows.1