linux/drivers/base
Roel Kluin 4750498099 mm: get_nid_for_pfn() returns int
get_nid_for_pfn() returns int

Presumably the (nid < 0) case has never happened.

We do know that it is happening on one system while creating a symlink for
a memory section so it should also happen on the same system if
unregister_mem_sect_under_nodes() were called to remove the same symlink.

The test was actually added in response to a problem with an earlier
version reported by Yasunori Goto where one or more of the leading pages
of a memory section on the 2nd node of one of his systems was
uninitialized because I believe they coincided with a memory hole.

That earlier version did not ignore uninitialized pages and determined
the nid by considering only the 1st page of each memory section.  This
caused the symlink to the 1st memory section on the 2nd node to be
incorrectly created in /sys/devices/system/node/node0 instead of
/sys/devices/system/node/node1.  The problem was fixed by adding the
test to skip over uninitialized pages.

I suspect we have not seen any reports of the non-removal
of a symlink due to the incorrect declaration of the nid
variable in unregister_mem_sect_under_nodes() because
  - systems where a memory section could have an uninitialized
    range of leading pages are probably rare.
  - memory remove is probably not done very frequently on the
    systems that are capable of demonstrating the problem.
  - lingering symlink(s) that should have been removed may
    have simply gone unnoticed.

[garyhade@us.ibm.com: wrote changelog]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Gary Hade <garyhade@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-03-10 15:55:10 -07:00
..
power PM: Split up sysdev_[suspend|resume] from device_power_[down|up] 2009-02-22 10:33:44 -08:00
attribute_container.c driver core: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:31 -08:00
base.h PM: Split up sysdev_[suspend|resume] from device_power_[down|up] 2009-02-22 10:33:44 -08:00
bus.c Revert "driver core: move knode_bus into private structure" 2009-01-09 14:32:46 -08:00
class.c driver-core: use klist for class device list and implement iterator 2008-10-09 08:56:04 +02:00
core.c driver-core: fix kernel-doc parameter name 2009-01-28 15:55:48 -08:00
cpu.c cpumask: fix compile error when CONFIG_NR_CPUS is not defined 2009-01-03 19:15:41 +01:00
dd.c Consolidate driver_probe_done() loops into one place 2009-02-21 14:17:17 -08:00
devres.c Driver core: fix devres_release_all() return value 2007-07-11 16:09:02 -07:00
dma-mapping.c devres: device resource management 2007-02-09 17:39:36 -05:00
driver.c Revert "driver core: move knode_driver into private structure" 2009-01-09 14:44:18 -08:00
firmware.c firmware: change firmware_kset to firmware_kobj 2008-01-24 20:40:23 -08:00
firmware_class.c driver core: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:31 -08:00
hypervisor.c kobject: convert /sys/hypervisor to use kobject_create 2008-01-24 20:40:15 -08:00
init.c Driver core: coding style fixes 2008-01-24 22:50:12 -08:00
iommu.c add frontend implementation for the IOMMU API 2009-01-03 14:10:09 +01:00
isa.c driver core: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:31 -08:00
Kconfig trivial: Fix misspelled firmware in Kconfig 2009-01-06 11:28:07 +01:00
Makefile select IOMMU_API when DMAR and/or AMD_IOMMU is selected 2009-01-03 14:10:09 +01:00
map.c
memory.c mm: show node to memory section relationship with symlinks in sysfs 2009-01-06 15:59:00 -08:00
module.c Driver core: move the static kobject out of struct driver 2008-01-24 20:40:35 -08:00
node.c mm: get_nid_for_pfn() returns int 2009-03-10 15:55:10 -07:00
platform.c driver core: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:31 -08:00
sys.c PM: Split up sysdev_[suspend|resume] from device_power_[down|up], fix 2009-02-22 22:09:33 +01:00
topology.c topology: Fix sparc64 build. 2009-01-07 15:34:47 -08:00
transport_class.c SCSI: convert struct class_device to struct device 2008-04-19 19:10:33 -07:00