From patchwork Thu May 12 16:24:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 67685 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp844166qge; Thu, 12 May 2016 09:25:00 -0700 (PDT) X-Received: by 10.98.5.5 with SMTP id 5mr15299157pff.58.1463070300012; Thu, 12 May 2016 09:25:00 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id by4si11426703pad.42.2016.05.12.09.24.59; Thu, 12 May 2016 09:24:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752160AbcELQY6 (ORCPT + 5 others); Thu, 12 May 2016 12:24:58 -0400 Received: from foss.arm.com ([217.140.101.70]:60021 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbcELQY5 (ORCPT ); Thu, 12 May 2016 12:24:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 828B73A; Thu, 12 May 2016 09:25:09 -0700 (PDT) Received: from e104818-lin.cambridge.arm.com (e104818-lin.cambridge.arm.com [10.1.203.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E73943F487; Thu, 12 May 2016 09:24:51 -0700 (PDT) Date: Thu, 12 May 2016 17:24:49 +0100 From: Catalin Marinas To: David Daney Cc: "Rafael J. Wysocki" , Will Deacon , Mark Rutland , linux-ia64@vger.kernel.org, David Daney , Robert Moore , Lv Zheng , "H. Peter Anvin" , Frank Rowand , x86@kernel.org, linux-acpi@vger.kernel.org, Ingo Molnar , Grant Likely , Len Brown , Fenghua Yu , Marc Zyngier , Jon Masters , Robert Richter , Rob Herring , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, devel@acpica.org, Tony Luck , linux-kernel@vger.kernel.org, Hanjun Guo , Ganapatrao Kulkarni Subject: Re: [PATCH v6 13/14] arm64, acpi, numa: NUMA support based on SRAT and SLIT Message-ID: <20160512162449.GK11226@e104818-lin.cambridge.arm.com> References: <1461780436-27182-1-git-send-email-ddaney.cavm@gmail.com> <1461780436-27182-14-git-send-email-ddaney.cavm@gmail.com> <20160511103929.GC3051@e104818-lin.cambridge.arm.com> <5733C8F5.6090206@caviumnetworks.com> <20160512094915.GD11226@e104818-lin.cambridge.arm.com> <5734A0CC.8010600@caviumnetworks.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5734A0CC.8010600@caviumnetworks.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Thu, May 12, 2016 at 08:27:08AM -0700, David Daney wrote: > On 05/12/2016 02:49 AM, Catalin Marinas wrote: > >On Wed, May 11, 2016 at 05:06:13PM -0700, David Daney wrote: > >>On 05/11/2016 03:39 AM, Catalin Marinas wrote: > [...] > >>> > >>>I wonder whether you could replace the get_mpidr_in_madt() function with > >>>something like acpi_get_phys_id(). It looks like get_mpidr_in_madt() > >>>duplicates functionality already available elsewhere. > >> > >>I just tried that, and it doesn't work. > >> > >>The problem is that this code is being run very early in the boot, and > >>kmalloc cannot be used. acpi_get_phys_id() and its ilk can only be used > >>once we have working kmalloc. We need to extract the NUMA information early > >>like this precisely because it is needed to initializing the slab system > >> > >>Notice that we are using early_acpi_os_unmap_memory() et al. in > >>get_mpidr_in_madt() explicitly for this reason. > >> > >>In summary: I don't think we need another revision of this patch, it is like > >>this for a good reason. > > > >Slightly confusing, in another reply you said you are going to address > >my comment. So, is it doable? > > I don't think so. > > My previous reply, to the thread in 0/14, was prematurely made with the > incorrect assumption that it was a simple change. Now, after really digging > in to the code, and attempting to do as you suggested, I have changed my > mind. Would the snippet below help with avoiding any kmalloc calls? At a quick look, it seems that it's only map_mat_entry() that ends up using kmalloc() calls. Alternatively, exporting map_madt_entry() may work as well. -- Catalin -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 33a38d604630..77af0a7df914 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -152,6 +152,9 @@ static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id) struct acpi_subtable_header *header; phys_cpuid_t phys_id = PHYS_CPUID_INVALID; + if (!acpi_gbl_permanent_mmap) + return phys_id; + if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) goto exit;