From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1DD5C433E0 for ; Thu, 25 Jun 2020 02:57:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8B7A2078D for ; Thu, 25 Jun 2020 02:57:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389478AbgFYC5m (ORCPT ); Wed, 24 Jun 2020 22:57:42 -0400 Received: from mga09.intel.com ([134.134.136.24]:21251 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388930AbgFYC5m (ORCPT ); Wed, 24 Jun 2020 22:57:42 -0400 IronPort-SDR: H3hkeDwMI0vB8DT/zKK3mmK/OXrBZxm3+4c3cNSvSlxBxfJtunUl6l8dkjuu8q4uRBNd7EaY9m lg9cDySgspCA== X-IronPort-AV: E=McAfee;i="6000,8403,9662"; a="146218831" X-IronPort-AV: E=Sophos;i="5.75,277,1589266800"; d="scan'208";a="146218831" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2020 19:57:41 -0700 IronPort-SDR: 6agehCrkUT1sIXa1OPmFlaJvzSrV7wMbmpqIIM7xgFvTKjqiWgK1PpXjiwD+aJuXl+MLm3QLuc WOwaG5cynYLg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,277,1589266800"; d="scan'208";a="479492248" Received: from hluxenbu-mobl.ger.corp.intel.com (HELO localhost) ([10.252.36.218]) by fmsmga005.fm.intel.com with ESMTP; 24 Jun 2020 19:57:39 -0700 Date: Thu, 25 Jun 2020 05:57:38 +0300 From: Jarkko Sakkinen To: Sean Christopherson Cc: Dave Hansen , linux-sgx@vger.kernel.org, kai.svahn@intel.com, bruce.schlobohm@intel.com Subject: Re: [PATCH RFC] x86/sgx: Allocate form local NUMA node first Message-ID: <20200625025738.GE270125@linux.intel.com> References: <20200623043931.157156-1-jarkko.sakkinen@linux.intel.com> <57c83d3d-54ab-fc07-cefc-c3ebe478a8e9@intel.com> <20200624235406.GH25092@linux.intel.com> <59f91e2e-56c2-0395-0ed4-df76a9d7d252@intel.com> <20200625005752.GI25092@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200625005752.GI25092@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-sgx-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org On Wed, Jun 24, 2020 at 05:57:52PM -0700, Sean Christopherson wrote: > On Wed, Jun 24, 2020 at 05:25:59PM -0700, Dave Hansen wrote: > > On 6/24/20 4:54 PM, Sean Christopherson wrote: > > >> Does this actually work? > > >> > > >> The node span (->node_start_pfn through start+->node_spanned_pages) only > > >> contains pages which the OS is actively managing, usually RAM but > > >> sometimes also persistent memory. This has some assumption that the SGX > > >> PFNs are within the node's span. I would only _expect_ that to happen > > >> if the node was built like this: > > >> > > >> | Node-X RAM | EPC | Node-X RAM | > > >> > > >> If the EPC was on either end: > > >> > > >> | Node-X RAM | EPC | > > >> or > > >> | EPC | Node-X RAM | > > >> > > >> I suspect that the pgdat span wouldn't include EPC. EPC is, if I > > >> remember correctly, a E820_RESERVED region. > > > It is indeed E820_RESERVED, but the BIOS WG for ICX states that EPC regions > > > should be enumerated in ACPI SRAT along with regular memory. > > > > > > But, I haven't actually verified that info makes its way into the kernel's > > > pgdata stuff. > > > > Considering this, are we all agreed that this patch is in no condition > > to be submitted upstream? > > Yes, it needs to be tested first. > > I like the resulting code more than what we have now, but I see no reason to > change it at this stage unless one of the maintainers actually complains. I'm cool with this. I think that this patch shows that the current candidate patch set (v33) is in a good shape: the diff adheres very cleanly on what we have. /Jarkko