linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Drop node-local allocation during host controller initialisation
@ 2018-08-28 15:05 Punit Agrawal
  2018-08-28 15:05 ` [PATCH 1/2] arm64: PCI: Remove node-local allocations when initialising host controller Punit Agrawal
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Punit Agrawal @ 2018-08-28 15:05 UTC (permalink / raw)
  To: bhelgaas
  Cc: Punit Agrawal, linux-kernel, linux-pci, will.deacon, x86,
	linux-arm-kernel, lorenzo.pieralisi

Hi Bjorn,

As discussed before[0], here are a couple of patches to drop
node-local allocations during host contoller initialisation. This set
covers both arm64 and x86.

I'm posting early to give the patches time on the list as well in next
in case there are issues we've missed.

The patches are based on v4.19-rc1 and has been boot tested on arm64
and compile tested on x86.

Thanks,
Punit

[0] https://www.spinics.net/lists/arm-kernel/msg669746.html

Punit Agrawal (2):
  arm64: PCI: Remove node-local allocations when initialising host
    controller
  x86/PCI: Remove node-local allocation when initialising host
    controller

 arch/arm64/kernel/pci.c | 5 ++---
 arch/x86/pci/acpi.c     | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] arm64: PCI: Remove node-local allocations when initialising host controller
  2018-08-28 15:05 [PATCH 0/2] Drop node-local allocation during host controller initialisation Punit Agrawal
@ 2018-08-28 15:05 ` Punit Agrawal
  2018-08-28 16:45   ` Will Deacon
  2018-08-28 15:05 ` [PATCH 2/2] x86/PCI: Remove node-local allocation " Punit Agrawal
  2018-09-04 13:24 ` [PATCH 0/2] Drop node-local allocation during host controller initialisation Bjorn Helgaas
  2 siblings, 1 reply; 5+ messages in thread
From: Punit Agrawal @ 2018-08-28 15:05 UTC (permalink / raw)
  To: bhelgaas
  Cc: Punit Agrawal, linux-kernel, linux-pci, will.deacon, x86,
	linux-arm-kernel, lorenzo.pieralisi, Catalin Marinas

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 <punit.agrawal@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 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;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] x86/PCI: Remove node-local allocation when initialising host controller
  2018-08-28 15:05 [PATCH 0/2] Drop node-local allocation during host controller initialisation Punit Agrawal
  2018-08-28 15:05 ` [PATCH 1/2] arm64: PCI: Remove node-local allocations when initialising host controller Punit Agrawal
@ 2018-08-28 15:05 ` Punit Agrawal
  2018-09-04 13:24 ` [PATCH 0/2] Drop node-local allocation during host controller initialisation Bjorn Helgaas
  2 siblings, 0 replies; 5+ messages in thread
From: Punit Agrawal @ 2018-08-28 15:05 UTC (permalink / raw)
  To: bhelgaas
  Cc: Punit Agrawal, linux-kernel, linux-pci, will.deacon, x86,
	linux-arm-kernel, lorenzo.pieralisi, Thomas Gleixner,
	H. Peter Anvin

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 <punit.agrawal@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
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",
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] arm64: PCI: Remove node-local allocations when initialising host controller
  2018-08-28 15:05 ` [PATCH 1/2] arm64: PCI: Remove node-local allocations when initialising host controller Punit Agrawal
@ 2018-08-28 16:45   ` Will Deacon
  0 siblings, 0 replies; 5+ messages in thread
From: Will Deacon @ 2018-08-28 16:45 UTC (permalink / raw)
  To: Punit Agrawal
  Cc: bhelgaas, linux-kernel, linux-pci, x86, linux-arm-kernel,
	lorenzo.pieralisi, Catalin Marinas

On Tue, Aug 28, 2018 at 04:05:12PM +0100, Punit Agrawal wrote:
> 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 <punit.agrawal@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  arch/arm64/kernel/pci.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Acked-by: Will Deacon <will.deacon@arm.com>

Will

> 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;
> -- 
> 2.18.0
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Drop node-local allocation during host controller initialisation
  2018-08-28 15:05 [PATCH 0/2] Drop node-local allocation during host controller initialisation Punit Agrawal
  2018-08-28 15:05 ` [PATCH 1/2] arm64: PCI: Remove node-local allocations when initialising host controller Punit Agrawal
  2018-08-28 15:05 ` [PATCH 2/2] x86/PCI: Remove node-local allocation " Punit Agrawal
@ 2018-09-04 13:24 ` Bjorn Helgaas
  2 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2018-09-04 13:24 UTC (permalink / raw)
  To: Punit Agrawal
  Cc: bhelgaas, linux-pci, x86, will.deacon, linux-kernel,
	lorenzo.pieralisi, linux-arm-kernel

On Tue, Aug 28, 2018 at 04:05:11PM +0100, Punit Agrawal wrote:
> Hi Bjorn,
> 
> As discussed before[0], here are a couple of patches to drop
> node-local allocations during host contoller initialisation. This set
> covers both arm64 and x86.
> 
> I'm posting early to give the patches time on the list as well in next
> in case there are issues we've missed.
> 
> The patches are based on v4.19-rc1 and has been boot tested on arm64
> and compile tested on x86.
> 
> Thanks,
> Punit
> 
> [0] https://www.spinics.net/lists/arm-kernel/msg669746.html
> 
> Punit Agrawal (2):
>   arm64: PCI: Remove node-local allocations when initialising host
>     controller
>   x86/PCI: Remove node-local allocation when initialising host
>     controller
> 
>  arch/arm64/kernel/pci.c | 5 ++---
>  arch/x86/pci/acpi.c     | 2 +-
>  2 files changed, 3 insertions(+), 4 deletions(-)

Applied with Will's ack on the arm64 patch to pci/enumeration for v4.20,
thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-04 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 15:05 [PATCH 0/2] Drop node-local allocation during host controller initialisation Punit Agrawal
2018-08-28 15:05 ` [PATCH 1/2] arm64: PCI: Remove node-local allocations when initialising host controller Punit Agrawal
2018-08-28 16:45   ` Will Deacon
2018-08-28 15:05 ` [PATCH 2/2] x86/PCI: Remove node-local allocation " Punit Agrawal
2018-09-04 13:24 ` [PATCH 0/2] Drop node-local allocation during host controller initialisation Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).