lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <86802c440707212106k45f4aba5le381372c02f03195@mail.gmail.com>
Date:	Sat, 21 Jul 2007 21:06:54 -0700
From:	"Yinghai Lu" <yhlu.kernel@...il.com>
To:	"Andi Kleen" <ak@...e.de>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Muli Ben-Yehuda" <muli@...ibm.com>,
	"Linus Torvalds" <torvalds@...ux-foundation.org>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] x86_64: get mp_bus_to_node as early v2

Please check the updated version regarding to pci_sysdata ...

hope we can add .node and iommu to pci_bus struct instead later.

Thanks

Yinghai Lu


[PATCH] x86_64: get mp_bus_to_node as early v2

In struct device, we already have numa_node member. and we can use dev_to_node()
/set_dev_node() to get and set numa_node in the device.
set_dev_node is called in pci_device_add() with pcibus_to_node(bus). and
pci_bus_to_node use bus->sysdata for nodeid.
the problem is when pci_add_device is called, bus->sysdata is not assigned
correct nodeid yet. the result will be numa_node always is 0.
pcibios_scan_root and pci_scan_root could take sysdata. So we need to get
mp_bus_to_node mapping before these two are called. and get_mp_bus_to_node
could get correct node for sysdata in root bus.
in scanning of root bus, all child bus will take parent bus sysdata. So all
pci_device->dev.numa_node will be assigned correctly automatically.
later we could use dev_to_node(&pci_dev->dev) to numa_node, and we could also
could make other bus specific device get the correct numa_node too.
and in different driver we could use kmalloc_node instead of kmalloc for
skbuff/net or urb/usb etc. That could help improve performance with
usb or net or
sata for AMD K8 two sockets beyond system.

For example:
two way opteron system and only one HT chain on node 0. USB controller on SB
will be on node0. some dma accessing is used with kmalloc/dma_map_single. and
these address will be on node1 instead of node0. and even worse, when node1 ram
 is above 4G, we may need to iommu mapping for usb operation.
two way system with one HT chain on different node, we will need to
kmalloc/dma_map_single to use ram on corresonding node too.  esp for nvidia
mcp55/io55 system. the second io55 could have nic/sata/pcie devices.

this is one update version to pci_sysdata ...
also reverse pci_acpi_scan_root to use pcibios_scan_root again.

without this patch: /sys/pci0000:80/*/numa_node for second HT chain always 0.

Signed-off-by: Yinghai Lu <yinghai.lu@....com>

 arch/i386/pci/Makefile         |    1
 arch/i386/pci/acpi.c           |   40 +++++--------------
 arch/i386/pci/common.c         |    7 ++-
 arch/i386/pci/irq.c            |   18 ++++++++
 arch/i386/pci/legacy.c         |   22 ++++++++++
 arch/i386/pci/mp_bus_to_node.c |   24 +++++++++++
 arch/x86_64/pci/k8-bus.c       |   83 ++++++++++++++++++++++++++++-------------
 include/asm-i386/topology.h    |   10 ++++
 include/asm-x86_64/topology.h  |   13 ++++++
 9 files changed, 159 insertions(+), 59 deletions(-)

View attachment "2xx1.diff" of type "text/x-patch" (10058 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ