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.93, mailfrom: chasel.chiu@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Thu, 13 Jun 2019 01:33:25 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2019 01:33:25 -0700 X-ExtLoop1: 1 Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by fmsmga007.fm.intel.com with ESMTP; 13 Jun 2019 01:33:24 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.51]) by KMSMSX152.gar.corp.intel.com ([169.254.11.195]) with mapi id 14.03.0415.000; Thu, 13 Jun 2019 16:23:54 +0800 From: "Chiu, Chasel" To: "Feng, Bob C" , "devel@edk2.groups.io" 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/NZOqFGHyNHUOeEj1YqPe40aaZMIrggAAOF5A= Date: Thu, 13 Jun 2019 08:23:54 +0000 Message-ID: <3C3EFB470A303B4AB093197B6777CCEC503457C3@PGSMSX111.gar.corp.intel.com> References: <20190613061439.10144-1-chasel.chiu@intel.com> <08650203BA1BD64D8AD9B6D5D74A85D16014EB05@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <08650203BA1BD64D8AD9B6D5D74A85D16014EB05@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjU0NGM3NGUtZmQ4ZS00NTk1LTg5OGEtZDRjYTI5NDdhOGYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOWNuMFwvcklvNkxoelNcL1wvZ3lTaDZqNU9kSlFQaFlZbE5vdTk4VWZ0anhcL3hMRCtzVXJvbThmXC9ITm9JcDR2a3IyIn0= x-ctpclassification: CTP_NT x-originating-ip: [172.30.20.205] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Bob! I was not aware that BaseTools already handled this. I just verified and it works so I will update code review which will only = touch build.cfg. Thanks! Chasel > -----Original Message----- > From: Feng, Bob C > Sent: Thursday, June 13, 2019 3:39 PM > To: devel@edk2.groups.io; Chiu, Chasel > Cc: Kubacki, Michael A ; Desimone, Nathanie= l L > ; Gao, Liming > Subject: RE: [edk2-devel] [PATCH] Platform/Intel: Dynamic > NUMBER_OF_PROCESSORS in build. >=20 > Hi Chasel, >=20 > Patch looks good. >=20 > For the process number, build.py does the same thing as this patch. If p= ass -n 0 to > build.py, build.py will set the processor number to multiprocessing.cpu_= count() >=20 > Thanks, > Bob >=20 >=20 > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Ch= iu, > Chasel > Sent: Thursday, June 13, 2019 2:15 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Desimone, Nathanie= l L > ; Gao, Liming > Subject: [edk2-devel] [PATCH] Platform/Intel: Dynamic > NUMBER_OF_PROCESSORS in build. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1913 >=20 > 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. >=20 > Test: tried several NUMBER_OF_PROCESSORS settings and > the build parameter can be updated accordingly > also builds successfully. >=20 > 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(-) >=20 > 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"]) > -- > 2.13.3.windows.1 >=20 >=20 >=20