From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Dave Jones <davej@redhat.com>, David Miller <davem@davemloft.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-mm@kvack.org,
"Benzi Galili (Benzi@ScaleMP.com)" <benzi@scalemp.com>,
"Shai Fultheim (Shai@scalex86.org)" <shai@scalex86.org>
Subject: Re: [PATCH 2/3] add dev_to_node()
Date: Mon, 6 Nov 2006 22:25:36 -0800 [thread overview]
Message-ID: <20061107062536.GA3729@localhost.localdomain> (raw)
In-Reply-To: <20061104235323.GA1353@lst.de>
On Sun, Nov 05, 2006 at 12:53:23AM +0100, Christoph Hellwig wrote:
> On Sat, Nov 04, 2006 at 06:06:48PM -0500, Dave Jones wrote:
> > On Sat, Nov 04, 2006 at 11:56:29PM +0100, Christoph Hellwig wrote:
> >
> > This will break the compile for !NUMA if someone ends up doing a bisect
> > and lands here as a bisect point.
> >
> > You introduce this nice wrapper..
>
> The dev_to_node wrapper is not enough as we can't assign to (-1) for
> the non-NUMA case. So I added a second macro, set_dev_node for that.
>
> The patch below compiles and works on numa and non-NUMA platforms.
>
>
Hi Christoph,
dev_to_node does not work as expected on x86_64 (and i386). This is because
node value returned by pcibus_to_node is initialized after a struct device
is created with current x86_64 code.
We need the node value initialized before the call to pci_scan_bus_parented,
as the generic devices are allocated and initialized
off pci_scan_child_bus, which gets called from pci_scan_bus_parented
The following patch does that using "pci_sysdata" introduced by the PCI
domain patches in -mm.
Signed-off-by: Alok N Kataria <alok.kataria@calsoftinc.com>
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Index: linux-2.6.19-rc4mm2/arch/i386/pci/acpi.c
===================================================================
--- linux-2.6.19-rc4mm2.orig/arch/i386/pci/acpi.c 2006-11-06 11:03:50.000000000 -0800
+++ linux-2.6.19-rc4mm2/arch/i386/pci/acpi.c 2006-11-06 22:04:14.000000000 -0800
@@ -9,6 +9,7 @@ struct pci_bus * __devinit pci_acpi_scan
{
struct pci_bus *bus;
struct pci_sysdata *sd;
+ int pxm;
/* Allocate per-root-bus (not per bus) arch-specific data.
* TODO: leak; this memory is never freed.
@@ -30,15 +31,21 @@ struct pci_bus * __devinit pci_acpi_scan
}
#endif /* CONFIG_PCI_DOMAINS */
+ sd->node = -1;
+
+ pxm = acpi_get_pxm(device->handle);
+#ifdef CONFIG_ACPI_NUMA
+ if (pxm >= 0)
+ sd->node = pxm_to_node(pxm);
+#endif
+
bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
if (!bus)
kfree(sd);
#ifdef CONFIG_ACPI_NUMA
if (bus != NULL) {
- int pxm = acpi_get_pxm(device->handle);
if (pxm >= 0) {
- sd->node = pxm_to_node(pxm);
printk("bus %d -> pxm %d -> node %d\n",
busnum, pxm, sd->node);
}
WARNING: multiple messages have this Message-ID (diff)
From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Dave Jones <davej@redhat.com>, David Miller <davem@davemloft.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-mm@kvack.org,
"Benzi Galili (Benzi@ScaleMP.com)" <benzi@scalemp.com>,
"Shai Fultheim (Shai@scalex86.org)" <shai@scalex86.org>
Subject: Re: [PATCH 2/3] add dev_to_node()
Date: Mon, 6 Nov 2006 22:25:36 -0800 [thread overview]
Message-ID: <20061107062536.GA3729@localhost.localdomain> (raw)
In-Reply-To: <20061104235323.GA1353@lst.de>
On Sun, Nov 05, 2006 at 12:53:23AM +0100, Christoph Hellwig wrote:
> On Sat, Nov 04, 2006 at 06:06:48PM -0500, Dave Jones wrote:
> > On Sat, Nov 04, 2006 at 11:56:29PM +0100, Christoph Hellwig wrote:
> >
> > This will break the compile for !NUMA if someone ends up doing a bisect
> > and lands here as a bisect point.
> >
> > You introduce this nice wrapper..
>
> The dev_to_node wrapper is not enough as we can't assign to (-1) for
> the non-NUMA case. So I added a second macro, set_dev_node for that.
>
> The patch below compiles and works on numa and non-NUMA platforms.
>
>
Hi Christoph,
dev_to_node does not work as expected on x86_64 (and i386). This is because
node value returned by pcibus_to_node is initialized after a struct device
is created with current x86_64 code.
We need the node value initialized before the call to pci_scan_bus_parented,
as the generic devices are allocated and initialized
off pci_scan_child_bus, which gets called from pci_scan_bus_parented
The following patch does that using "pci_sysdata" introduced by the PCI
domain patches in -mm.
Signed-off-by: Alok N Kataria <alok.kataria@calsoftinc.com>
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Index: linux-2.6.19-rc4mm2/arch/i386/pci/acpi.c
===================================================================
--- linux-2.6.19-rc4mm2.orig/arch/i386/pci/acpi.c 2006-11-06 11:03:50.000000000 -0800
+++ linux-2.6.19-rc4mm2/arch/i386/pci/acpi.c 2006-11-06 22:04:14.000000000 -0800
@@ -9,6 +9,7 @@ struct pci_bus * __devinit pci_acpi_scan
{
struct pci_bus *bus;
struct pci_sysdata *sd;
+ int pxm;
/* Allocate per-root-bus (not per bus) arch-specific data.
* TODO: leak; this memory is never freed.
@@ -30,15 +31,21 @@ struct pci_bus * __devinit pci_acpi_scan
}
#endif /* CONFIG_PCI_DOMAINS */
+ sd->node = -1;
+
+ pxm = acpi_get_pxm(device->handle);
+#ifdef CONFIG_ACPI_NUMA
+ if (pxm >= 0)
+ sd->node = pxm_to_node(pxm);
+#endif
+
bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
if (!bus)
kfree(sd);
#ifdef CONFIG_ACPI_NUMA
if (bus != NULL) {
- int pxm = acpi_get_pxm(device->handle);
if (pxm >= 0) {
- sd->node = pxm_to_node(pxm);
printk("bus %d -> pxm %d -> node %d\n",
busnum, pxm, sd->node);
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2006-11-07 6:26 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-30 14:15 [PATCH 2/3] add dev_to_node() Christoph Hellwig
2006-10-30 14:15 ` Christoph Hellwig
2006-10-30 22:33 ` David Miller
2006-10-30 22:33 ` David Miller, Christoph Hellwig
2006-11-01 0:10 ` Christoph Lameter
2006-11-01 0:10 ` Christoph Lameter
2006-11-01 0:53 ` David Miller
2006-11-01 0:53 ` David Miller, Christoph Lameter
2006-11-01 1:58 ` Christoph Lameter
2006-11-01 1:58 ` Christoph Lameter
2006-11-04 22:56 ` Christoph Hellwig
2006-11-04 22:56 ` Christoph Hellwig
2006-11-04 23:06 ` Dave Jones
2006-11-04 23:06 ` Dave Jones
2006-11-04 23:09 ` Christoph Hellwig
2006-11-04 23:09 ` Christoph Hellwig
2006-11-04 23:53 ` Christoph Hellwig
2006-11-04 23:53 ` Christoph Hellwig
2006-11-05 8:22 ` David Miller
2006-11-05 8:22 ` David Miller, Christoph Hellwig
2006-11-06 23:39 ` Christoph Hellwig
2006-11-06 23:39 ` Christoph Hellwig
2006-11-07 6:25 ` Ravikiran G Thirumalai [this message]
2006-11-07 6:25 ` Ravikiran G Thirumalai
2006-11-07 10:15 ` Christoph Hellwig
2006-11-07 10:15 ` Christoph Hellwig
2006-11-08 2:40 ` KAMEZAWA Hiroyuki
2006-11-08 2:40 ` KAMEZAWA Hiroyuki
2006-11-10 18:16 ` Christoph Lameter
2006-11-10 18:16 ` Christoph Lameter
2006-11-10 18:28 ` Lee Schermerhorn
2006-11-10 18:28 ` Lee Schermerhorn
2006-11-11 0:08 ` KAMEZAWA Hiroyuki
2006-11-11 0:08 ` KAMEZAWA Hiroyuki
-- strict thread matches above, loose matches on Subject: below --
2006-10-30 14:15 Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061107062536.GA3729@localhost.localdomain \
--to=kiran@scalex86.org \
--cc=benzi@scalemp.com \
--cc=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
--cc=shai@scalex86.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.