From patchwork Tue Aug 28 15:05:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 962989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 420Bry63pYz9rvt for ; Wed, 29 Aug 2018 01:05:38 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727315AbeH1S5m (ORCPT ); Tue, 28 Aug 2018 14:57:42 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:40020 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbeH1S5m (ORCPT ); Tue, 28 Aug 2018 14:57:42 -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 27F68ED1; Tue, 28 Aug 2018 08:05:37 -0700 (PDT) Received: from localhost (e105922-lin.emea.arm.com [10.4.13.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C09E13F557; Tue, 28 Aug 2018 08:05:36 -0700 (PDT) From: Punit Agrawal To: bhelgaas@google.com Cc: Punit Agrawal , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, will.deacon@arm.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, lorenzo.pieralisi@arm.com, Catalin Marinas Subject: [PATCH 1/2] arm64: PCI: Remove node-local allocations when initialising host controller Date: Tue, 28 Aug 2018 16:05:12 +0100 Message-Id: <20180828150513.32458-2-punit.agrawal@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180828150513.32458-1-punit.agrawal@arm.com> References: <20180828150513.32458-1-punit.agrawal@arm.com> X-ARM-No-Footer: FoSSMail Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Memory for host controller data structures is allocated local to the node to which the controller is associated with. This has been the behaviour since support for ACPI was added in commit 0cb0786bac15 ("ARM64: PCI: Support ACPI-based PCI host controller"). Drop the node local allocation as there is no benefit from doing so - the usage of these structures is independent from where the controller is located. Signed-off-by: Punit Agrawal Cc: Catalin Marinas Cc: Will Deacon Cc: Lorenzo Pieralisi Cc: linux-arm-kernel@lists.infradead.org Acked-by: Will Deacon --- arch/arm64/kernel/pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 0e2ea1c78542..bb85e2f4603f 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -165,16 +165,15 @@ static void pci_acpi_generic_release_info(struct acpi_pci_root_info *ci) /* Interface called from ACPI code to setup PCI host controller */ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) { - int node = acpi_get_node(root->device->handle); struct acpi_pci_generic_root_info *ri; struct pci_bus *bus, *child; struct acpi_pci_root_ops *root_ops; - ri = kzalloc_node(sizeof(*ri), GFP_KERNEL, node); + ri = kzalloc(sizeof(*ri), GFP_KERNEL); if (!ri) return NULL; - root_ops = kzalloc_node(sizeof(*root_ops), GFP_KERNEL, node); + root_ops = kzalloc(sizeof(*root_ops), GFP_KERNEL); if (!root_ops) { kfree(ri); return NULL; From patchwork Tue Aug 28 15:05:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 962990 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 420Bs85l6vz9ryt for ; Wed, 29 Aug 2018 01:05:48 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727083AbeH1S5s (ORCPT ); Tue, 28 Aug 2018 14:57:48 -0400 Received: from foss.arm.com ([217.140.101.70]:40038 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbeH1S5r (ORCPT ); Tue, 28 Aug 2018 14:57:47 -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 4C19018A; Tue, 28 Aug 2018 08:05:42 -0700 (PDT) Received: from localhost (e105922-lin.emea.arm.com [10.4.13.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E43233F557; Tue, 28 Aug 2018 08:05:41 -0700 (PDT) From: Punit Agrawal To: bhelgaas@google.com Cc: Punit Agrawal , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, will.deacon@arm.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, lorenzo.pieralisi@arm.com, Thomas Gleixner , "H. Peter Anvin" Subject: [PATCH 2/2] x86/PCI: Remove node-local allocation when initialising host controller Date: Tue, 28 Aug 2018 16:05:13 +0100 Message-Id: <20180828150513.32458-3-punit.agrawal@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180828150513.32458-1-punit.agrawal@arm.com> References: <20180828150513.32458-1-punit.agrawal@arm.com> X-ARM-No-Footer: FoSSMail Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Memory for host controller data structures is allocated local to the node to which the controller is associated with. This has been the behaviour since 965cd0e4a5e5 ("x86, PCI, ACPI: Use kmalloc_node() to optimize for performance") where the node local allocation was added without additional context. Drop the node local allocation as there is no benefit from doing so - the usage of these structures is independent from where the controller is located. Signed-off-by: Punit Agrawal Cc: Bjorn Helgaas Cc: Thomas Gleixner Cc: "H. Peter Anvin" Cc: x86@kernel.org --- arch/x86/pci/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 5559dcaddd5e..948656069cdd 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -356,7 +356,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) } else { struct pci_root_info *info; - info = kzalloc_node(sizeof(*info), GFP_KERNEL, node); + info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) dev_err(&root->device->dev, "pci_bus %04x:%02x: ignored (out of memory)\n",