From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.3562.1574990544014671454 for ; Thu, 28 Nov 2019 17:22:24 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: ray.ni@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2019 17:22:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,255,1571727600"; d="scan'208";a="212188690" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga006.jf.intel.com with ESMTP; 28 Nov 2019 17:22:23 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 28 Nov 2019 17:22:23 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.213]) with mapi id 14.03.0439.000; Fri, 29 Nov 2019 09:22:22 +0800 From: "Ni, Ray" To: Laszlo Ersek , "Dong, Eric" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH v2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time. Thread-Topic: [PATCH v2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time. Thread-Index: AQHVpfPKVAgOOmjvcUWB0nxhcTGlmaehWXBA Date: Fri, 29 Nov 2019 01:22:21 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C372368@SHSMSX104.ccr.corp.intel.com> References: <20191128061716.196-1-eric.dong@intel.com> <7ac1f712-5da3-e6b2-f24e-936feb81daa3@redhat.com> In-Reply-To: <7ac1f712-5da3-e6b2-f24e-936feb81daa3@redhat.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable >=20 > I suggest that we introduce a new PCD for "token count per chunk", and > set the default value to 1, in the DEC file. (And we should copy the PCD > into a global variable, in InitializeDataForMmMp().) >=20 > This way, if a platform suddenly starts consuming tokens, it will work > (there will always be a single available token). If they want to improve > performance (using a chunked allocation style), they can set the PCD as > they see fit. >=20 Laszlo, I agree with you to use to PCD for "token count per chunk". But I suggest the default value of that PCD can be at least 64. Reasons: 1. MM_MP is the new MP protocol in SMM environment and we expect all SMM code start to use the new protocol instead of the original Star= tupThisAp service exposed through SMM System table. 2. A value of 1 is totally to disable the pre-allocating. I prefer this pre-allocating is activated by default given the reason #1. 64 * 32/64 (SPIN LOCK size) =3D 2KB/4KB is not a big size. Thanks, Ray