linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
@ 2012-09-05  9:25 wency
  2012-09-05  9:25 ` [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages() wency
                   ` (24 more replies)
  0 siblings, 25 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Wen Congyang <wency@cn.fujitsu.com>

This patch series aims to support physical memory hot-remove.

The patches can free/remove the following things:

  - acpi_memory_info                          : [RFC PATCH 4/19]
  - /sys/firmware/memmap/X/{end, start, type} : [RFC PATCH 8/19]
  - iomem_resource                            : [RFC PATCH 9/19]
  - mem_section and related sysfs files       : [RFC PATCH 10-11, 13-16/19]
  - page table of removed memory              : [RFC PATCH 12/19]
  - node and related sysfs files              : [RFC PATCH 18-19/19]

If you find lack of function for physical memory hot-remove, please let me
know.

How to test this patchset?
1. apply this patchset and build the kernel. MEMORY_HOTPLUG, MEMORY_HOTREMOVE,
   ACPI_HOTPLUG_MEMORY must be selected.
2. load the module acpi_memhotplug
3. hotplug the memory device(it depends on your hardware)
   You will see the memory device under the directory /sys/bus/acpi/devices/.
   Its name is PNP0C80:XX.
4. online/offline pages provided by this memory device
   You can write online/offline to /sys/devices/system/memory/memoryX/state to
   online/offline pages provided by this memory device
5. hotremove the memory device
   You can hotremove the memory device by the hardware, or writing 1 to
   /sys/bus/acpi/devices/PNP0C80:XX/eject.

Note: if the memory provided by the memory device is used by the kernel, it
can't be offlined. It is not a bug.

Known problems:
1. memory can't be offlined when CONFIG_MEMCG is selected.
   For example: there is a memory device on node 1. The address range
   is [1G, 1.5G). You will find 4 new directories memory8, memory9, memory10,
   and memory11 under the directory /sys/devices/system/memory/.
   If CONFIG_MEMCG is selected, we will allocate memory to store page cgroup
   when we online pages. When we online memory8, the memory stored page cgroup
   is not provided by this memory device. But when we online memory9, the memory
   stored page cgroup may be provided by memory8. So we can't offline memory8
   now. We should offline the memory in the reversed order.
   When the memory device is hotremoved, we will auto offline memory provided
   by this memory device. But we don't know which memory is onlined first, so
   offlining memory may fail. In such case, you should offline the memory by
   hand before hotremoving the memory device.
2. hotremoving memory device may cause kernel panicked
   This bug will be fixed by Liu Jiang's patch:
   https://lkml.org/lkml/2012/7/3/1

change log of v9:
 [RFC PATCH v9 8/21]
   * add a lock to protect the list map_entries
   * add an indicator to firmware_map_entry to remember whether the memory
     is allocated from bootmem
 [RFC PATCH v9 10/21]
   * change the macro to inline function
 [RFC PATCH v9 19/21]
   * don't offline the node if the cpu on the node is onlined
 [RFC PATCH v9 21/21]
   * create new patch: auto offline page_cgroup when onlining memory block
     failed

change log of v8:
 [RFC PATCH v8 17/20]
   * Fix problems when one node's range include the other nodes
 [RFC PATCH v8 18/20]
   * fix building error when CONFIG_MEMORY_HOTPLUG_SPARSE or CONFIG_HUGETLBFS
     is not defined.
 [RFC PATCH v8 19/20]
   * don't offline node when some memory sections are not removed
 [RFC PATCH v8 20/20]
   * create new patch: clear hwpoisoned flag when onlining pages

change log of v7:
 [RFC PATCH v7 4/19]
   * do not continue if acpi_memory_device_remove_memory() fails.
 [RFC PATCH v7 15/19]
   * handle usemap in register_page_bootmem_info_section() too.

change log of v6:
 [RFC PATCH v6 12/19]
   * fix building error on other archtitectures than x86

 [RFC PATCH v6 15-16/19]
   * fix building error on other archtitectures than x86

change log of v5:
 * merge the patchset to clear page table and the patchset to hot remove
   memory(from ishimatsu) to one big patchset.

 [RFC PATCH v5 1/19]
   * rename remove_memory() to offline_memory()/offline_pages()

 [RFC PATCH v5 2/19]
   * new patch: implement offline_memory(). This function offlines pages,
     update memory block's state, and notify the userspace that the memory
     block's state is changed.

 [RFC PATCH v5 4/19]
   * offline and remove memory in acpi_memory_disable_device() too.

 [RFC PATCH v5 17/19]
   * new patch: add a new function __remove_zone() to revert the things done
     in the function __add_zone().

 [RFC PATCH v5 18/19]
   * flush work befor reseting node device.

change log of v4:
 * remove "memory-hotplug : unify argument of firmware_map_add_early/hotplug"
   from the patch series, since the patch is a bugfix. It is being disccussed
   on other thread. But for testing the patch series, the patch is needed.
   So I added the patch as [PATCH 0/13].

 [RFC PATCH v4 2/13]
   * check memory is online or not at remove_memory()
   * add memory_add_physaddr_to_nid() to acpi_memory_device_remove() for
     getting node id
 
 [RFC PATCH v4 3/13]
   * create new patch : check memory is online or not at online_pages()

 [RFC PATCH v4 4/13]
   * add __ref section to remove_memory()
   * call firmware_map_remove_entry() before remove_sysfs_fw_map_entry()

 [RFC PATCH v4 11/13]
   * rewrite register_page_bootmem_memmap() for removing page used as PT/PMD

change log of v3:
 * rebase to 3.5.0-rc6

 [RFC PATCH v2 2/13]
   * remove extra kobject_put()

   * The patch was commented by Wen. Wen's comment is
     "acpi_memory_device_remove() should ignore a return value of
     remove_memory() since caller does not care the return value".
     But I did not change it since I think caller should care the
     return value. And I am trying to fix it as follow:

     https://lkml.org/lkml/2012/7/5/624

 [RFC PATCH v2 4/13]
   * remove a firmware_memmap_entry allocated by kzmalloc()

change log of v2:
 [RFC PATCH v2 2/13]
   * check whether memory block is offline or not before calling offline_memory()
   * check whether section is valid or not in is_memblk_offline()
   * call kobject_put() for each memory_block in is_memblk_offline()

 [RFC PATCH v2 3/13]
   * unify the end argument of firmware_map_add_early/hotplug

 [RFC PATCH v2 4/13]
   * add release_firmware_map_entry() for freeing firmware_map_entry

 [RFC PATCH v2 6/13]
  * add release_memory_block() for freeing memory_block

 [RFC PATCH v2 11/13]
  * fix wrong arguments of free_pages()


Wen Congyang (8):
  memory-hotplug: implement offline_memory()
  memory-hotplug: store the node id in acpi_memory_device
  memory-hotplug: export the function acpi_bus_remove()
  memory-hotplug: call acpi_bus_remove() to remove memory device
  memory-hotplug: introduce new function arch_remove_memory()
  memory-hotplug: remove sysfs file of node
  memory-hotplug: clear hwpoisoned flag when onlining pages
  memory-hotplug: auto offline page_cgroup when onlining memory block
    failed

Yasuaki Ishimatsu (13):
  memory-hotplug: rename remove_memory() to
    offline_memory()/offline_pages()
  memory-hotplug: offline and remove memory when removing the memory
    device
  memory-hotplug: check whether memory is present or not
  memory-hotplug: remove /sys/firmware/memmap/X sysfs
  memory-hotplug: does not release memory region in PAGES_PER_SECTION
    chunks
  memory-hotplug: add memory_block_release
  memory-hotplug: remove_memory calls __remove_pages
  memory-hotplug: check page type in get_page_bootmem
  memory-hotplug: move register_page_bootmem_info_node and
    put_page_bootmem for sparse-vmemmap
  memory-hotplug: implement register_page_bootmem_info_section of
    sparse-vmemmap
  memory-hotplug: free memmap of sparse-vmemmap
  memory_hotplug: clear zone when the memory is removed
  memory-hotplug: add node_device_release

 arch/ia64/mm/discontig.c                        |   14 +
 arch/ia64/mm/init.c                             |   16 +
 arch/powerpc/mm/init_64.c                       |   14 +
 arch/powerpc/mm/mem.c                           |   14 +
 arch/powerpc/platforms/pseries/hotplug-memory.c |   16 +-
 arch/s390/mm/init.c                             |   12 +
 arch/s390/mm/vmem.c                             |   14 +
 arch/sh/mm/init.c                               |   15 +
 arch/sparc/mm/init_64.c                         |   14 +
 arch/tile/mm/init.c                             |    8 +
 arch/x86/include/asm/pgtable_types.h            |    1 +
 arch/x86/mm/init_32.c                           |   10 +
 arch/x86/mm/init_64.c                           |  331 ++++++++++++++++++
 arch/x86/mm/pageattr.c                          |   47 ++--
 drivers/acpi/acpi_memhotplug.c                  |   54 +++-
 drivers/acpi/scan.c                             |    3 +-
 drivers/base/memory.c                           |   88 ++++-
 drivers/base/node.c                             |   11 +
 drivers/firmware/memmap.c                       |   98 +++++-
 include/acpi/acpi_bus.h                         |    1 +
 include/linux/firmware-map.h                    |    6 +
 include/linux/memory.h                          |    5 +
 include/linux/memory_hotplug.h                  |   25 +-
 include/linux/mm.h                              |    5 +-
 include/linux/mmzone.h                          |   19 +
 mm/memory_hotplug.c                             |  424 +++++++++++++++++++++--
 mm/page_cgroup.c                                |    3 +
 mm/sparse.c                                     |    5 +-
 28 files changed, 1181 insertions(+), 92 deletions(-)


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

* [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages()
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
@ 2012-09-05  9:25 ` wency
  2012-09-28  2:22   ` Ni zhan Chen
  2012-09-05  9:25 ` [RFC v9 PATCH 02/21] memory-hotplug: implement offline_memory() wency
                   ` (23 subsequent siblings)
  24 siblings, 1 reply; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

remove_memory() only try to offline pages. It is called in two cases:
1. hot remove a memory device
2. echo offline >/sys/devices/system/memory/memoryXX/state

In the 1st case, we should also change memory block's state, and notify
the userspace that the memory block's state is changed after offlining
pages.

So rename remove_memory() to offline_memory()/offline_pages(). And in
the 1st case, offline_memory() will be used. The function offline_memory()
is not implemented. In the 2nd case, offline_pages() will be used.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 drivers/acpi/acpi_memhotplug.c |    2 +-
 drivers/base/memory.c          |    9 +++------
 include/linux/memory_hotplug.h |    3 ++-
 mm/memory_hotplug.c            |   22 ++++++++++++++--------
 4 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 24c807f..2a7beac 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -318,7 +318,7 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
 	 */
 	list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
 		if (info->enabled) {
-			result = remove_memory(info->start_addr, info->length);
+			result = offline_memory(info->start_addr, info->length);
 			if (result)
 				return result;
 		}
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7dda4f7..44e7de6 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -248,26 +248,23 @@ static bool pages_correctly_reserved(unsigned long start_pfn,
 static int
 memory_block_action(unsigned long phys_index, unsigned long action)
 {
-	unsigned long start_pfn, start_paddr;
+	unsigned long start_pfn;
 	unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block;
 	struct page *first_page;
 	int ret;
 
 	first_page = pfn_to_page(phys_index << PFN_SECTION_SHIFT);
+	start_pfn = page_to_pfn(first_page);
 
 	switch (action) {
 		case MEM_ONLINE:
-			start_pfn = page_to_pfn(first_page);
-
 			if (!pages_correctly_reserved(start_pfn, nr_pages))
 				return -EBUSY;
 
 			ret = online_pages(start_pfn, nr_pages);
 			break;
 		case MEM_OFFLINE:
-			start_paddr = page_to_pfn(first_page) << PAGE_SHIFT;
-			ret = remove_memory(start_paddr,
-					    nr_pages << PAGE_SHIFT);
+			ret = offline_pages(start_pfn, nr_pages);
 			break;
 		default:
 			WARN(1, KERN_WARNING "%s(%ld, %ld) unknown action: "
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 910550f..c183f39 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -233,7 +233,8 @@ static inline int is_mem_section_removable(unsigned long pfn,
 extern int mem_online_node(int nid);
 extern int add_memory(int nid, u64 start, u64 size);
 extern int arch_add_memory(int nid, u64 start, u64 size);
-extern int remove_memory(u64 start, u64 size);
+extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
+extern int offline_memory(u64 start, u64 size);
 extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
 								int nr_pages);
 extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms);
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 3ad25f9..bb42316 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -866,7 +866,7 @@ check_pages_isolated(unsigned long start_pfn, unsigned long end_pfn)
 	return offlined;
 }
 
-static int __ref offline_pages(unsigned long start_pfn,
+static int __ref __offline_pages(unsigned long start_pfn,
 		  unsigned long end_pfn, unsigned long timeout)
 {
 	unsigned long pfn, nr_pages, expire;
@@ -994,18 +994,24 @@ out:
 	return ret;
 }
 
-int remove_memory(u64 start, u64 size)
+int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
 {
-	unsigned long start_pfn, end_pfn;
+	return __offline_pages(start_pfn, start_pfn + nr_pages, 120 * HZ);
+}
 
-	start_pfn = PFN_DOWN(start);
-	end_pfn = start_pfn + PFN_DOWN(size);
-	return offline_pages(start_pfn, end_pfn, 120 * HZ);
+int offline_memory(u64 start, u64 size)
+{
+	return -EINVAL;
 }
 #else
-int remove_memory(u64 start, u64 size)
+int offline_pages(unsigned long start, unsigned long size)
+{
+	return -EINVAL;
+}
+
+int offline_memory(u64 start, u64 size)
 {
 	return -EINVAL;
 }
 #endif /* CONFIG_MEMORY_HOTREMOVE */
-EXPORT_SYMBOL_GPL(remove_memory);
+EXPORT_SYMBOL_GPL(offline_memory);
-- 
1.7.1


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

* [RFC v9 PATCH 02/21] memory-hotplug: implement offline_memory()
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
  2012-09-05  9:25 ` [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages() wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 03/21] memory-hotplug: store the node id in acpi_memory_device wency
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang,
	Vasilis Liaskovitis

From: Wen Congyang <wency@cn.fujitsu.com>

The function offline_memory() will be called when hot removing a
memory device. The memory device may contain more than one memory
block. If the memory block has been offlined, __offline_pages()
will fail. So we should try to offline one memory block at a
time.

If the memory block is offlined in offline_memory(), we also
update it's state, and notify the userspace that its state is
changed.

The function offline_memory() also check each memory block's
state. So there is no need to check the memory block's state
before calling offline_memory().

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
CC: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 drivers/base/memory.c          |   31 +++++++++++++++++++++++++++----
 include/linux/memory_hotplug.h |    2 ++
 mm/memory_hotplug.c            |   37 ++++++++++++++++++++++++++++++++++++-
 3 files changed, 65 insertions(+), 5 deletions(-)

diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 44e7de6..86c8821 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -275,13 +275,11 @@ memory_block_action(unsigned long phys_index, unsigned long action)
 	return ret;
 }
 
-static int memory_block_change_state(struct memory_block *mem,
+static int __memory_block_change_state(struct memory_block *mem,
 		unsigned long to_state, unsigned long from_state_req)
 {
 	int ret = 0;
 
-	mutex_lock(&mem->state_mutex);
-
 	if (mem->state != from_state_req) {
 		ret = -EINVAL;
 		goto out;
@@ -309,10 +307,20 @@ static int memory_block_change_state(struct memory_block *mem,
 		break;
 	}
 out:
-	mutex_unlock(&mem->state_mutex);
 	return ret;
 }
 
+static int memory_block_change_state(struct memory_block *mem,
+		unsigned long to_state, unsigned long from_state_req)
+{
+	int ret;
+
+	mutex_lock(&mem->state_mutex);
+	ret = __memory_block_change_state(mem, to_state, from_state_req);
+	mutex_unlock(&mem->state_mutex);
+
+	return ret;
+}
 static ssize_t
 store_mem_state(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t count)
@@ -653,6 +661,21 @@ int unregister_memory_section(struct mem_section *section)
 }
 
 /*
+ * offline one memory block. If the memory block has been offlined, do nothing.
+ */
+int offline_memory_block(struct memory_block *mem)
+{
+	int ret = 0;
+
+	mutex_lock(&mem->state_mutex);
+	if (mem->state != MEM_OFFLINE)
+		ret = __memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
+	mutex_unlock(&mem->state_mutex);
+
+	return ret;
+}
+
+/*
  * Initialize the sysfs support for memory devices...
  */
 int __init memory_dev_init(void)
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index c183f39..0b040bb 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -10,6 +10,7 @@ struct page;
 struct zone;
 struct pglist_data;
 struct mem_section;
+struct memory_block;
 
 #ifdef CONFIG_MEMORY_HOTPLUG
 
@@ -234,6 +235,7 @@ extern int mem_online_node(int nid);
 extern int add_memory(int nid, u64 start, u64 size);
 extern int arch_add_memory(int nid, u64 start, u64 size);
 extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
+extern int offline_memory_block(struct memory_block *mem);
 extern int offline_memory(u64 start, u64 size);
 extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
 								int nr_pages);
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index bb42316..6fc1908 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1001,7 +1001,42 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
 
 int offline_memory(u64 start, u64 size)
 {
-	return -EINVAL;
+	struct memory_block *mem = NULL;
+	struct mem_section *section;
+	unsigned long start_pfn, end_pfn;
+	unsigned long pfn, section_nr;
+	int ret;
+
+	start_pfn = PFN_DOWN(start);
+	end_pfn = start_pfn + PFN_DOWN(size);
+
+	for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
+		section_nr = pfn_to_section_nr(pfn);
+		if (!present_section_nr(section_nr))
+			continue;
+
+		section = __nr_to_section(section_nr);
+		/* same memblock? */
+		if (mem)
+			if ((section_nr >= mem->start_section_nr) &&
+			    (section_nr <= mem->end_section_nr))
+				continue;
+
+		mem = find_memory_block_hinted(section, mem);
+		if (!mem)
+			continue;
+
+		ret = offline_memory_block(mem);
+		if (ret) {
+			kobject_put(&mem->dev.kobj);
+			return ret;
+		}
+	}
+
+	if (mem)
+		kobject_put(&mem->dev.kobj);
+
+	return 0;
 }
 #else
 int offline_pages(unsigned long start, unsigned long size)
-- 
1.7.1


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

* [RFC v9 PATCH 03/21] memory-hotplug: store the node id in acpi_memory_device
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
  2012-09-05  9:25 ` [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages() wency
  2012-09-05  9:25 ` [RFC v9 PATCH 02/21] memory-hotplug: implement offline_memory() wency
@ 2012-09-05  9:25 ` wency
  2012-09-28  3:21   ` Ni zhan Chen
  2012-09-05  9:25 ` [RFC v9 PATCH 04/21] memory-hotplug: offline and remove memory when removing the memory device wency
                   ` (21 subsequent siblings)
  24 siblings, 1 reply; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Wen Congyang <wency@cn.fujitsu.com>

The memory device has only one node id. Store the node id when
enable the memory device, and we can reuse it when removing the
memory device.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
 drivers/acpi/acpi_memhotplug.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 2a7beac..7873832 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -83,6 +83,7 @@ struct acpi_memory_info {
 struct acpi_memory_device {
 	struct acpi_device * device;
 	unsigned int state;	/* State of the memory device */
+	int nid;
 	struct list_head res_list;
 };
 
@@ -256,6 +257,9 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 		info->enabled = 1;
 		num_enabled++;
 	}
+
+	mem_device->nid = node;
+
 	if (!num_enabled) {
 		printk(KERN_ERR PREFIX "add_memory failed\n");
 		mem_device->state = MEMORY_INVALID_STATE;
-- 
1.7.1


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

* [RFC v9 PATCH 04/21] memory-hotplug: offline and remove memory when removing the memory device
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (2 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 03/21] memory-hotplug: store the node id in acpi_memory_device wency
@ 2012-09-05  9:25 ` wency
  2012-09-28  4:48   ` Ni zhan Chen
  2012-09-05  9:25 ` [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not wency
                   ` (20 subsequent siblings)
  24 siblings, 1 reply; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

We should offline and remove memory when removing the memory device.
The memory device can be removed by 2 ways:
1. send eject request by SCI
2. echo 1 >/sys/bus/pci/devices/PNP0C80:XX/eject

In the 1st case, acpi_memory_disable_device() will be called. In the 2nd
case, acpi_memory_device_remove() will be called. acpi_memory_device_remove()
will also be called when we unbind the memory device from the driver
acpi_memhotplug. If the type is ACPI_BUS_REMOVAL_EJECT, it means
that the user wants to eject the memory device, and we should offline
and remove memory in acpi_memory_device_remove().

The function remove_memory() is not implemeted now. It only check whether
all memory has been offllined now.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 drivers/acpi/acpi_memhotplug.c |   45 +++++++++++++++++++++++++++++++++------
 drivers/base/memory.c          |   39 ++++++++++++++++++++++++++++++++++
 include/linux/memory.h         |    5 ++++
 include/linux/memory_hotplug.h |    5 ++++
 mm/memory_hotplug.c            |   22 +++++++++++++++++++
 5 files changed, 109 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 7873832..9d47458 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -29,6 +29,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
+#include <linux/memory.h>
 #include <linux/memory_hotplug.h>
 #include <linux/slab.h>
 #include <acpi/acpi_drivers.h>
@@ -310,25 +311,44 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
 	return 0;
 }
 
-static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
+static int
+acpi_memory_device_remove_memory(struct acpi_memory_device *mem_device)
 {
 	int result;
 	struct acpi_memory_info *info, *n;
+	int node = mem_device->nid;
 
-
-	/*
-	 * Ask the VM to offline this memory range.
-	 * Note: Assume that this function returns zero on success
-	 */
 	list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
 		if (info->enabled) {
 			result = offline_memory(info->start_addr, info->length);
 			if (result)
 				return result;
+
+			result = remove_memory(node, info->start_addr,
+					       info->length);
+			if (result)
+				return result;
 		}
+
+		list_del(&info->list);
 		kfree(info);
 	}
 
+	return 0;
+}
+
+static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
+{
+	int result;
+
+	/*
+	 * Ask the VM to offline this memory range.
+	 * Note: Assume that this function returns zero on success
+	 */
+	result = acpi_memory_device_remove_memory(mem_device);
+	if (result)
+		return result;
+
 	/* Power-off and eject the device */
 	result = acpi_memory_powerdown_device(mem_device);
 	if (result) {
@@ -477,12 +497,23 @@ static int acpi_memory_device_add(struct acpi_device *device)
 static int acpi_memory_device_remove(struct acpi_device *device, int type)
 {
 	struct acpi_memory_device *mem_device = NULL;
-
+	int result;
 
 	if (!device || !acpi_driver_data(device))
 		return -EINVAL;
 
 	mem_device = acpi_driver_data(device);
+
+	if (type == ACPI_BUS_REMOVAL_EJECT) {
+		/*
+		 * offline and remove memory only when the memory device is
+		 * ejected.
+		 */
+		result = acpi_memory_device_remove_memory(mem_device);
+		if (result)
+			return result;
+	}
+
 	kfree(mem_device);
 
 	return 0;
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 86c8821..038be73 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -70,6 +70,45 @@ void unregister_memory_isolate_notifier(struct notifier_block *nb)
 }
 EXPORT_SYMBOL(unregister_memory_isolate_notifier);
 
+bool is_memblk_offline(unsigned long start, unsigned long size)
+{
+	struct memory_block *mem = NULL;
+	struct mem_section *section;
+	unsigned long start_pfn, end_pfn;
+	unsigned long pfn, section_nr;
+
+	start_pfn = PFN_DOWN(start);
+	end_pfn = PFN_UP(start + size);
+
+	for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
+		section_nr = pfn_to_section_nr(pfn);
+		if (!present_section_nr(section_nr))
+			continue;
+
+		section = __nr_to_section(section_nr);
+		/* same memblock? */
+		if (mem)
+			if ((section_nr >= mem->start_section_nr) &&
+			    (section_nr <= mem->end_section_nr))
+				continue;
+
+		mem = find_memory_block_hinted(section, mem);
+		if (!mem)
+			continue;
+		if (mem->state == MEM_OFFLINE)
+			continue;
+
+		kobject_put(&mem->dev.kobj);
+		return false;
+	}
+
+	if (mem)
+		kobject_put(&mem->dev.kobj);
+
+	return true;
+}
+EXPORT_SYMBOL(is_memblk_offline);
+
 /*
  * register_memory - Setup a sysfs device for a memory block
  */
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 1ac7f6e..7c66126 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -106,6 +106,10 @@ static inline int memory_isolate_notify(unsigned long val, void *v)
 {
 	return 0;
 }
+static inline bool is_memblk_offline(unsigned long start, unsigned long size)
+{
+	return false;
+}
 #else
 extern int register_memory_notifier(struct notifier_block *nb);
 extern void unregister_memory_notifier(struct notifier_block *nb);
@@ -120,6 +124,7 @@ extern int memory_isolate_notify(unsigned long val, void *v);
 extern struct memory_block *find_memory_block_hinted(struct mem_section *,
 							struct memory_block *);
 extern struct memory_block *find_memory_block(struct mem_section *);
+extern bool is_memblk_offline(unsigned long start, unsigned long size);
 #define CONFIG_MEM_BLOCK_SIZE	(PAGES_PER_SECTION<<PAGE_SHIFT)
 enum mem_add_context { BOOT, HOTPLUG };
 #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 0b040bb..fd84ea9 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -222,6 +222,7 @@ static inline void unlock_memory_hotplug(void) {}
 #ifdef CONFIG_MEMORY_HOTREMOVE
 
 extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages);
+extern int remove_memory(int nid, u64 start, u64 size);
 
 #else
 static inline int is_mem_section_removable(unsigned long pfn,
@@ -229,6 +230,10 @@ static inline int is_mem_section_removable(unsigned long pfn,
 {
 	return 0;
 }
+static inline int remove_memory(int nid, u64 start, u64 size)
+{
+	return -EBUSY;
+}
 #endif /* CONFIG_MEMORY_HOTREMOVE */
 
 extern int mem_online_node(int nid);
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 6fc1908..49f7747 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1038,6 +1038,28 @@ int offline_memory(u64 start, u64 size)
 
 	return 0;
 }
+
+int remove_memory(int nid, u64 start, u64 size)
+{
+	int ret = -EBUSY;
+	lock_memory_hotplug();
+	/*
+	 * The memory might become online by other task, even if you offine it.
+	 * So we check whether the memory has been onlined or not.
+	 */
+	if (!is_memblk_offline(start, size)) {
+		pr_warn("memory removing [mem %#010llx-%#010llx] failed, "
+			"because the memmory range is online\n",
+			start, start + size);
+		ret = -EAGAIN;
+	}
+
+	unlock_memory_hotplug();
+	return ret;
+
+}
+EXPORT_SYMBOL_GPL(remove_memory);
+
 #else
 int offline_pages(unsigned long start, unsigned long size)
 {
-- 
1.7.1


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

* [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (3 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 04/21] memory-hotplug: offline and remove memory when removing the memory device wency
@ 2012-09-05  9:25 ` wency
  2012-09-11  2:15   ` Wen Congyang
  2012-09-05  9:25 ` [RFC v9 PATCH 06/21] memory-hotplug: export the function acpi_bus_remove() wency
                   ` (19 subsequent siblings)
  24 siblings, 1 reply; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

If system supports memory hot-remove, online_pages() may online removed pages.
So online_pages() need to check whether onlining pages are present or not.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
 include/linux/mmzone.h |   19 +++++++++++++++++++
 mm/memory_hotplug.c    |   13 +++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 2daa54f..ac3ae30 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1180,6 +1180,25 @@ void sparse_init(void);
 #define sparse_index_init(_sec, _nid)  do {} while (0)
 #endif /* CONFIG_SPARSEMEM */
 
+#ifdef CONFIG_SPARSEMEM
+static inline int pfns_present(unsigned long pfn, unsigned long nr_pages)
+{
+	int i;
+	for (i = 0; i < nr_pages; i++) {
+		if (pfn_present(pfn + i))
+			continue;
+		else
+			return -EINVAL;
+	}
+	return 0;
+}
+#else
+static inline int pfns_present(unsigned long pfn, unsigned long nr_pages)
+{
+	return 0;
+}
+#endif /* CONFIG_SPARSEMEM*/
+
 #ifdef CONFIG_NODES_SPAN_OTHER_NODES
 bool early_pfn_in_nid(unsigned long pfn, int nid);
 #else
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 49f7747..299747d 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -467,6 +467,19 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
 	struct memory_notify arg;
 
 	lock_memory_hotplug();
+	/*
+	 * If system supports memory hot-remove, the memory may have been
+	 * removed. So we check whether the memory has been removed or not.
+	 *
+	 * Note: When CONFIG_SPARSEMEM is defined, pfns_present() become
+	 *       effective. If CONFIG_SPARSEMEM is not defined, pfns_present()
+	 *       always returns 0.
+	 */
+	ret = pfns_present(pfn, nr_pages);
+	if (ret) {
+		unlock_memory_hotplug();
+		return ret;
+	}
 	arg.start_pfn = pfn;
 	arg.nr_pages = nr_pages;
 	arg.status_change_nid = -1;
-- 
1.7.1


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

* [RFC v9 PATCH 06/21] memory-hotplug: export the function acpi_bus_remove()
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (4 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not wency
@ 2012-09-05  9:25 ` wency
  2012-10-02  0:34   ` Ni zhan Chen
  2012-09-05  9:25 ` [RFC v9 PATCH 07/21] memory-hotplug: call acpi_bus_remove() to remove memory device wency
                   ` (18 subsequent siblings)
  24 siblings, 1 reply; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Wen Congyang <wency@cn.fujitsu.com>

The function acpi_bus_remove() can remove a acpi device from acpi device.
When a acpi device is removed, we need to call this function to remove
the acpi device from acpi bus. So export this function.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 drivers/acpi/scan.c     |    3 ++-
 include/acpi/acpi_bus.h |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index d1ecca2..1cefc34 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1224,7 +1224,7 @@ static int acpi_device_set_context(struct acpi_device *device)
 	return -ENODEV;
 }
 
-static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
+int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
 {
 	if (!dev)
 		return -EINVAL;
@@ -1246,6 +1246,7 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
 
 	return 0;
 }
+EXPORT_SYMBOL(acpi_bus_remove);
 
 static int acpi_add_single_object(struct acpi_device **child,
 				  acpi_handle handle, int type,
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index bde976e..2ccf109 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -360,6 +360,7 @@ bool acpi_bus_power_manageable(acpi_handle handle);
 bool acpi_bus_can_wakeup(acpi_handle handle);
 int acpi_power_resource_register_device(struct device *dev, acpi_handle handle);
 void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handle);
+int acpi_bus_remove(struct acpi_device *dev, int rmdevice);
 #ifdef CONFIG_ACPI_PROC_EVENT
 int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
 int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data);
-- 
1.7.1


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

* [RFC v9 PATCH 07/21] memory-hotplug: call acpi_bus_remove() to remove memory device
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (5 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 06/21] memory-hotplug: export the function acpi_bus_remove() wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 08/21] memory-hotplug: remove /sys/firmware/memmap/X sysfs wency
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Wen Congyang <wency@cn.fujitsu.com>

The memory device has been ejected and powoffed, so we can call
acpi_bus_remove() to remove the memory device from acpi bus.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 drivers/acpi/acpi_memhotplug.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 9d47458..b152767 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -425,8 +425,9 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 		}
 
 		/*
-		 * TBD: Invoke acpi_bus_remove to cleanup data structures
+		 * Invoke acpi_bus_remove() to remove memory device
 		 */
+		acpi_bus_remove(device, 1);
 
 		/* _EJ0 succeeded; _OST is not necessary */
 		return;
-- 
1.7.1


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

* [RFC v9 PATCH 08/21] memory-hotplug: remove /sys/firmware/memmap/X sysfs
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (6 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 07/21] memory-hotplug: call acpi_bus_remove() to remove memory device wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 09/21] memory-hotplug: does not release memory region in PAGES_PER_SECTION chunks wency
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

When (hot)adding memory into system, /sys/firmware/memmap/X/{end, start, type}
sysfs files are created. But there is no code to remove these files. The patch
implements the function to remove them.

Note : The code does not free firmware_map_entry since there is no way to free
       memory which is allocated by bootmem.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 drivers/firmware/memmap.c    |   98 +++++++++++++++++++++++++++++++++++++++++-
 include/linux/firmware-map.h |    6 +++
 mm/memory_hotplug.c          |    9 +++-
 3 files changed, 109 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c
index c1cdc92..6740d26 100644
--- a/drivers/firmware/memmap.c
+++ b/drivers/firmware/memmap.c
@@ -21,6 +21,7 @@
 #include <linux/types.h>
 #include <linux/bootmem.h>
 #include <linux/slab.h>
+#include <linux/mm.h>
 
 /*
  * Data types ------------------------------------------------------------------
@@ -41,6 +42,7 @@ struct firmware_map_entry {
 	const char		*type;	/* type of the memory range */
 	struct list_head	list;	/* entry for the linked list */
 	struct kobject		kobj;   /* kobject for each entry */
+	unsigned int		bootmem:1; /* allocated from bootmem */
 };
 
 /*
@@ -79,7 +81,26 @@ static const struct sysfs_ops memmap_attr_ops = {
 	.show = memmap_attr_show,
 };
 
+
+static inline struct firmware_map_entry *
+to_memmap_entry(struct kobject *kobj)
+{
+	return container_of(kobj, struct firmware_map_entry, kobj);
+}
+
+static void release_firmware_map_entry(struct kobject *kobj)
+{
+	struct firmware_map_entry *entry = to_memmap_entry(kobj);
+
+	if (entry->bootmem)
+		/* There is no way to free memory allocated from bootmem */
+		return;
+
+	kfree(entry);
+}
+
 static struct kobj_type memmap_ktype = {
+	.release	= release_firmware_map_entry,
 	.sysfs_ops	= &memmap_attr_ops,
 	.default_attrs	= def_attrs,
 };
@@ -94,6 +115,7 @@ static struct kobj_type memmap_ktype = {
  * in firmware initialisation code in one single thread of execution.
  */
 static LIST_HEAD(map_entries);
+static DEFINE_SPINLOCK(map_entries_lock);
 
 /**
  * firmware_map_add_entry() - Does the real work to add a firmware memmap entry.
@@ -118,11 +140,25 @@ static int firmware_map_add_entry(u64 start, u64 end,
 	INIT_LIST_HEAD(&entry->list);
 	kobject_init(&entry->kobj, &memmap_ktype);
 
+	spin_lock(&map_entries_lock);
 	list_add_tail(&entry->list, &map_entries);
+	spin_unlock(&map_entries_lock);
 
 	return 0;
 }
 
+/**
+ * firmware_map_remove_entry() - Does the real work to remove a firmware
+ * memmap entry.
+ * @entry: removed entry.
+ **/
+static inline void firmware_map_remove_entry(struct firmware_map_entry *entry)
+{
+	spin_lock(&map_entries_lock);
+	list_del(&entry->list);
+	spin_unlock(&map_entries_lock);
+}
+
 /*
  * Add memmap entry on sysfs
  */
@@ -144,6 +180,35 @@ static int add_sysfs_fw_map_entry(struct firmware_map_entry *entry)
 	return 0;
 }
 
+/*
+ * Remove memmap entry on sysfs
+ */
+static inline void remove_sysfs_fw_map_entry(struct firmware_map_entry *entry)
+{
+	kobject_put(&entry->kobj);
+}
+
+/*
+ * Search memmap entry
+ */
+
+static struct firmware_map_entry * __meminit
+firmware_map_find_entry(u64 start, u64 end, const char *type)
+{
+	struct firmware_map_entry *entry;
+
+	spin_lock(&map_entries_lock);
+	list_for_each_entry(entry, &map_entries, list)
+		if ((entry->start == start) && (entry->end == end) &&
+		    (!strcmp(entry->type, type))) {
+			spin_unlock(&map_entries_lock);
+			return entry;
+		}
+
+	spin_unlock(&map_entries_lock);
+	return NULL;
+}
+
 /**
  * firmware_map_add_hotplug() - Adds a firmware mapping entry when we do
  * memory hotplug.
@@ -193,9 +258,36 @@ int __init firmware_map_add_early(u64 start, u64 end, const char *type)
 	if (WARN_ON(!entry))
 		return -ENOMEM;
 
+	entry->bootmem = 1;
 	return firmware_map_add_entry(start, end, type, entry);
 }
 
+/**
+ * firmware_map_remove() - remove a firmware mapping entry
+ * @start: Start of the memory range.
+ * @end:   End of the memory range.
+ * @type:  Type of the memory range.
+ *
+ * removes a firmware mapping entry.
+ *
+ * Returns 0 on success, or -EINVAL if no entry.
+ **/
+int __meminit firmware_map_remove(u64 start, u64 end, const char *type)
+{
+	struct firmware_map_entry *entry;
+
+	entry = firmware_map_find_entry(start, end - 1, type);
+	if (!entry)
+		return -EINVAL;
+
+	firmware_map_remove_entry(entry);
+
+	/* remove the memmap entry */
+	remove_sysfs_fw_map_entry(entry);
+
+	return 0;
+}
+
 /*
  * Sysfs functions -------------------------------------------------------------
  */
@@ -217,8 +309,10 @@ static ssize_t type_show(struct firmware_map_entry *entry, char *buf)
 	return snprintf(buf, PAGE_SIZE, "%s\n", entry->type);
 }
 
-#define to_memmap_attr(_attr) container_of(_attr, struct memmap_attribute, attr)
-#define to_memmap_entry(obj) container_of(obj, struct firmware_map_entry, kobj)
+static inline struct memmap_attribute *to_memmap_attr(struct attribute *attr)
+{
+	return container_of(attr, struct memmap_attribute, attr);
+}
 
 static ssize_t memmap_attr_show(struct kobject *kobj,
 				struct attribute *attr, char *buf)
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h
index 43fe52f..71d4fa7 100644
--- a/include/linux/firmware-map.h
+++ b/include/linux/firmware-map.h
@@ -25,6 +25,7 @@
 
 int firmware_map_add_early(u64 start, u64 end, const char *type);
 int firmware_map_add_hotplug(u64 start, u64 end, const char *type);
+int firmware_map_remove(u64 start, u64 end, const char *type);
 
 #else /* CONFIG_FIRMWARE_MEMMAP */
 
@@ -38,6 +39,11 @@ static inline int firmware_map_add_hotplug(u64 start, u64 end, const char *type)
 	return 0;
 }
 
+static inline int firmware_map_remove(u64 start, u64 end, const char *type)
+{
+	return 0;
+}
+
 #endif /* CONFIG_FIRMWARE_MEMMAP */
 
 #endif /* _LINUX_FIRMWARE_MAP_H */
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 299747d..e74a01d 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1052,9 +1052,9 @@ int offline_memory(u64 start, u64 size)
 	return 0;
 }
 
-int remove_memory(int nid, u64 start, u64 size)
+int __ref remove_memory(int nid, u64 start, u64 size)
 {
-	int ret = -EBUSY;
+	int ret = 0;
 	lock_memory_hotplug();
 	/*
 	 * The memory might become online by other task, even if you offine it.
@@ -1065,8 +1065,13 @@ int remove_memory(int nid, u64 start, u64 size)
 			"because the memmory range is online\n",
 			start, start + size);
 		ret = -EAGAIN;
+		goto out;
 	}
 
+	/* remove memmap entry */
+	firmware_map_remove(start, start + size, "System RAM");
+
+out:
 	unlock_memory_hotplug();
 	return ret;
 
-- 
1.7.1


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

* [RFC v9 PATCH 09/21] memory-hotplug: does not release memory region in PAGES_PER_SECTION chunks
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (7 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 08/21] memory-hotplug: remove /sys/firmware/memmap/X sysfs wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 10/21] memory-hotplug: add memory_block_release wency
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

Since applying a patch(de7f0cba96786c), release_mem_region() has been changed
as called in PAGES_PER_SECTION chunks because register_memory_resource() is
called in PAGES_PER_SECTION chunks by add_memory(). But it seems firmware
dependency. If CRS are written in the PAGES_PER_SECTION chunks in ACPI DSDT
Table, register_memory_resource() is called in PAGES_PER_SECTION chunks.
But if CRS are written in the DIMM unit in ACPI DSDT Table,
register_memory_resource() is called in DIMM unit. So release_mem_region()
should not be called in PAGES_PER_SECTION chunks. The patch fixes it.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
 arch/powerpc/platforms/pseries/hotplug-memory.c |   13 +++++++++----
 mm/memory_hotplug.c                             |    4 ++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 11d8e05..dc0a035 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -77,7 +77,8 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
 {
 	unsigned long start, start_pfn;
 	struct zone *zone;
-	int ret;
+	int i, ret;
+	int sections_to_remove;
 
 	start_pfn = base >> PAGE_SHIFT;
 
@@ -97,9 +98,13 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
 	 * to sysfs "state" file and we can't remove sysfs entries
 	 * while writing to it. So we have to defer it to here.
 	 */
-	ret = __remove_pages(zone, start_pfn, memblock_size >> PAGE_SHIFT);
-	if (ret)
-		return ret;
+	sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION;
+	for (i = 0; i < sections_to_remove; i++) {
+		unsigned long pfn = start_pfn + i * PAGES_PER_SECTION;
+		ret = __remove_pages(zone, start_pfn,  PAGES_PER_SECTION);
+		if (ret)
+			return ret;
+	}
 
 	/*
 	 * Update memory regions for memory remove
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index e74a01d..2353887 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -358,11 +358,11 @@ int __remove_pages(struct zone *zone, unsigned long phys_start_pfn,
 	BUG_ON(phys_start_pfn & ~PAGE_SECTION_MASK);
 	BUG_ON(nr_pages % PAGES_PER_SECTION);
 
+	release_mem_region(phys_start_pfn << PAGE_SHIFT,  nr_pages * PAGE_SIZE);
+
 	sections_to_remove = nr_pages / PAGES_PER_SECTION;
 	for (i = 0; i < sections_to_remove; i++) {
 		unsigned long pfn = phys_start_pfn + i*PAGES_PER_SECTION;
-		release_mem_region(pfn << PAGE_SHIFT,
-				   PAGES_PER_SECTION << PAGE_SHIFT);
 		ret = __remove_section(zone, __pfn_to_section(pfn));
 		if (ret)
 			break;
-- 
1.7.1


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

* [RFC v9 PATCH 10/21] memory-hotplug: add memory_block_release
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (8 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 09/21] memory-hotplug: does not release memory region in PAGES_PER_SECTION chunks wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 11/21] memory-hotplug: remove_memory calls __remove_pages wency
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

When calling remove_memory_block(), the function shows following message at
device_release().

Device 'memory528' does not have a release() function, it is broken and must
be fixed.

remove_memory_block() calls kfree(mem). I think it shouled be called from
device_release(). So the patch implements memory_block_release()

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
 drivers/base/memory.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 038be73..f44d624 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -109,6 +109,13 @@ bool is_memblk_offline(unsigned long start, unsigned long size)
 }
 EXPORT_SYMBOL(is_memblk_offline);
 
+static void release_memory_block(struct device *dev)
+{
+	struct memory_block *mem = container_of(dev, struct memory_block, dev);
+
+	kfree(mem);
+}
+
 /*
  * register_memory - Setup a sysfs device for a memory block
  */
@@ -119,6 +126,7 @@ int register_memory(struct memory_block *memory)
 
 	memory->dev.bus = &memory_subsys;
 	memory->dev.id = memory->start_section_nr / sections_per_block;
+	memory->dev.release = release_memory_block;
 
 	error = device_register(&memory->dev);
 	return error;
@@ -674,7 +682,6 @@ int remove_memory_block(unsigned long node_id, struct mem_section *section,
 		mem_remove_simple_file(mem, phys_device);
 		mem_remove_simple_file(mem, removable);
 		unregister_memory(mem);
-		kfree(mem);
 	} else
 		kobject_put(&mem->dev.kobj);
 
-- 
1.7.1


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

* [RFC v9 PATCH 11/21] memory-hotplug: remove_memory calls __remove_pages
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (9 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 10/21] memory-hotplug: add memory_block_release wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 12/21] memory-hotplug: introduce new function arch_remove_memory() wency
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

The patch adds __remove_pages() to remove_memory(). Then the range of
phys_start_pfn argument and nr_pages argument in __remove_pagse() may
have different zone. So zone argument is removed from __remove_pages()
and __remove_pages() caluculates zone in each section.

When CONFIG_SPARSEMEM_VMEMMAP is defined, there is no way to remove a memmap.
So __remove_section only calls unregister_memory_section().

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
 arch/powerpc/platforms/pseries/hotplug-memory.c |    5 +----
 include/linux/memory_hotplug.h                  |    3 +--
 mm/memory_hotplug.c                             |   17 ++++++++++-------
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index dc0a035..cc14da4 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -76,7 +76,6 @@ unsigned long memory_block_size_bytes(void)
 static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
 {
 	unsigned long start, start_pfn;
-	struct zone *zone;
 	int i, ret;
 	int sections_to_remove;
 
@@ -87,8 +86,6 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
 		return 0;
 	}
 
-	zone = page_zone(pfn_to_page(start_pfn));
-
 	/*
 	 * Remove section mappings and sysfs entries for the
 	 * section of the memory we are removing.
@@ -101,7 +98,7 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
 	sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION;
 	for (i = 0; i < sections_to_remove; i++) {
 		unsigned long pfn = start_pfn + i * PAGES_PER_SECTION;
-		ret = __remove_pages(zone, start_pfn,  PAGES_PER_SECTION);
+		ret = __remove_pages(start_pfn,  PAGES_PER_SECTION);
 		if (ret)
 			return ret;
 	}
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index fd84ea9..8bf820d 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -90,8 +90,7 @@ extern bool is_pageblock_removable_nolock(struct page *page);
 /* reasonably generic interface to expand the physical pages in a zone  */
 extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn,
 	unsigned long nr_pages);
-extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
-	unsigned long nr_pages);
+extern int __remove_pages(unsigned long start_pfn, unsigned long nr_pages);
 
 #ifdef CONFIG_NUMA
 extern int memory_add_physaddr_to_nid(u64 start);
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 2353887..7fbfc9f 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -275,11 +275,14 @@ static int __meminit __add_section(int nid, struct zone *zone,
 #ifdef CONFIG_SPARSEMEM_VMEMMAP
 static int __remove_section(struct zone *zone, struct mem_section *ms)
 {
-	/*
-	 * XXX: Freeing memmap with vmemmap is not implement yet.
-	 *      This should be removed later.
-	 */
-	return -EBUSY;
+	int ret = -EINVAL;
+
+	if (!valid_section(ms))
+		return ret;
+
+	ret = unregister_memory_section(ms);
+
+	return ret;
 }
 #else
 static int __remove_section(struct zone *zone, struct mem_section *ms)
@@ -346,8 +349,7 @@ EXPORT_SYMBOL_GPL(__add_pages);
  * sure that pages are marked reserved and zones are adjust properly by
  * calling offline_pages().
  */
-int __remove_pages(struct zone *zone, unsigned long phys_start_pfn,
-		 unsigned long nr_pages)
+int __remove_pages(unsigned long phys_start_pfn, unsigned long nr_pages)
 {
 	unsigned long i, ret = 0;
 	int sections_to_remove;
@@ -363,6 +365,7 @@ int __remove_pages(struct zone *zone, unsigned long phys_start_pfn,
 	sections_to_remove = nr_pages / PAGES_PER_SECTION;
 	for (i = 0; i < sections_to_remove; i++) {
 		unsigned long pfn = phys_start_pfn + i*PAGES_PER_SECTION;
+		struct zone *zone = page_zone(pfn_to_page(pfn));
 		ret = __remove_section(zone, __pfn_to_section(pfn));
 		if (ret)
 			break;
-- 
1.7.1


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

* [RFC v9 PATCH 12/21] memory-hotplug: introduce new function arch_remove_memory()
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (10 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 11/21] memory-hotplug: remove_memory calls __remove_pages wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 13/21] memory-hotplug: check page type in get_page_bootmem wency
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Wen Congyang <wency@cn.fujitsu.com>

We don't call __add_pages() directly in the function add_memory()
because some other architecture related things need to be done
before or after calling __add_pages(). So we should introduce
a new function arch_remove_memory() to revert the things
done in arch_add_memory().

Note: the function for s390 is not implemented(I don't know how to
implement it for s390).

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 arch/ia64/mm/init.c                  |   16 ++++
 arch/powerpc/mm/mem.c                |   14 +++
 arch/s390/mm/init.c                  |   12 +++
 arch/sh/mm/init.c                    |   15 +++
 arch/tile/mm/init.c                  |    8 ++
 arch/x86/include/asm/pgtable_types.h |    1 +
 arch/x86/mm/init_32.c                |   10 ++
 arch/x86/mm/init_64.c                |  160 ++++++++++++++++++++++++++++++++++
 arch/x86/mm/pageattr.c               |   47 +++++-----
 include/linux/memory_hotplug.h       |    1 +
 mm/memory_hotplug.c                  |    1 +
 11 files changed, 263 insertions(+), 22 deletions(-)

diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 0eab454..1e345ed 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -688,6 +688,22 @@ int arch_add_memory(int nid, u64 start, u64 size)
 
 	return ret;
 }
+
+#ifdef CONFIG_MEMORY_HOTREMOVE
+int arch_remove_memory(u64 start, u64 size)
+{
+	unsigned long start_pfn = start >> PAGE_SHIFT;
+	unsigned long nr_pages = size >> PAGE_SHIFT;
+	int ret;
+
+	ret = __remove_pages(start_pfn, nr_pages);
+	if (ret)
+		pr_warn("%s: Problem encountered in __remove_pages() as"
+			" ret=%d\n", __func__,  ret);
+
+	return ret;
+}
+#endif
 #endif
 
 /*
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index fbdad0e..011170b 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -133,6 +133,20 @@ int arch_add_memory(int nid, u64 start, u64 size)
 
 	return __add_pages(nid, zone, start_pfn, nr_pages);
 }
+
+#ifdef CONFIG_MEMORY_HOTREMOVE
+int arch_remove_memory(u64 start, u64 size)
+{
+	unsigned long start_pfn = start >> PAGE_SHIFT;
+	unsigned long nr_pages = size >> PAGE_SHIFT;
+
+	start = (unsigned long)__va(start);
+	if (remove_section_mapping(start, start + size))
+		return -EINVAL;
+
+	return __remove_pages(start_pfn, nr_pages);
+}
+#endif
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
 /*
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 6adbc08..501b20e 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -257,4 +257,16 @@ int arch_add_memory(int nid, u64 start, u64 size)
 		vmem_remove_mapping(start, size);
 	return rc;
 }
+
+#ifdef CONFIG_MEMORY_HOTREMOVE
+int arch_remove_memory(u64 start, u64 size)
+{
+	/*
+	 * There is no hardware or firmware interface which could trigger a
+	 * hot memory remove on s390. So there is nothing that needs to be
+	 * implemented.
+	 */
+	return -EBUSY;
+}
+#endif
 #endif /* CONFIG_MEMORY_HOTPLUG */
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 82cc576..fc84491 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -558,4 +558,19 @@ int memory_add_physaddr_to_nid(u64 addr)
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
 
+#ifdef CONFIG_MEMORY_HOTREMOVE
+int arch_remove_memory(u64 start, u64 size)
+{
+	unsigned long start_pfn = start >> PAGE_SHIFT;
+	unsigned long nr_pages = size >> PAGE_SHIFT;
+	int ret;
+
+	ret = __remove_pages(start_pfn, nr_pages);
+	if (unlikely(ret))
+		pr_warn("%s: Failed, __remove_pages() == %d\n", __func__,
+			ret);
+
+	return ret;
+}
+#endif
 #endif /* CONFIG_MEMORY_HOTPLUG */
diff --git a/arch/tile/mm/init.c b/arch/tile/mm/init.c
index ef29d6c..2749515 100644
--- a/arch/tile/mm/init.c
+++ b/arch/tile/mm/init.c
@@ -935,6 +935,14 @@ int remove_memory(u64 start, u64 size)
 {
 	return -EINVAL;
 }
+
+#ifdef CONFIG_MEMORY_HOTREMOVE
+int arch_remove_memory(u64 start, u64 size)
+{
+	/* TODO */
+	return -EBUSY;
+}
+#endif
 #endif
 
 struct kmem_cache *pgd_cache;
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 013286a..b725af2 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -334,6 +334,7 @@ static inline void update_page_count(int level, unsigned long pages) { }
  * as a pte too.
  */
 extern pte_t *lookup_address(unsigned long address, unsigned int *level);
+extern int __split_large_page(pte_t *kpte, unsigned long address, pte_t *pbase);
 
 #endif	/* !__ASSEMBLY__ */
 
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 575d86f..41eefe8 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -842,6 +842,16 @@ int arch_add_memory(int nid, u64 start, u64 size)
 
 	return __add_pages(nid, zone, start_pfn, nr_pages);
 }
+
+#ifdef CONFIG_MEMORY_HOTREMOVE
+int arch_remove_memory(u64 start, u64 size)
+{
+	unsigned long start_pfn = start >> PAGE_SHIFT;
+	unsigned long nr_pages = size >> PAGE_SHIFT;
+
+	return __remove_pages(start_pfn, nr_pages);
+}
+#endif
 #endif
 
 /*
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 2b6b4a3..e0d88ba 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -675,6 +675,166 @@ int arch_add_memory(int nid, u64 start, u64 size)
 }
 EXPORT_SYMBOL_GPL(arch_add_memory);
 
+static void __meminit
+phys_pte_remove(pte_t *pte_page, unsigned long addr, unsigned long end)
+{
+	unsigned pages = 0;
+	int i = pte_index(addr);
+
+	pte_t *pte = pte_page + pte_index(addr);
+
+	for (; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE, pte++) {
+
+		if (addr >= end)
+			break;
+
+		if (!pte_present(*pte))
+			continue;
+
+		pages++;
+		set_pte(pte, __pte(0));
+	}
+
+	update_page_count(PG_LEVEL_4K, -pages);
+}
+
+static void __meminit
+phys_pmd_remove(pmd_t *pmd_page, unsigned long addr, unsigned long end)
+{
+	unsigned long pages = 0, next;
+	int i = pmd_index(addr);
+
+	for (; i < PTRS_PER_PMD; i++, addr = next) {
+		unsigned long pte_phys;
+		pmd_t *pmd = pmd_page + pmd_index(addr);
+		pte_t *pte;
+
+		if (addr >= end)
+			break;
+
+		next = (addr & PMD_MASK) + PMD_SIZE;
+
+		if (!pmd_present(*pmd))
+			continue;
+
+		if (pmd_large(*pmd)) {
+			if ((addr & ~PMD_MASK) == 0 && next <= end) {
+				set_pmd(pmd, __pmd(0));
+				pages++;
+				continue;
+			}
+
+			/*
+			 * We use 2M page, but we need to remove part of them,
+			 * so split 2M page to 4K page.
+			 */
+			pte = alloc_low_page(&pte_phys);
+			__split_large_page((pte_t *)pmd, addr, pte);
+
+			spin_lock(&init_mm.page_table_lock);
+			pmd_populate_kernel(&init_mm, pmd, __va(pte_phys));
+			spin_unlock(&init_mm.page_table_lock);
+		}
+
+		spin_lock(&init_mm.page_table_lock);
+		pte = map_low_page((pte_t *)pmd_page_vaddr(*pmd));
+		phys_pte_remove(pte, addr, end);
+		unmap_low_page(pte);
+		spin_unlock(&init_mm.page_table_lock);
+	}
+	update_page_count(PG_LEVEL_2M, -pages);
+}
+
+static void __meminit
+phys_pud_remove(pud_t *pud_page, unsigned long addr, unsigned long end)
+{
+	unsigned long pages = 0, next;
+	int i = pud_index(addr);
+
+	for (; i < PTRS_PER_PUD; i++, addr = next) {
+		unsigned long pmd_phys;
+		pud_t *pud = pud_page + pud_index(addr);
+		pmd_t *pmd;
+
+		if (addr >= end)
+			break;
+
+		next = (addr & PUD_MASK) + PUD_SIZE;
+
+		if (!pud_present(*pud))
+			continue;
+
+		if (pud_large(*pud)) {
+			if ((addr & ~PUD_MASK) == 0 && next <= end) {
+				set_pud(pud, __pud(0));
+				pages++;
+				continue;
+			}
+
+			/*
+			 * We use 1G page, but we need to remove part of them,
+			 * so split 1G page to 2M page.
+			 */
+			pmd = alloc_low_page(&pmd_phys);
+			__split_large_page((pte_t *)pud, addr, (pte_t *)pmd);
+
+			spin_lock(&init_mm.page_table_lock);
+			pud_populate(&init_mm, pud, __va(pmd_phys));
+			spin_unlock(&init_mm.page_table_lock);
+		}
+
+		pmd = map_low_page(pmd_offset(pud, 0));
+		phys_pmd_remove(pmd, addr, end);
+		unmap_low_page(pmd);
+		__flush_tlb_all();
+	}
+	__flush_tlb_all();
+
+	update_page_count(PG_LEVEL_1G, -pages);
+}
+
+void __meminit
+kernel_physical_mapping_remove(unsigned long start, unsigned long end)
+{
+	unsigned long next;
+
+	start = (unsigned long)__va(start);
+	end = (unsigned long)__va(end);
+
+	for (; start < end; start = next) {
+		pgd_t *pgd = pgd_offset_k(start);
+		pud_t *pud;
+
+		next = (start + PGDIR_SIZE) & PGDIR_MASK;
+		if (next > end)
+			next = end;
+
+		if (!pgd_present(*pgd))
+			continue;
+
+		pud = map_low_page((pud_t *)pgd_page_vaddr(*pgd));
+		phys_pud_remove(pud, __pa(start), __pa(end));
+		unmap_low_page(pud);
+	}
+
+	__flush_tlb_all();
+}
+
+#ifdef CONFIG_MEMORY_HOTREMOVE
+int __ref arch_remove_memory(u64 start, u64 size)
+{
+	unsigned long start_pfn = start >> PAGE_SHIFT;
+	unsigned long nr_pages = size >> PAGE_SHIFT;
+	int ret;
+
+	ret = __remove_pages(start_pfn, nr_pages);
+	WARN_ON_ONCE(ret);
+
+	kernel_physical_mapping_remove(start, start + size);
+
+	return ret;
+}
+#endif
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
 static struct kcore_list kcore_vsyscall;
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index a718e0d..7dcb6f9 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -501,21 +501,13 @@ out_unlock:
 	return do_split;
 }
 
-static int split_large_page(pte_t *kpte, unsigned long address)
+int __split_large_page(pte_t *kpte, unsigned long address, pte_t *pbase)
 {
 	unsigned long pfn, pfninc = 1;
 	unsigned int i, level;
-	pte_t *pbase, *tmp;
+	pte_t *tmp;
 	pgprot_t ref_prot;
-	struct page *base;
-
-	if (!debug_pagealloc)
-		spin_unlock(&cpa_lock);
-	base = alloc_pages(GFP_KERNEL | __GFP_NOTRACK, 0);
-	if (!debug_pagealloc)
-		spin_lock(&cpa_lock);
-	if (!base)
-		return -ENOMEM;
+	struct page *base = virt_to_page(pbase);
 
 	spin_lock(&pgd_lock);
 	/*
@@ -523,10 +515,11 @@ static int split_large_page(pte_t *kpte, unsigned long address)
 	 * up for us already:
 	 */
 	tmp = lookup_address(address, &level);
-	if (tmp != kpte)
-		goto out_unlock;
+	if (tmp != kpte) {
+		spin_unlock(&pgd_lock);
+		return 1;
+	}
 
-	pbase = (pte_t *)page_address(base);
 	paravirt_alloc_pte(&init_mm, page_to_pfn(base));
 	ref_prot = pte_pgprot(pte_clrhuge(*kpte));
 	/*
@@ -579,17 +572,27 @@ static int split_large_page(pte_t *kpte, unsigned long address)
 	 * going on.
 	 */
 	__flush_tlb_all();
+	spin_unlock(&pgd_lock);
 
-	base = NULL;
+	return 0;
+}
 
-out_unlock:
-	/*
-	 * If we dropped out via the lookup_address check under
-	 * pgd_lock then stick the page back into the pool:
-	 */
-	if (base)
+static int split_large_page(pte_t *kpte, unsigned long address)
+{
+	pte_t *pbase;
+	struct page *base;
+
+	if (!debug_pagealloc)
+		spin_unlock(&cpa_lock);
+	base = alloc_pages(GFP_KERNEL | __GFP_NOTRACK, 0);
+	if (!debug_pagealloc)
+		spin_lock(&cpa_lock);
+	if (!base)
+		return -ENOMEM;
+
+	pbase = (pte_t *)page_address(base);
+	if (__split_large_page(kpte, address, pbase))
 		__free_page(base);
-	spin_unlock(&pgd_lock);
 
 	return 0;
 }
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 8bf820d..cdbbd79 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -85,6 +85,7 @@ extern void __online_page_free(struct page *page);
 
 #ifdef CONFIG_MEMORY_HOTREMOVE
 extern bool is_pageblock_removable_nolock(struct page *page);
+extern int arch_remove_memory(u64 start, u64 size);
 #endif /* CONFIG_MEMORY_HOTREMOVE */
 
 /* reasonably generic interface to expand the physical pages in a zone  */
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 7fbfc9f..d736df3 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1074,6 +1074,7 @@ int __ref remove_memory(int nid, u64 start, u64 size)
 	/* remove memmap entry */
 	firmware_map_remove(start, start + size, "System RAM");
 
+	arch_remove_memory(start, size);
 out:
 	unlock_memory_hotplug();
 	return ret;
-- 
1.7.1


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

* [RFC v9 PATCH 13/21] memory-hotplug: check page type in get_page_bootmem
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (11 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 12/21] memory-hotplug: introduce new function arch_remove_memory() wency
@ 2012-09-05  9:25 ` wency
  2012-09-29  2:15   ` Ni zhan Chen
  2012-09-05  9:25 ` [RFC v9 PATCH 14/21] memory-hotplug: move register_page_bootmem_info_node and put_page_bootmem for sparse-vmemmap wency
                   ` (11 subsequent siblings)
  24 siblings, 1 reply; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

The function get_page_bootmem() may be called more than one time to the same
page. There is no need to set page's type, private if the function is not
the first time called to the page.

Note: the patch is just optimization and does not fix any problem.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
 mm/memory_hotplug.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index d736df3..26a5012 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -95,10 +95,17 @@ static void release_memory_resource(struct resource *res)
 static void get_page_bootmem(unsigned long info,  struct page *page,
 			     unsigned long type)
 {
-	page->lru.next = (struct list_head *) type;
-	SetPagePrivate(page);
-	set_page_private(page, info);
-	atomic_inc(&page->_count);
+	unsigned long page_type;
+
+	page_type = (unsigned long)page->lru.next;
+	if (page_type < MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE ||
+	    page_type > MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE){
+		page->lru.next = (struct list_head *)type;
+		SetPagePrivate(page);
+		set_page_private(page, info);
+		atomic_inc(&page->_count);
+	} else
+		atomic_inc(&page->_count);
 }
 
 /* reference to __meminit __free_pages_bootmem is valid
-- 
1.7.1


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

* [RFC v9 PATCH 14/21] memory-hotplug: move register_page_bootmem_info_node and put_page_bootmem for sparse-vmemmap
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (12 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 13/21] memory-hotplug: check page type in get_page_bootmem wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 15/21] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap wency
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

For implementing register_page_bootmem_info_node of sparse-vmemmap,
register_page_bootmem_info_node and put_page_bootmem are moved to
memory_hotplug.c

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
 include/linux/memory_hotplug.h |    9 ---------
 mm/memory_hotplug.c            |    8 ++++++--
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index cdbbd79..1133e63 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -162,17 +162,8 @@ static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
 #endif /* CONFIG_NUMA */
 #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */
 
-#ifdef CONFIG_SPARSEMEM_VMEMMAP
-static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
-{
-}
-static inline void put_page_bootmem(struct page *page)
-{
-}
-#else
 extern void register_page_bootmem_info_node(struct pglist_data *pgdat);
 extern void put_page_bootmem(struct page *page);
-#endif
 
 /*
  * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 26a5012..df6857b 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -91,7 +91,6 @@ static void release_memory_resource(struct resource *res)
 }
 
 #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
-#ifndef CONFIG_SPARSEMEM_VMEMMAP
 static void get_page_bootmem(unsigned long info,  struct page *page,
 			     unsigned long type)
 {
@@ -127,6 +126,7 @@ void __ref put_page_bootmem(struct page *page)
 
 }
 
+#ifndef CONFIG_SPARSEMEM_VMEMMAP
 static void register_page_bootmem_info_section(unsigned long start_pfn)
 {
 	unsigned long *usemap, mapsize, section_nr, i;
@@ -163,6 +163,11 @@ static void register_page_bootmem_info_section(unsigned long start_pfn)
 		get_page_bootmem(section_nr, page, MIX_SECTION_INFO);
 
 }
+#else
+static inline void register_page_bootmem_info_section(unsigned long start_pfn)
+{
+}
+#endif
 
 void register_page_bootmem_info_node(struct pglist_data *pgdat)
 {
@@ -198,7 +203,6 @@ void register_page_bootmem_info_node(struct pglist_data *pgdat)
 		register_page_bootmem_info_section(pfn);
 
 }
-#endif /* !CONFIG_SPARSEMEM_VMEMMAP */
 
 static void grow_zone_span(struct zone *zone, unsigned long start_pfn,
 			   unsigned long end_pfn)
-- 
1.7.1


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

* [RFC v9 PATCH 15/21] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (13 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 14/21] memory-hotplug: move register_page_bootmem_info_node and put_page_bootmem for sparse-vmemmap wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 16/21] memory-hotplug: free memmap " wency
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

For removing memmap region of sparse-vmemmap which is allocated bootmem,
memmap region of sparse-vmemmap needs to be registered by get_page_bootmem().
So the patch searches pages of virtual mapping and registers the pages by
get_page_bootmem().

Note: register_page_bootmem_memmap() is not implemented for ia64, ppc, s390,
and sparc.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 arch/ia64/mm/discontig.c       |    6 ++++
 arch/powerpc/mm/init_64.c      |    6 ++++
 arch/s390/mm/vmem.c            |    6 ++++
 arch/sparc/mm/init_64.c        |    6 ++++
 arch/x86/mm/init_64.c          |   52 ++++++++++++++++++++++++++++++++++++++++
 include/linux/memory_hotplug.h |    2 +
 include/linux/mm.h             |    3 +-
 mm/memory_hotplug.c            |   31 +++++++++++++++++++++--
 8 files changed, 108 insertions(+), 4 deletions(-)

diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index c641333..33943db 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -822,4 +822,10 @@ int __meminit vmemmap_populate(struct page *start_page,
 {
 	return vmemmap_populate_basepages(start_page, size, node);
 }
+
+void register_page_bootmem_memmap(unsigned long section_nr,
+				  struct page *start_page, unsigned long size)
+{
+	/* TODO */
+}
 #endif
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 620b7ac..3690c44 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -298,5 +298,11 @@ int __meminit vmemmap_populate(struct page *start_page,
 
 	return 0;
 }
+
+void register_page_bootmem_memmap(unsigned long section_nr,
+				  struct page *start_page, unsigned long size)
+{
+	/* TODO */
+}
 #endif /* CONFIG_SPARSEMEM_VMEMMAP */
 
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index 6f896e7..eda55cd 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -227,6 +227,12 @@ out:
 	return ret;
 }
 
+void register_page_bootmem_memmap(unsigned long section_nr,
+				  struct page *start_page, unsigned long size)
+{
+	/* TODO */
+}
+
 /*
  * Add memory segment to the segment list if it doesn't overlap with
  * an already present segment.
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index d58edf5..add1cc7 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2077,6 +2077,12 @@ void __meminit vmemmap_populate_print_last(void)
 		node_start = 0;
 	}
 }
+
+void register_page_bootmem_memmap(unsigned long section_nr,
+				  struct page *start_page, unsigned long size)
+{
+	/* TODO */
+}
 #endif /* CONFIG_SPARSEMEM_VMEMMAP */
 
 static void prot_init_common(unsigned long page_none,
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index e0d88ba..0075592 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1138,6 +1138,58 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node)
 	return 0;
 }
 
+void register_page_bootmem_memmap(unsigned long section_nr,
+				  struct page *start_page, unsigned long size)
+{
+	unsigned long addr = (unsigned long)start_page;
+	unsigned long end = (unsigned long)(start_page + size);
+	unsigned long next;
+	pgd_t *pgd;
+	pud_t *pud;
+	pmd_t *pmd;
+
+	for (; addr < end; addr = next) {
+		pte_t *pte = NULL;
+
+		pgd = pgd_offset_k(addr);
+		if (pgd_none(*pgd)) {
+			next = (addr + PAGE_SIZE) & PAGE_MASK;
+			continue;
+		}
+		get_page_bootmem(section_nr, pgd_page(*pgd), MIX_SECTION_INFO);
+
+		pud = pud_offset(pgd, addr);
+		if (pud_none(*pud)) {
+			next = (addr + PAGE_SIZE) & PAGE_MASK;
+			continue;
+		}
+		get_page_bootmem(section_nr, pud_page(*pud), MIX_SECTION_INFO);
+
+		if (!cpu_has_pse) {
+			next = (addr + PAGE_SIZE) & PAGE_MASK;
+			pmd = pmd_offset(pud, addr);
+			if (pmd_none(*pmd))
+				continue;
+			get_page_bootmem(section_nr, pmd_page(*pmd),
+					 MIX_SECTION_INFO);
+
+			pte = pte_offset_kernel(pmd, addr);
+			if (pte_none(*pte))
+				continue;
+			get_page_bootmem(section_nr, pte_page(*pte),
+					 SECTION_INFO);
+		} else {
+			next = pmd_addr_end(addr, end);
+
+			pmd = pmd_offset(pud, addr);
+			if (pmd_none(*pmd))
+				continue;
+			get_page_bootmem(section_nr, pmd_page(*pmd),
+					 SECTION_INFO);
+		}
+	}
+}
+
 void __meminit vmemmap_populate_print_last(void)
 {
 	if (p_start) {
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 1133e63..2d18235 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -164,6 +164,8 @@ static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
 
 extern void register_page_bootmem_info_node(struct pglist_data *pgdat);
 extern void put_page_bootmem(struct page *page);
+extern void get_page_bootmem(unsigned long ingo, struct page *page,
+			     unsigned long type);
 
 /*
  * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 311be90..c607913 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1618,7 +1618,8 @@ int vmemmap_populate_basepages(struct page *start_page,
 						unsigned long pages, int node);
 int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
 void vmemmap_populate_print_last(void);
-
+void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
+				  unsigned long size);
 
 enum mf_flags {
 	MF_COUNT_INCREASED = 1 << 0,
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index df6857b..647a7f2 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -91,8 +91,8 @@ static void release_memory_resource(struct resource *res)
 }
 
 #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
-static void get_page_bootmem(unsigned long info,  struct page *page,
-			     unsigned long type)
+void get_page_bootmem(unsigned long info,  struct page *page,
+		      unsigned long type)
 {
 	unsigned long page_type;
 
@@ -164,8 +164,33 @@ static void register_page_bootmem_info_section(unsigned long start_pfn)
 
 }
 #else
-static inline void register_page_bootmem_info_section(unsigned long start_pfn)
+static void register_page_bootmem_info_section(unsigned long start_pfn)
 {
+	unsigned long *usemap, mapsize, section_nr, i;
+	struct mem_section *ms;
+	struct page *page, *memmap;
+
+	if (!pfn_valid(start_pfn))
+		return;
+
+	section_nr = pfn_to_section_nr(start_pfn);
+	ms = __nr_to_section(section_nr);
+
+	memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr);
+
+	page = virt_to_page(memmap);
+	mapsize = sizeof(struct page) * PAGES_PER_SECTION;
+	mapsize = PAGE_ALIGN(mapsize) >> PAGE_SHIFT;
+
+	register_page_bootmem_memmap(section_nr, memmap, PAGES_PER_SECTION);
+
+	usemap = __nr_to_section(section_nr)->pageblock_flags;
+	page = virt_to_page(usemap);
+
+	mapsize = PAGE_ALIGN(usemap_size()) >> PAGE_SHIFT;
+
+	for (i = 0; i < mapsize; i++, page++)
+		get_page_bootmem(section_nr, page, MIX_SECTION_INFO);
 }
 #endif
 
-- 
1.7.1


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

* [RFC v9 PATCH 16/21] memory-hotplug: free memmap of sparse-vmemmap
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (14 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 15/21] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap wency
@ 2012-09-05  9:25 ` wency
  2012-10-02  4:21   ` Ni zhan Chen
  2012-09-05  9:25 ` [RFC v9 PATCH 17/21] memory_hotplug: clear zone when the memory is removed wency
                   ` (8 subsequent siblings)
  24 siblings, 1 reply; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

All pages of virtual mapping in removed memory cannot be freed, since some pages
used as PGD/PUD includes not only removed memory but also other memory. So the
patch checks whether page can be freed or not.

How to check whether page can be freed or not?
 1. When removing memory, the page structs of the revmoved memory are filled
    with 0FD.
 2. All page structs are filled with 0xFD on PT/PMD, PT/PMD can be cleared.
    In this case, the page used as PT/PMD can be freed.

Applying patch, __remove_section() of CONFIG_SPARSEMEM_VMEMMAP is integrated
into one. So __remove_section() of CONFIG_SPARSEMEM_VMEMMAP is deleted.

Note:  vmemmap_kfree() and vmemmap_free_bootmem() are not implemented for ia64,
ppc, s390, and sparc.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
 arch/ia64/mm/discontig.c  |    8 +++
 arch/powerpc/mm/init_64.c |    8 +++
 arch/s390/mm/vmem.c       |    8 +++
 arch/sparc/mm/init_64.c   |    8 +++
 arch/x86/mm/init_64.c     |  119 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/mm.h        |    2 +
 mm/memory_hotplug.c       |   17 +------
 mm/sparse.c               |    5 +-
 8 files changed, 158 insertions(+), 17 deletions(-)

diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 33943db..0d23b69 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -823,6 +823,14 @@ int __meminit vmemmap_populate(struct page *start_page,
 	return vmemmap_populate_basepages(start_page, size, node);
 }
 
+void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
+{
+}
+
+void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
+{
+}
+
 void register_page_bootmem_memmap(unsigned long section_nr,
 				  struct page *start_page, unsigned long size)
 {
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 3690c44..835a2b3 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -299,6 +299,14 @@ int __meminit vmemmap_populate(struct page *start_page,
 	return 0;
 }
 
+void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
+{
+}
+
+void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
+{
+}
+
 void register_page_bootmem_memmap(unsigned long section_nr,
 				  struct page *start_page, unsigned long size)
 {
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index eda55cd..4b42b0b 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -227,6 +227,14 @@ out:
 	return ret;
 }
 
+void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
+{
+}
+
+void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
+{
+}
+
 void register_page_bootmem_memmap(unsigned long section_nr,
 				  struct page *start_page, unsigned long size)
 {
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index add1cc7..1384826 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2078,6 +2078,14 @@ void __meminit vmemmap_populate_print_last(void)
 	}
 }
 
+void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
+{
+}
+
+void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
+{
+}
+
 void register_page_bootmem_memmap(unsigned long section_nr,
 				  struct page *start_page, unsigned long size)
 {
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 0075592..4e8f8a4 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1138,6 +1138,125 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node)
 	return 0;
 }
 
+#define PAGE_INUSE 0xFD
+
+unsigned long find_and_clear_pte_page(unsigned long addr, unsigned long end,
+			    struct page **pp, int *page_size)
+{
+	pgd_t *pgd;
+	pud_t *pud;
+	pmd_t *pmd;
+	pte_t *pte;
+	void *page_addr;
+	unsigned long next;
+
+	*pp = NULL;
+
+	pgd = pgd_offset_k(addr);
+	if (pgd_none(*pgd))
+		return pgd_addr_end(addr, end);
+
+	pud = pud_offset(pgd, addr);
+	if (pud_none(*pud))
+		return pud_addr_end(addr, end);
+
+	if (!cpu_has_pse) {
+		next = (addr + PAGE_SIZE) & PAGE_MASK;
+		pmd = pmd_offset(pud, addr);
+		if (pmd_none(*pmd))
+			return next;
+
+		pte = pte_offset_kernel(pmd, addr);
+		if (pte_none(*pte))
+			return next;
+
+		*page_size = PAGE_SIZE;
+		*pp = pte_page(*pte);
+	} else {
+		next = pmd_addr_end(addr, end);
+
+		pmd = pmd_offset(pud, addr);
+		if (pmd_none(*pmd))
+			return next;
+
+		*page_size = PMD_SIZE;
+		*pp = pmd_page(*pmd);
+	}
+
+	/*
+	 * Removed page structs are filled with 0xFD.
+	 */
+	memset((void *)addr, PAGE_INUSE, next - addr);
+
+	page_addr = page_address(*pp);
+
+	/*
+	 * Check the page is filled with 0xFD or not.
+	 * memchr_inv() returns the address. In this case, we cannot
+	 * clear PTE/PUD entry, since the page is used by other.
+	 * So we cannot also free the page.
+	 *
+	 * memchr_inv() returns NULL. In this case, we can clear
+	 * PTE/PUD entry, since the page is not used by other.
+	 * So we can also free the page.
+	 */
+	if (memchr_inv(page_addr, PAGE_INUSE, *page_size)) {
+		*pp = NULL;
+		return next;
+	}
+
+	if (!cpu_has_pse)
+		pte_clear(&init_mm, addr, pte);
+	else
+		pmd_clear(pmd);
+
+	return next;
+}
+
+void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
+{
+	unsigned long addr = (unsigned long)memmap;
+	unsigned long end = (unsigned long)(memmap + nr_pages);
+	unsigned long next;
+	struct page *page;
+	int page_size;
+
+	for (; addr < end; addr = next) {
+		page = NULL;
+		page_size = 0;
+		next = find_and_clear_pte_page(addr, end, &page, &page_size);
+		if (!page)
+			continue;
+
+		free_pages((unsigned long)page_address(page),
+			    get_order(page_size));
+		__flush_tlb_one(addr);
+	}
+}
+
+void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
+{
+	unsigned long addr = (unsigned long)memmap;
+	unsigned long end = (unsigned long)(memmap + nr_pages);
+	unsigned long next;
+	struct page *page;
+	int page_size;
+	unsigned long magic;
+
+	for (; addr < end; addr = next) {
+		page = NULL;
+		page_size = 0;
+		next = find_and_clear_pte_page(addr, end, &page, &page_size);
+		if (!page)
+			continue;
+
+		magic = (unsigned long) page->lru.next;
+		if (magic == SECTION_INFO)
+			put_page_bootmem(page);
+		flush_tlb_kernel_range(addr, end);
+	}
+}
+
 void register_page_bootmem_memmap(unsigned long section_nr,
 				  struct page *start_page, unsigned long size)
 {
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c607913..fb0d1fc 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1620,6 +1620,8 @@ int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
 void vmemmap_populate_print_last(void);
 void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
 				  unsigned long size);
+void vmemmap_kfree(struct page *memmpa, unsigned long nr_pages);
+void vmemmap_free_bootmem(struct page *memmpa, unsigned long nr_pages);
 
 enum mf_flags {
 	MF_COUNT_INCREASED = 1 << 0,
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 647a7f2..c54922c 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -308,19 +308,6 @@ static int __meminit __add_section(int nid, struct zone *zone,
 	return register_new_memory(nid, __pfn_to_section(phys_start_pfn));
 }
 
-#ifdef CONFIG_SPARSEMEM_VMEMMAP
-static int __remove_section(struct zone *zone, struct mem_section *ms)
-{
-	int ret = -EINVAL;
-
-	if (!valid_section(ms))
-		return ret;
-
-	ret = unregister_memory_section(ms);
-
-	return ret;
-}
-#else
 static int __remove_section(struct zone *zone, struct mem_section *ms)
 {
 	unsigned long flags;
@@ -337,9 +324,9 @@ static int __remove_section(struct zone *zone, struct mem_section *ms)
 	pgdat_resize_lock(pgdat, &flags);
 	sparse_remove_one_section(zone, ms);
 	pgdat_resize_unlock(pgdat, &flags);
-	return 0;
+
+	return ret;
 }
-#endif
 
 /*
  * Reasonably generic function for adding memory.  It is
diff --git a/mm/sparse.c b/mm/sparse.c
index fac95f2..ab9d755 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -613,12 +613,13 @@ static inline struct page *kmalloc_section_memmap(unsigned long pnum, int nid,
 	/* This will make the necessary allocations eventually. */
 	return sparse_mem_map_populate(pnum, nid);
 }
-static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages)
+static void __kfree_section_memmap(struct page *page, unsigned long nr_pages)
 {
-	return; /* XXX: Not implemented yet */
+	vmemmap_kfree(page, nr_pages);
 }
 static void free_map_bootmem(struct page *page, unsigned long nr_pages)
 {
+	vmemmap_free_bootmem(page, nr_pages);
 }
 #else
 static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
-- 
1.7.1


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

* [RFC v9 PATCH 17/21] memory_hotplug: clear zone when the memory is removed
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (15 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 16/21] memory-hotplug: free memmap " wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 18/21] memory-hotplug: add node_device_release wency
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

When a memory is added, we update zone's and pgdat's start_pfn and spanned_pages
in the function __add_zone(). So we should revert these when the memory is
removed. Add a new function __remove_zone() to do this.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 mm/memory_hotplug.c |  207 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 207 insertions(+), 0 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index c54922c..afda7e9 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -308,10 +308,213 @@ static int __meminit __add_section(int nid, struct zone *zone,
 	return register_new_memory(nid, __pfn_to_section(phys_start_pfn));
 }
 
+/* find the smallest valid pfn in the range [start_pfn, end_pfn) */
+static int find_smallest_section_pfn(int nid, struct zone *zone,
+				     unsigned long start_pfn,
+				     unsigned long end_pfn)
+{
+	struct mem_section *ms;
+
+	for (; start_pfn < end_pfn; start_pfn += PAGES_PER_SECTION) {
+		ms = __pfn_to_section(start_pfn);
+
+		if (unlikely(!valid_section(ms)))
+			continue;
+
+		if (unlikely(pfn_to_nid(start_pfn)) != nid)
+			continue;
+
+		if (zone && zone != page_zone(pfn_to_page(start_pfn)))
+			continue;
+
+		return start_pfn;
+	}
+
+	return 0;
+}
+
+/* find the biggest valid pfn in the range [start_pfn, end_pfn). */
+static int find_biggest_section_pfn(int nid, struct zone *zone,
+				    unsigned long start_pfn,
+				    unsigned long end_pfn)
+{
+	struct mem_section *ms;
+	unsigned long pfn;
+
+	/* pfn is the end pfn of a memory section. */
+	pfn = end_pfn - 1;
+	for (; pfn >= start_pfn; pfn -= PAGES_PER_SECTION) {
+		ms = __pfn_to_section(pfn);
+
+		if (unlikely(!valid_section(ms)))
+			continue;
+
+		if (unlikely(pfn_to_nid(pfn)) != nid)
+			continue;
+
+		if (zone && zone != page_zone(pfn_to_page(pfn)))
+			continue;
+
+		return pfn;
+	}
+
+	return 0;
+}
+
+static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
+			     unsigned long end_pfn)
+{
+	unsigned long zone_start_pfn =  zone->zone_start_pfn;
+	unsigned long zone_end_pfn = zone->zone_start_pfn + zone->spanned_pages;
+	unsigned long pfn;
+	struct mem_section *ms;
+	int nid = zone_to_nid(zone);
+
+	zone_span_writelock(zone);
+	if (zone_start_pfn == start_pfn) {
+		/*
+		 * If the section is smallest section in the zone, it need
+		 * shrink zone->zone_start_pfn and zone->zone_spanned_pages.
+		 * In this case, we find second smallest valid mem_section
+		 * for shrinking zone.
+		 */
+		pfn = find_smallest_section_pfn(nid, zone, end_pfn,
+						zone_end_pfn);
+		if (pfn) {
+			zone->zone_start_pfn = pfn;
+			zone->spanned_pages = zone_end_pfn - pfn;
+		}
+	} else if (zone_end_pfn == end_pfn) {
+		/*
+		 * If the section is biggest section in the zone, it need
+		 * shrink zone->spanned_pages.
+		 * In this case, we find second biggest valid mem_section for
+		 * shrinking zone.
+		 */
+		pfn = find_biggest_section_pfn(nid, zone, zone_start_pfn,
+					       start_pfn);
+		if (pfn)
+			zone->spanned_pages = pfn - zone_start_pfn + 1;
+	}
+
+	/*
+	 * The section is not biggest or smallest mem_section in the zone, it
+	 * only creates a hole in the zone. So in this case, we need not
+	 * change the zone. But perhaps, the zone has only hole data. Thus
+	 * it check the zone has only hole or not.
+	 */
+	pfn = zone_start_pfn;
+	for (; pfn < zone_end_pfn; pfn += PAGES_PER_SECTION) {
+		ms = __pfn_to_section(pfn);
+
+		if (unlikely(!valid_section(ms)))
+			continue;
+
+		if (page_zone(pfn_to_page(pfn)) != zone)
+			continue;
+
+		 /* If the section is current section, it continues the loop */
+		if (start_pfn == pfn)
+			continue;
+
+		/* If we find valid section, we have nothing to do */
+		zone_span_writeunlock(zone);
+		return;
+	}
+
+	/* The zone has no valid section */
+	zone->zone_start_pfn = 0;
+	zone->spanned_pages = 0;
+	zone_span_writeunlock(zone);
+}
+
+static void shrink_pgdat_span(struct pglist_data *pgdat,
+			      unsigned long start_pfn, unsigned long end_pfn)
+{
+	unsigned long pgdat_start_pfn =  pgdat->node_start_pfn;
+	unsigned long pgdat_end_pfn =
+		pgdat->node_start_pfn + pgdat->node_spanned_pages;
+	unsigned long pfn;
+	struct mem_section *ms;
+	int nid = pgdat->node_id;
+
+	if (pgdat_start_pfn == start_pfn) {
+		/*
+		 * If the section is smallest section in the pgdat, it need
+		 * shrink pgdat->node_start_pfn and pgdat->node_spanned_pages.
+		 * In this case, we find second smallest valid mem_section
+		 * for shrinking zone.
+		 */
+		pfn = find_smallest_section_pfn(nid, NULL, end_pfn,
+						pgdat_end_pfn);
+		if (pfn) {
+			pgdat->node_start_pfn = pfn;
+			pgdat->node_spanned_pages = pgdat_end_pfn - pfn;
+		}
+	} else if (pgdat_end_pfn == end_pfn) {
+		/*
+		 * If the section is biggest section in the pgdat, it need
+		 * shrink pgdat->node_spanned_pages.
+		 * In this case, we find second biggest valid mem_section for
+		 * shrinking zone.
+		 */
+		pfn = find_biggest_section_pfn(nid, NULL, pgdat_start_pfn,
+					       start_pfn);
+		if (pfn)
+			pgdat->node_spanned_pages = pfn - pgdat_start_pfn + 1;
+	}
+
+	/*
+	 * If the section is not biggest or smallest mem_section in the pgdat,
+	 * it only creates a hole in the pgdat. So in this case, we need not
+	 * change the pgdat.
+	 * But perhaps, the pgdat has only hole data. Thus it check the pgdat
+	 * has only hole or not.
+	 */
+	pfn = pgdat_start_pfn;
+	for (; pfn < pgdat_end_pfn; pfn += PAGES_PER_SECTION) {
+		ms = __pfn_to_section(pfn);
+
+		if (unlikely(!valid_section(ms)))
+			continue;
+
+		if (pfn_to_nid(pfn) != nid)
+			continue;
+
+		 /* If the section is current section, it continues the loop */
+		if (start_pfn == pfn)
+			continue;
+
+		/* If we find valid section, we have nothing to do */
+		return;
+	}
+
+	/* The pgdat has no valid section */
+	pgdat->node_start_pfn = 0;
+	pgdat->node_spanned_pages = 0;
+}
+
+static void __remove_zone(struct zone *zone, unsigned long start_pfn)
+{
+	struct pglist_data *pgdat = zone->zone_pgdat;
+	int nr_pages = PAGES_PER_SECTION;
+	int zone_type;
+	unsigned long flags;
+
+	zone_type = zone - pgdat->node_zones;
+
+	pgdat_resize_lock(zone->zone_pgdat, &flags);
+	shrink_zone_span(zone, start_pfn, start_pfn + nr_pages);
+	shrink_pgdat_span(pgdat, start_pfn, start_pfn + nr_pages);
+	pgdat_resize_unlock(zone->zone_pgdat, &flags);
+}
+
 static int __remove_section(struct zone *zone, struct mem_section *ms)
 {
 	unsigned long flags;
 	struct pglist_data *pgdat = zone->zone_pgdat;
+	unsigned long start_pfn;
+	int scn_nr;
 	int ret = -EINVAL;
 
 	if (!valid_section(ms))
@@ -321,6 +524,10 @@ static int __remove_section(struct zone *zone, struct mem_section *ms)
 	if (ret)
 		return ret;
 
+	scn_nr = __section_nr(ms);
+	start_pfn = section_nr_to_pfn(scn_nr);
+	__remove_zone(zone, start_pfn);
+
 	pgdat_resize_lock(pgdat, &flags);
 	sparse_remove_one_section(zone, ms);
 	pgdat_resize_unlock(pgdat, &flags);
-- 
1.7.1


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

* [RFC v9 PATCH 18/21] memory-hotplug: add node_device_release
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (16 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 17/21] memory_hotplug: clear zone when the memory is removed wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 19/21] memory-hotplug: remove sysfs file of node wency
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

When calling unregister_node(), the function shows following message at
device_release().

Device 'node2' does not have a release() function, it is broken and must be
fixed.

So the patch implements node_device_release()

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 drivers/base/node.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/base/node.c b/drivers/base/node.c
index af1a177..07523fb 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -252,6 +252,16 @@ static inline void hugetlb_register_node(struct node *node) {}
 static inline void hugetlb_unregister_node(struct node *node) {}
 #endif
 
+static void node_device_release(struct device *dev)
+{
+	struct node *node_dev = to_node(dev);
+
+#if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_HUGETLBFS)
+	flush_work(&node_dev->node_work);
+#endif
+
+	memset(node_dev, 0, sizeof(struct node));
+}
 
 /*
  * register_node - Setup a sysfs device for a node.
@@ -265,6 +275,7 @@ int register_node(struct node *node, int num, struct node *parent)
 
 	node->dev.id = num;
 	node->dev.bus = &node_subsys;
+	node->dev.release = node_device_release;
 	error = device_register(&node->dev);
 
 	if (!error){
-- 
1.7.1


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

* [RFC v9 PATCH 19/21] memory-hotplug: remove sysfs file of node
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (17 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 18/21] memory-hotplug: add node_device_release wency
@ 2012-09-05  9:25 ` wency
  2012-09-05  9:25 ` [RFC v9 PATCH 20/21] memory-hotplug: clear hwpoisoned flag when onlining pages wency
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Wen Congyang <wency@cn.fujitsu.com>

This patch introduces a new function try_offline_node() to
remove sysfs file of node when all memory sections of this
node are removed. If some memory sections of this node are
not removed, this function does nothing.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 mm/memory_hotplug.c |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index afda7e9..270c249 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -29,6 +29,7 @@
 #include <linux/suspend.h>
 #include <linux/mm_inline.h>
 #include <linux/firmware-map.h>
+#include <linux/stop_machine.h>
 
 #include <asm/tlbflush.h>
 
@@ -1285,6 +1286,57 @@ int offline_memory(u64 start, u64 size)
 	return 0;
 }
 
+static int check_cpu_on_node(void *data)
+{
+	struct pglist_data *pgdat = data;
+	int cpu;
+
+	for_each_online_cpu(cpu) {
+		if (cpu_to_node(cpu) == pgdat->node_id)
+			/*
+			 * the cpu on this node is onlined, and we can't
+			 * offline this node.
+			 */
+			return -EBUSY;
+	}
+
+	return 0;
+}
+
+/* offline the node if all memory sections of this node are removed */
+static void try_offline_node(int nid)
+{
+	unsigned long start_pfn = NODE_DATA(nid)->node_start_pfn;
+	unsigned long end_pfn = start_pfn + NODE_DATA(nid)->node_spanned_pages;
+	unsigned long pfn;
+
+	for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
+		unsigned long section_nr = pfn_to_section_nr(pfn);
+
+		if (!present_section_nr(section_nr))
+			continue;
+
+		if (pfn_to_nid(pfn) != nid)
+			continue;
+
+		/*
+		 * some memory sections of this node are not removed, and we
+		 * can't offline node now.
+		 */
+		return;
+	}
+
+	if (stop_machine(check_cpu_on_node, NODE_DATA(nid), NULL))
+		return;
+
+	/*
+	 * all memory sections of this node are removed, we can offline this
+	 * node now.
+	 */
+	node_set_offline(nid);
+	unregister_one_node(nid);
+}
+
 int __ref remove_memory(int nid, u64 start, u64 size)
 {
 	int ret = 0;
@@ -1305,6 +1357,8 @@ int __ref remove_memory(int nid, u64 start, u64 size)
 	firmware_map_remove(start, start + size, "System RAM");
 
 	arch_remove_memory(start, size);
+
+	try_offline_node(nid);
 out:
 	unlock_memory_hotplug();
 	return ret;
-- 
1.7.1


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

* [RFC v9 PATCH 20/21] memory-hotplug: clear hwpoisoned flag when onlining pages
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (18 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 19/21] memory-hotplug: remove sysfs file of node wency
@ 2012-09-05  9:25 ` wency
  2012-09-06  7:27   ` andywu106建国
  2012-09-05  9:25 ` [RFC v9 PATCH 21/21] memory-hotplug: auto offline page_cgroup when onlining memory block failed wency
                   ` (4 subsequent siblings)
  24 siblings, 1 reply; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Wen Congyang <wency@cn.fujitsu.com>

hwpoisoned may set when we offline a page by the sysfs interface
/sys/devices/system/memory/soft_offline_page or
/sys/devices/system/memory/hard_offline_page. If we don't clear
this flag when onlining pages, this page can't be freed, and will
not in free list. So we can't offline these pages again. So we
should clear this flag when onlining pages.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 mm/memory_hotplug.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 270c249..140c080 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -661,6 +661,11 @@ EXPORT_SYMBOL_GPL(__online_page_increment_counters);
 
 void __online_page_free(struct page *page)
 {
+#ifdef CONFIG_MEMORY_FAILURE
+	/* The page may be marked HWPoisoned by soft/hard offline page */
+	ClearPageHWPoison(page);
+#endif
+
 	ClearPageReserved(page);
 	init_page_count(page);
 	__free_page(page);
-- 
1.7.1


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

* [RFC v9 PATCH 21/21] memory-hotplug: auto offline page_cgroup when onlining memory block failed
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (19 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 20/21] memory-hotplug: clear hwpoisoned flag when onlining pages wency
@ 2012-09-05  9:25 ` wency
  2012-09-26 16:46 ` [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory Vasilis Liaskovitis
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 62+ messages in thread
From: wency @ 2012-09-05  9:25 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: rientjes, liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki, Wen Congyang

From: Wen Congyang <wency@cn.fujitsu.com>

When a memory block is onlined, we will try allocate memory on that node
to store page_cgroup. If onlining the memory block failed, we don't
offline the page cgroup, and we have no chance to offline this page cgroup
unless the memory block is onlined successfully again. It will cause
that we can't hot-remove the memory device on that node, because some
memory is used to store page cgroup. If onlining the memory block
is failed, there is no need to stort page cgroup for this memory. So
auto offline page_cgroup when onlining memory block failed.

CC: David Rientjes <rientjes@google.com>
CC: Jiang Liu <liuj97@gmail.com>
CC: Len Brown <len.brown@intel.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 mm/page_cgroup.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 5ddad0c..44db00e 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -251,6 +251,9 @@ static int __meminit page_cgroup_callback(struct notifier_block *self,
 				mn->nr_pages, mn->status_change_nid);
 		break;
 	case MEM_CANCEL_ONLINE:
+		offline_page_cgroup(mn->start_pfn,
+				mn->nr_pages, mn->status_change_nid);
+		break;
 	case MEM_GOING_OFFLINE:
 		break;
 	case MEM_ONLINE:
-- 
1.7.1


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

* Re: [RFC v9 PATCH 20/21] memory-hotplug: clear hwpoisoned flag when onlining pages
  2012-09-05  9:25 ` [RFC v9 PATCH 20/21] memory-hotplug: clear hwpoisoned flag when onlining pages wency
@ 2012-09-06  7:27   ` andywu106建国
  2012-09-06  8:41     ` Wen Congyang
  0 siblings, 1 reply; 62+ messages in thread
From: andywu106建国 @ 2012-09-06  7:27 UTC (permalink / raw)
  To: wency
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

2012/9/5 <wency@cn.fujitsu.com>
>
> From: Wen Congyang <wency@cn.fujitsu.com>
>
> hwpoisoned may set when we offline a page by the sysfs interface
> /sys/devices/system/memory/soft_offline_page or
> /sys/devices/system/memory/hard_offline_page. If we don't clear
> this flag when onlining pages, this page can't be freed, and will
> not in free list. So we can't offline these pages again. So we
> should clear this flag when onlining pages.
>
> CC: David Rientjes <rientjes@google.com>
> CC: Jiang Liu <liuj97@gmail.com>
> CC: Len Brown <len.brown@intel.com>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Christoph Lameter <cl@linux.com>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
>  mm/memory_hotplug.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 270c249..140c080 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -661,6 +661,11 @@ EXPORT_SYMBOL_GPL(__online_page_increment_counters);
>
>  void __online_page_free(struct page *page)
>  {
> +#ifdef CONFIG_MEMORY_FAILURE
> +       /* The page may be marked HWPoisoned by soft/hard offline page */
> +       ClearPageHWPoison(page);

Hi Congyang,
I think you should decrease mce_bad_pages counter her
atomic_long_sub(1, &mce_bad_pages);

>
> +#endif
> +
>         ClearPageReserved(page);
>         init_page_count(page);
>         __free_page(page);
> --
> 1.7.1
>
> --
> 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>

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

* Re: [RFC v9 PATCH 20/21] memory-hotplug: clear hwpoisoned flag when onlining pages
  2012-09-06  7:27   ` andywu106建国
@ 2012-09-06  8:41     ` Wen Congyang
  0 siblings, 0 replies; 62+ messages in thread
From: Wen Congyang @ 2012-09-06  8:41 UTC (permalink / raw)
  To: andywu106建国
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

At 09/06/2012 03:27 PM, andywu106建国 Wrote:
> 2012/9/5 <wency@cn.fujitsu.com>
>>
>> From: Wen Congyang <wency@cn.fujitsu.com>
>>
>> hwpoisoned may set when we offline a page by the sysfs interface
>> /sys/devices/system/memory/soft_offline_page or
>> /sys/devices/system/memory/hard_offline_page. If we don't clear
>> this flag when onlining pages, this page can't be freed, and will
>> not in free list. So we can't offline these pages again. So we
>> should clear this flag when onlining pages.
>>
>> CC: David Rientjes <rientjes@google.com>
>> CC: Jiang Liu <liuj97@gmail.com>
>> CC: Len Brown <len.brown@intel.com>
>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> CC: Paul Mackerras <paulus@samba.org>
>> CC: Christoph Lameter <cl@linux.com>
>> Cc: Minchan Kim <minchan.kim@gmail.com>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>> CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>> ---
>>  mm/memory_hotplug.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index 270c249..140c080 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -661,6 +661,11 @@ EXPORT_SYMBOL_GPL(__online_page_increment_counters);
>>
>>  void __online_page_free(struct page *page)
>>  {
>> +#ifdef CONFIG_MEMORY_FAILURE
>> +       /* The page may be marked HWPoisoned by soft/hard offline page */
>> +       ClearPageHWPoison(page);
> 
> Hi Congyang,
> I think you should decrease mce_bad_pages counter her
> atomic_long_sub(1, &mce_bad_pages);

Yes, thanks for pointing it out.

Thanks
Wen Congyang

> 
>>
>> +#endif
>> +
>>         ClearPageReserved(page);
>>         init_page_count(page);
>>         __free_page(page);
>> --
>> 1.7.1
>>
>> --
>> 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>
> 


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

* Re: [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not
  2012-09-05  9:25 ` [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not wency
@ 2012-09-11  2:15   ` Wen Congyang
  2012-09-11  2:24     ` Yasuaki Ishimatsu
  0 siblings, 1 reply; 62+ messages in thread
From: Wen Congyang @ 2012-09-11  2:15 UTC (permalink / raw)
  To: isimatu.yasuaki
  Cc: wency, x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro

Hi, ishimatsu

At 09/05/2012 05:25 PM, wency@cn.fujitsu.com Wrote:
> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> 
> If system supports memory hot-remove, online_pages() may online removed pages.
> So online_pages() need to check whether onlining pages are present or not.

Because we use memory_block_change_state() to hotremoving memory, I think
this patch can be removed. What do you think?

Thanks
Wen Congyang

> 
> CC: David Rientjes <rientjes@google.com>
> CC: Jiang Liu <liuj97@gmail.com>
> CC: Len Brown <len.brown@intel.com>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Christoph Lameter <cl@linux.com>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Wen Congyang <wency@cn.fujitsu.com>
> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> ---
>  include/linux/mmzone.h |   19 +++++++++++++++++++
>  mm/memory_hotplug.c    |   13 +++++++++++++
>  2 files changed, 32 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 2daa54f..ac3ae30 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -1180,6 +1180,25 @@ void sparse_init(void);
>  #define sparse_index_init(_sec, _nid)  do {} while (0)
>  #endif /* CONFIG_SPARSEMEM */
>  
> +#ifdef CONFIG_SPARSEMEM
> +static inline int pfns_present(unsigned long pfn, unsigned long nr_pages)
> +{
> +	int i;
> +	for (i = 0; i < nr_pages; i++) {
> +		if (pfn_present(pfn + i))
> +			continue;
> +		else
> +			return -EINVAL;
> +	}
> +	return 0;
> +}
> +#else
> +static inline int pfns_present(unsigned long pfn, unsigned long nr_pages)
> +{
> +	return 0;
> +}
> +#endif /* CONFIG_SPARSEMEM*/
> +
>  #ifdef CONFIG_NODES_SPAN_OTHER_NODES
>  bool early_pfn_in_nid(unsigned long pfn, int nid);
>  #else
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 49f7747..299747d 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -467,6 +467,19 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
>  	struct memory_notify arg;
>  
>  	lock_memory_hotplug();
> +	/*
> +	 * If system supports memory hot-remove, the memory may have been
> +	 * removed. So we check whether the memory has been removed or not.
> +	 *
> +	 * Note: When CONFIG_SPARSEMEM is defined, pfns_present() become
> +	 *       effective. If CONFIG_SPARSEMEM is not defined, pfns_present()
> +	 *       always returns 0.
> +	 */
> +	ret = pfns_present(pfn, nr_pages);
> +	if (ret) {
> +		unlock_memory_hotplug();
> +		return ret;
> +	}
>  	arg.start_pfn = pfn;
>  	arg.nr_pages = nr_pages;
>  	arg.status_change_nid = -1;


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

* Re: [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not
  2012-09-11  2:15   ` Wen Congyang
@ 2012-09-11  2:24     ` Yasuaki Ishimatsu
  2012-09-11  2:46       ` Wen Congyang
  2012-09-28  3:37       ` Ni zhan Chen
  0 siblings, 2 replies; 62+ messages in thread
From: Yasuaki Ishimatsu @ 2012-09-11  2:24 UTC (permalink / raw)
  To: Wen Congyang
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro

Hi Wen,

2012/09/11 11:15, Wen Congyang wrote:
> Hi, ishimatsu
>
> At 09/05/2012 05:25 PM, wency@cn.fujitsu.com Wrote:
>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>
>> If system supports memory hot-remove, online_pages() may online removed pages.
>> So online_pages() need to check whether onlining pages are present or not.
>
> Because we use memory_block_change_state() to hotremoving memory, I think
> this patch can be removed. What do you think?

Pleae teach me detals a little more. If we use memory_block_change_state(),
does the conflict never occur? Why?

Thansk,
Yasuaki Ishimatsu

> Thanks
> Wen Congyang
>
>>
>> CC: David Rientjes <rientjes@google.com>
>> CC: Jiang Liu <liuj97@gmail.com>
>> CC: Len Brown <len.brown@intel.com>
>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> CC: Paul Mackerras <paulus@samba.org>
>> CC: Christoph Lameter <cl@linux.com>
>> Cc: Minchan Kim <minchan.kim@gmail.com>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>> CC: Wen Congyang <wency@cn.fujitsu.com>
>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> ---
>>   include/linux/mmzone.h |   19 +++++++++++++++++++
>>   mm/memory_hotplug.c    |   13 +++++++++++++
>>   2 files changed, 32 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
>> index 2daa54f..ac3ae30 100644
>> --- a/include/linux/mmzone.h
>> +++ b/include/linux/mmzone.h
>> @@ -1180,6 +1180,25 @@ void sparse_init(void);
>>   #define sparse_index_init(_sec, _nid)  do {} while (0)
>>   #endif /* CONFIG_SPARSEMEM */
>>
>> +#ifdef CONFIG_SPARSEMEM
>> +static inline int pfns_present(unsigned long pfn, unsigned long nr_pages)
>> +{
>> +	int i;
>> +	for (i = 0; i < nr_pages; i++) {
>> +		if (pfn_present(pfn + i))
>> +			continue;
>> +		else
>> +			return -EINVAL;
>> +	}
>> +	return 0;
>> +}
>> +#else
>> +static inline int pfns_present(unsigned long pfn, unsigned long nr_pages)
>> +{
>> +	return 0;
>> +}
>> +#endif /* CONFIG_SPARSEMEM*/
>> +
>>   #ifdef CONFIG_NODES_SPAN_OTHER_NODES
>>   bool early_pfn_in_nid(unsigned long pfn, int nid);
>>   #else
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index 49f7747..299747d 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -467,6 +467,19 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
>>   	struct memory_notify arg;
>>
>>   	lock_memory_hotplug();
>> +	/*
>> +	 * If system supports memory hot-remove, the memory may have been
>> +	 * removed. So we check whether the memory has been removed or not.
>> +	 *
>> +	 * Note: When CONFIG_SPARSEMEM is defined, pfns_present() become
>> +	 *       effective. If CONFIG_SPARSEMEM is not defined, pfns_present()
>> +	 *       always returns 0.
>> +	 */
>> +	ret = pfns_present(pfn, nr_pages);
>> +	if (ret) {
>> +		unlock_memory_hotplug();
>> +		return ret;
>> +	}
>>   	arg.start_pfn = pfn;
>>   	arg.nr_pages = nr_pages;
>>   	arg.status_change_nid = -1;
>



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

* Re: [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not
  2012-09-11  2:24     ` Yasuaki Ishimatsu
@ 2012-09-11  2:46       ` Wen Congyang
  2012-09-28  3:37       ` Ni zhan Chen
  1 sibling, 0 replies; 62+ messages in thread
From: Wen Congyang @ 2012-09-11  2:46 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro

At 09/11/2012 10:24 AM, Yasuaki Ishimatsu Wrote:
> Hi Wen,
> 
> 2012/09/11 11:15, Wen Congyang wrote:
>> Hi, ishimatsu
>>
>> At 09/05/2012 05:25 PM, wency@cn.fujitsu.com Wrote:
>>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>>
>>> If system supports memory hot-remove, online_pages() may online
>>> removed pages.
>>> So online_pages() need to check whether onlining pages are present or
>>> not.
>>
>> Because we use memory_block_change_state() to hotremoving memory, I think
>> this patch can be removed. What do you think?
> 
> Pleae teach me detals a little more. If we use memory_block_change_state(),
> does the conflict never occur? Why?

I misunderstand sth, please ignore it.

Wen Congyang

> 
> Thansk,
> Yasuaki Ishimatsu
> 
>> Thanks
>> Wen Congyang
>>
>>>
>>> CC: David Rientjes <rientjes@google.com>
>>> CC: Jiang Liu <liuj97@gmail.com>
>>> CC: Len Brown <len.brown@intel.com>
>>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> CC: Paul Mackerras <paulus@samba.org>
>>> CC: Christoph Lameter <cl@linux.com>
>>> Cc: Minchan Kim <minchan.kim@gmail.com>
>>> CC: Andrew Morton <akpm@linux-foundation.org>
>>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>> CC: Wen Congyang <wency@cn.fujitsu.com>
>>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>> ---
>>>   include/linux/mmzone.h |   19 +++++++++++++++++++
>>>   mm/memory_hotplug.c    |   13 +++++++++++++
>>>   2 files changed, 32 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
>>> index 2daa54f..ac3ae30 100644
>>> --- a/include/linux/mmzone.h
>>> +++ b/include/linux/mmzone.h
>>> @@ -1180,6 +1180,25 @@ void sparse_init(void);
>>>   #define sparse_index_init(_sec, _nid)  do {} while (0)
>>>   #endif /* CONFIG_SPARSEMEM */
>>>
>>> +#ifdef CONFIG_SPARSEMEM
>>> +static inline int pfns_present(unsigned long pfn, unsigned long
>>> nr_pages)
>>> +{
>>> +    int i;
>>> +    for (i = 0; i < nr_pages; i++) {
>>> +        if (pfn_present(pfn + i))
>>> +            continue;
>>> +        else
>>> +            return -EINVAL;
>>> +    }
>>> +    return 0;
>>> +}
>>> +#else
>>> +static inline int pfns_present(unsigned long pfn, unsigned long
>>> nr_pages)
>>> +{
>>> +    return 0;
>>> +}
>>> +#endif /* CONFIG_SPARSEMEM*/
>>> +
>>>   #ifdef CONFIG_NODES_SPAN_OTHER_NODES
>>>   bool early_pfn_in_nid(unsigned long pfn, int nid);
>>>   #else
>>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>>> index 49f7747..299747d 100644
>>> --- a/mm/memory_hotplug.c
>>> +++ b/mm/memory_hotplug.c
>>> @@ -467,6 +467,19 @@ int __ref online_pages(unsigned long pfn,
>>> unsigned long nr_pages)
>>>       struct memory_notify arg;
>>>
>>>       lock_memory_hotplug();
>>> +    /*
>>> +     * If system supports memory hot-remove, the memory may have been
>>> +     * removed. So we check whether the memory has been removed or not.
>>> +     *
>>> +     * Note: When CONFIG_SPARSEMEM is defined, pfns_present() become
>>> +     *       effective. If CONFIG_SPARSEMEM is not defined,
>>> pfns_present()
>>> +     *       always returns 0.
>>> +     */
>>> +    ret = pfns_present(pfn, nr_pages);
>>> +    if (ret) {
>>> +        unlock_memory_hotplug();
>>> +        return ret;
>>> +    }
>>>       arg.start_pfn = pfn;
>>>       arg.nr_pages = nr_pages;
>>>       arg.status_change_nid = -1;
>>
> 
> 
> 


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (20 preceding siblings ...)
  2012-09-05  9:25 ` [RFC v9 PATCH 21/21] memory-hotplug: auto offline page_cgroup when onlining memory block failed wency
@ 2012-09-26 16:46 ` Vasilis Liaskovitis
  2012-09-27  0:59   ` Wen Congyang
                     ` (4 more replies)
  2012-09-26 16:58 ` Vasilis Liaskovitis
                   ` (2 subsequent siblings)
  24 siblings, 5 replies; 62+ messages in thread
From: Vasilis Liaskovitis @ 2012-09-26 16:46 UTC (permalink / raw)
  To: wency
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

Hi,

I am testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
Running in a guest (qemu+seabios from [4]). 
CONFIG_SLAB=y
CONFIG_DEBUG_SLAB=y

After succesfull hot-add and online, I am doing a hot-remove with "echo 1 > /sys/bus/acpi/devices/PNP/eject"
When I do the OSPM-eject, I often get slab corruption in "acpi-state" cache, or in other caches

[  170.566995] Slab corruption (Not tainted): Acpi-State start=ffff88009fc1e548, len=80
[  170.567265] Redzone: 0x0/0x0.
[  170.567399] Last user: [<          (null)>](0x0)
[  170.567667] 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[  170.568078] 010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[  170.568487] 020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[  170.568894] 030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[  170.569302] 040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[  170.569712] Prev obj: start=000000009fc1e4d0, len=80
[  170.569869] BUG: unable to handle kernel paging request at 000000009fc1e520
[  170.570171] IP: [<ffffffff8112803c>] print_objinfo+0x9c/0x110
[  170.570397] PGD 7cf37067 PUD 0 
[  170.570619] Oops: 0000 [#1] SMP 
[  170.570843] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis microcode tpm tpm_bios psmouse parport_pc serio_raw evdev parport i2c_piix4 processor thermal_sys i2c_core button ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net virtio_blk ata_piix libata scsi_mod virtio_pci virtio_ring virtio
[  170.573474] CPU 0 
[  170.573568] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
[  170.573830] RIP: 0010:[<ffffffff8112803c>]  [<ffffffff8112803c>] print_objinfo+0x9c/0x110
[  170.574106] RSP: 0018:ffff88003eaf3a70  EFLAGS: 00010202
[  170.574268] RAX: 000000009fc1e4c8 RBX: 0000000000000002 RCX: 00000000000024b8
[  170.574468] RDX: 000000009fc1e4c8 RSI: 000000009fc1e4c8 RDI: ffff88003e9bb980
[  170.574668] RBP: ffff88003e9bb980 R08: ffff880037964078 R09: 0000000000000000
[  170.574870] R10: 000000000000021e R11: 0000000000000002 R12: 000000009fc1e4c8
[  170.575070] R13: 000000009fc1e520 R14: 000000000000004f R15: 00000000ffffffa5
[  170.575274] FS:  00007fc6b7530700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
[  170.575494] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  170.575665] CR2: 000000009fc1e520 CR3: 000000007c9c1000 CR4: 00000000000006f0
[  170.575870] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  170.576075] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  170.576276] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
[  170.576507] Stack:
[  170.576599]  0000000000000010 0000000001893fbe ffff88009fc1e000 0000000000000050
[  170.576938]  000000009fc1e4c8 000000000000004f 00000000ffffffa5 ffffffff8112899f
[  170.576938]  ffff88003eb309d8 ffffffff81712d6d ffff88003e9bb980 ffff88009fc1e540
[  170.576938] Call Trace:
[  170.576938]  [<ffffffff8112899f>] ? check_poison_obj+0x1df/0x1f0
[  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
[  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
[  170.576938]  [<ffffffff81128a9d>] ? cache_alloc_debugcheck_after.isra.52+0xed/0x220
[  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
[  170.576938]  [<ffffffff8112beb5>] ? kmem_cache_alloc+0xb5/0x1e0
[  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
[  170.576938]  [<ffffffff812edf2d>] ? acpi_ds_result_push+0x5d/0x12e
[  170.576938]  [<ffffffff812ed127>] ? acpi_ds_exec_end_op+0x28e/0x3d3
[  170.576938]  [<ffffffff812fd86a>] ? acpi_ps_parse_loop+0x79f/0x931
[  170.576938]  [<ffffffff812fdd6c>] ? acpi_ps_parse_aml+0x89/0x261
[  170.576938]  [<ffffffff812fe50c>] ? acpi_ps_execute_method+0x1be/0x266
[  170.576938]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
[  170.576938]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
[  170.576938]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
[  170.576938]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
[  170.576938]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
[  170.576938]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
[  170.576938]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
[  170.576938]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
[  170.576938]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
[  170.576938]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
[  170.576938]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
[  170.576938]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
[  170.576938] Code: cb 75 dc 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 8b 7f 0c 4c 89 e2 e8 02 fd ff ff 4c 89 e6 49 89 c5 48 89 ef e8 d4 fc ff ff <49> 8b 55 00 48 8b 30 48 c7 c7 8c 39 6f 81 31 c0 e8 3e 34 3b 00 

Other times, the problem happens on a slab object free:

[   52.313366] Offlined Pages 32768
[   52.800232] slab error in verify_redzone_free(): cache `Acpi-ParseExt': memory outside object was overwritten
[   52.801298] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12
[   52.802039] Call Trace:
[   52.802443]  [<ffffffff811280cb>] ? __slab_error.isra.46+0x1b/0x30
[   52.803199]  [<ffffffff811287b6>] ? cache_free_debugcheck+0x256/0x260
[   52.803940]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
[   52.804645]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
[   52.805321]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
[   52.806023]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
[   52.806762]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
[   52.807499]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
[   52.808183]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
[   52.808897]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
[   52.809659]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
[   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
[   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
[   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
[   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
[   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
[   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
[   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
[   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
[   52.810032] ffff88008f809670: redzone 1:0x0, redzone 2:0x0.
[   52.810032] ------------[ cut here ]------------
[   52.810032] kernel BUG at mm/slab.c:3125!
[   52.810032] invalid opcode: 0000 [#1] SMP 
[   52.810032] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis tpm tpm_bios microcode parport_pc parport evdev processor thermal_sys psmouse i2c_piix4 serio_raw i2c_core button ext3 jbd mbcache sg sr_mod cdrom virtio_net ata_generic virtio_blk virtio_pci virtio_ring virtio ata_piix libata scsi_mod
[   52.810032] CPU 0 
[   52.810032] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
[   52.810032] RIP: 0010:[<ffffffff81128733>]  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
[   52.810032] RSP: 0018:ffff88003eaf3bc0  EFLAGS: 00010093
[   52.810032] RAX: 00000000017eac3c RBX: ffff88003e9bb700 RCX: 0000000002aaaaab
[   52.810032] RDX: 0000000000000000 RSI: 0000000000010000 RDI: 0000000000000060
[   52.810032] RBP: ffff88008f809670 R08: 09f911029d74e35b R09: 0000000000000000
[   52.810032] R10: 00000000000001d3 R11: 0000000000000002 R12: ffff88008f809000
[   52.810032] R13: ffffffff812e1b0e R14: 0000000000000000 R15: 0000000000010c00
[   52.810032] FS:  00007f63fc263700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
[   52.810032] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   52.810032] CR2: 00007fff8d895b78 CR3: 000000007c866000 CR4: 00000000000006f0
[   52.810032] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   52.810032] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   52.810032] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
[   52.810032] Stack:
[   52.810032]  ffff88003e9bb980 ffff88008f809670 ffff880037ba8e18 ffff88008f809678
[   52.810032]  ffff88003e9bb700 0000000000000282 ffff88003e9bf270 ffffffff812e1b0e
[   52.810032]  0000000000000001 ffffffff81128fe3 ffff88003e80f5e8 ffff88003eb31748
[   52.810032] Call Trace:
[   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
[   52.810032]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
[   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
[   52.810032]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
[   52.810032]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
[   52.810032]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
[   52.810032]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
[   52.810032]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
[   52.810032]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
[   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
[   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
[   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
[   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
[   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
[   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
[   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
[   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
[   52.810032] Code: 89 ea 49 89 38 8b 73 14 8b 7b 0c e8 18 f6 ff ff 49 b8 5b e3 74 9d 02 11 f9 09 4c 89 00 44 8b 7b 14 44 89 f8 e9 fa fe ff ff 0f 0b <0f> 0b 48 8b 40 30 e9 d9 fe ff ff e8 c6 43 3b 00 0f 0b 48 8b 40 
[   52.810032] RIP  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
[   52.810032]  RSP <ffff88003eaf3bc0>
[   52.810032] ---[ end trace c699c8cecd5870a3 ]---


And other times, I see a filesystem related slab corruption when doing the eject.
Here I have also seen a bad rss-counter state message. 

[  232.114232] BUG: Bad rss-counter state mm:ffff88007d9c1f80 idx:0 val:1
[  232.115214] BUG: unable to handle kernel NULL pointer dereference at           (null)
[  232.115807] IP: [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
[  232.116186] PGD 7cdec067 PUD 7c946067 PMD 0 
[  232.116627] Oops: 0000 [#3] SMP 
[  232.116990] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor thermal_sys button ext3 jbd mbcache virtio_net sg sr_mod cdrom virtio_blk ata_generic virtio_pci virtio_ring virtio ata_piix libata scsi_mod
[  232.120013] CPU 2 
[  232.120013] Pid: 880, comm: dhclient Tainted: G      D      3.6.0-rc7-guest #1 Bochs Bochs
[  232.120013] RIP: 0010:[<ffffffffa00cfce3>]  [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
[  232.120013] RSP: 0018:ffff88007cd6fab8  EFLAGS: 00010246
[  232.120013] RAX: ffff88003e513f50 RBX: ffff88003e513f50 RCX: 0000000000000000
[  232.120013] RDX: 0000000000000000 RSI: ffff88003e513f50 RDI: ffff880097800000
[  232.120013] RBP: ffff88003e513f50 R08: 000000003e513f01 R09: 0000000180240024
[  232.120013] R10: ffff88003e513f50 R11: 00000000000198e0 R12: 0000000000000000
[  232.120013] R13: ffffffffa00eb437 R14: ffff880097800000 R15: 000000000000027a
[  232.120013] FS:  00007f082638d700(0000) GS:ffff88003ec80000(0000) knlGS:0000000000000000
[  232.120013] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  232.120013] CR2: 0000000000000000 CR3: 000000007c94c000 CR4: 00000000000006e0
[  232.120013] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  232.120013] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  232.120013] Process dhclient (pid: 880, threadinfo ffff88007cd6e000, task ffff88007ca46800)
[  232.120013] Stack:
[  232.120013]  ffff88007dc205b0 ffffffff8116645f ffff88007dc205b0 ffff88007dc205b0
[  232.120013]  ffff88007cf58800 0000000000000000 000000000000000e 0000000000000000
[  232.120013]  000000000000027a ffffffff8112b934 0000005000000003 0000000000000fff
[  232.120013] Call Trace:
[  232.120013]  [<ffffffff8116645f>] ? __find_get_block+0x7f/0x200
[  232.120013]  [<ffffffff8112b934>] ? kmem_cache_alloc+0xe4/0x140
[  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
[  232.120013]  [<ffffffffa00d0279>] ? journal_get_write_access+0x29/0x50 [jbd]
[  232.120013]  [<ffffffffa00eaeef>] ? __ext3_get_inode_loc+0xcf/0x360 [ext3]
[  232.120013]  [<ffffffffa0101317>] ? __ext3_journal_get_write_access+0x27/0x60 [ext3]
[  232.120013]  [<ffffffffa00eb213>] ? ext3_reserve_inode_write+0x73/0xa0 [ext3]
[  232.120013]  [<ffffffffa00eb27b>] ? ext3_mark_inode_dirty+0x3b/0xa0 [ext3]
[  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
[  232.120013]  [<ffffffff8115ded6>] ? __mark_inode_dirty+0x36/0x230
[  232.120013]  [<ffffffff811504a1>] ? update_time+0x71/0xb0
[  232.120013]  [<ffffffff811536c9>] ? mnt_clone_write+0x9/0x20
[  232.120013]  [<ffffffff81150581>] ? file_update_time+0xa1/0xf0
[  232.120013]  [<ffffffff8103385c>] ? ptep_set_access_flags+0x6c/0x70
[  232.120013]  [<ffffffff810e3f30>] ? __generic_file_aio_write+0x1a0/0x3c0
[  232.120013]  [<ffffffff811396fb>] ? __sb_start_write+0x6b/0x130
[  232.120013]  [<ffffffff810e41ce>] ? generic_file_aio_write+0x7e/0x100
[  232.120013]  [<ffffffff81137484>] ? do_sync_write+0x94/0xd0
[  232.120013]  [<ffffffff81137caa>] ? vfs_write+0xaa/0x160
[  232.120013]  [<ffffffff81137f87>] ? sys_write+0x47/0x90
[  232.120013]  [<ffffffff814e5765>] ? async_page_fault+0x25/0x30
[  232.120013]  [<ffffffff814eca79>] ? system_call_fastpath+0x16/0x1b
[  232.120013] Code: 54 24 2c f6 47 14 04 74 1f 41 bc e2 ff ff ff 48 81 c4 98 00 00 00 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 1f 40 00 4c 8b 27 <4d> 8b 3c 24 41 f6 07 02 75 d4 65 48 8b 04 25 80 b9 00 00 48 89 

Is this a known issue? If yes, can you point me to any relevant patches?

When I do an SCI(hardware) eject, I have not seen corruptions. The acpi driver is
evaluating fewer objects in this path I think, but I don't see why corruption can't
happen here as well.

I have seen similar problems with CONFIG_SLUB (I did not have debug_options
there but I can also provide those if helpful)

[1] https://lkml.org/lkml/2012/9/6/635
[2] https://lkml.org/lkml/2012/9/11/542
[3] https://lkml.org/lkml/2012/9/20/37
[4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691

thanks,

- Vasilis

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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (21 preceding siblings ...)
  2012-09-26 16:46 ` [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory Vasilis Liaskovitis
@ 2012-09-26 16:58 ` Vasilis Liaskovitis
  2012-09-27  1:03   ` Wen Congyang
                     ` (2 more replies)
  2012-09-29  3:45 ` Ni zhan Chen
  2012-09-29  8:19 ` Ni zhan Chen
  24 siblings, 3 replies; 62+ messages in thread
From: Vasilis Liaskovitis @ 2012-09-26 16:58 UTC (permalink / raw)
  To: wency
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

Testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
Running in a guest (qemu+seabios from [4]). 
CONFIG_SLAB=y
CONFIG_DEBUG_SLAB=y

- succesfull hot-add and online
- succesfull hot-remove with SCI (qemu) eject
- attempt to hot-readd same memory

When the pages are re-onlined on hot-readd, I get a bad_page state for many
pages e.g.

[   59.611278] init_memory_mapping: [mem 0x80000000-0x9fffffff]
[   59.637836] Built 2 zonelists in Node order, mobility grouping on.  Total pages: 547617
[   59.638739] Policy zone: Normal
[   59.650840] BUG: Bad page state in process bash  pfn:9b6dc
[   59.651124] page:ffffea0002200020 count:0 mapcount:0 mapping:          (null) index:0xfdfdfdfdfdfdfdfd
[   59.651494] page flags: 0x2fdfdfdfd5df9fd(locked|referenced|uptodate|dirty|lru|active|slab|owner_priv_1|private|private_2|writeback|head|tail|swapcache|reclaim|swapbacked|unevictable|uncached|compound_lock)
[   59.653604] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor button thermal_sys ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net ata_piix virtio_blk libata virtio_pci virtio_ring virtio scsi_mod
[   59.656998] Pid: 988, comm: bash Not tainted 3.6.0-rc7-guest #12
[   59.657172] Call Trace:
[   59.657275]  [<ffffffff810e9b30>] ? bad_page+0xb0/0x100
[   59.657434]  [<ffffffff810ea4c3>] ? free_pages_prepare+0xb3/0x100
[   59.657610]  [<ffffffff810ea668>] ? free_hot_cold_page+0x48/0x1a0
[   59.657787]  [<ffffffff8112cc08>] ? online_pages_range+0x68/0xa0
[   59.657961]  [<ffffffff8112cba0>] ? __online_page_increment_counters+0x10/0x10
[   59.658162]  [<ffffffff81045561>] ? walk_system_ram_range+0x101/0x110
[   59.658346]  [<ffffffff814c4f95>] ? online_pages+0x1a5/0x2b0
[   59.658515]  [<ffffffff8135663d>] ? __memory_block_change_state+0x20d/0x270
[   59.658710]  [<ffffffff81356756>] ? store_mem_state+0xb6/0xf0
[   59.658878]  [<ffffffff8119e482>] ? sysfs_write_file+0xd2/0x160
[   59.659052]  [<ffffffff8113769a>] ? vfs_write+0xaa/0x160
[   59.659212]  [<ffffffff81137977>] ? sys_write+0x47/0x90
[   59.659371]  [<ffffffff814e2f25>] ? async_page_fault+0x25/0x30
[   59.659543]  [<ffffffff814ea239>] ? system_call_fastpath+0x16/0x1b
[   59.659720] Disabling lock debugging due to kernel taint

Patch 20/21 deals with a similar scenario, but only for __PG_HWPOISON flag.
Did i miss any other patch for this?

thanks,

- Vasilis

[1] https://lkml.org/lkml/2012/9/6/635
[2] https://lkml.org/lkml/2012/9/11/542
[3] https://lkml.org/lkml/2012/9/20/37
[4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691



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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-26 16:46 ` [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory Vasilis Liaskovitis
@ 2012-09-27  0:59   ` Wen Congyang
  2012-09-27  6:37   ` Wen Congyang
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 62+ messages in thread
From: Wen Congyang @ 2012-09-27  0:59 UTC (permalink / raw)
  To: Vasilis Liaskovitis
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

At 09/27/2012 12:46 AM, Vasilis Liaskovitis Wrote:
> Hi,
> 
> I am testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
> Running in a guest (qemu+seabios from [4]). 
> CONFIG_SLAB=y
> CONFIG_DEBUG_SLAB=y
> 
> After succesfull hot-add and online, I am doing a hot-remove with "echo 1 > /sys/bus/acpi/devices/PNP/eject"
> When I do the OSPM-eject, I often get slab corruption in "acpi-state" cache, or in other caches
> 
> [  170.566995] Slab corruption (Not tainted): Acpi-State start=ffff88009fc1e548, len=80
> [  170.567265] Redzone: 0x0/0x0.
> [  170.567399] Last user: [<          (null)>](0x0)
> [  170.567667] 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568078] 010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568487] 020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568894] 030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569302] 040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569712] Prev obj: start=000000009fc1e4d0, len=80
> [  170.569869] BUG: unable to handle kernel paging request at 000000009fc1e520
> [  170.570171] IP: [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.570397] PGD 7cf37067 PUD 0 
> [  170.570619] Oops: 0000 [#1] SMP 
> [  170.570843] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis microcode tpm tpm_bios psmouse parport_pc serio_raw evdev parport i2c_piix4 processor thermal_sys i2c_core button ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net virtio_blk ata_piix libata scsi_mod virtio_pci virtio_ring virtio
> [  170.573474] CPU 0 
> [  170.573568] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [  170.573830] RIP: 0010:[<ffffffff8112803c>]  [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.574106] RSP: 0018:ffff88003eaf3a70  EFLAGS: 00010202
> [  170.574268] RAX: 000000009fc1e4c8 RBX: 0000000000000002 RCX: 00000000000024b8
> [  170.574468] RDX: 000000009fc1e4c8 RSI: 000000009fc1e4c8 RDI: ffff88003e9bb980
> [  170.574668] RBP: ffff88003e9bb980 R08: ffff880037964078 R09: 0000000000000000
> [  170.574870] R10: 000000000000021e R11: 0000000000000002 R12: 000000009fc1e4c8
> [  170.575070] R13: 000000009fc1e520 R14: 000000000000004f R15: 00000000ffffffa5
> [  170.575274] FS:  00007fc6b7530700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [  170.575494] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [  170.575665] CR2: 000000009fc1e520 CR3: 000000007c9c1000 CR4: 00000000000006f0
> [  170.575870] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  170.576075] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  170.576276] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [  170.576507] Stack:
> [  170.576599]  0000000000000010 0000000001893fbe ffff88009fc1e000 0000000000000050
> [  170.576938]  000000009fc1e4c8 000000000000004f 00000000ffffffa5 ffffffff8112899f
> [  170.576938]  ffff88003eb309d8 ffffffff81712d6d ffff88003e9bb980 ffff88009fc1e540
> [  170.576938] Call Trace:
> [  170.576938]  [<ffffffff8112899f>] ? check_poison_obj+0x1df/0x1f0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff81128a9d>] ? cache_alloc_debugcheck_after.isra.52+0xed/0x220
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff8112beb5>] ? kmem_cache_alloc+0xb5/0x1e0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff812edf2d>] ? acpi_ds_result_push+0x5d/0x12e
> [  170.576938]  [<ffffffff812ed127>] ? acpi_ds_exec_end_op+0x28e/0x3d3
> [  170.576938]  [<ffffffff812fd86a>] ? acpi_ps_parse_loop+0x79f/0x931
> [  170.576938]  [<ffffffff812fdd6c>] ? acpi_ps_parse_aml+0x89/0x261
> [  170.576938]  [<ffffffff812fe50c>] ? acpi_ps_execute_method+0x1be/0x266
> [  170.576938]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [  170.576938]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [  170.576938]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [  170.576938]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [  170.576938]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [  170.576938]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [  170.576938]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [  170.576938]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [  170.576938]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [  170.576938]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [  170.576938]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [  170.576938]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [  170.576938] Code: cb 75 dc 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 8b 7f 0c 4c 89 e2 e8 02 fd ff ff 4c 89 e6 49 89 c5 48 89 ef e8 d4 fc ff ff <49> 8b 55 00 48 8b 30 48 c7 c7 8c 39 6f 81 31 c0 e8 3e 34 3b 00 
> 
> Other times, the problem happens on a slab object free:
> 
> [   52.313366] Offlined Pages 32768
> [   52.800232] slab error in verify_redzone_free(): cache `Acpi-ParseExt': memory outside object was overwritten
> [   52.801298] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12
> [   52.802039] Call Trace:
> [   52.802443]  [<ffffffff811280cb>] ? __slab_error.isra.46+0x1b/0x30
> [   52.803199]  [<ffffffff811287b6>] ? cache_free_debugcheck+0x256/0x260
> [   52.803940]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.804645]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.805321]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.806023]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.806762]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.807499]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.808183]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.808897]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.809659]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] ffff88008f809670: redzone 1:0x0, redzone 2:0x0.
> [   52.810032] ------------[ cut here ]------------
> [   52.810032] kernel BUG at mm/slab.c:3125!
> [   52.810032] invalid opcode: 0000 [#1] SMP 
> [   52.810032] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis tpm tpm_bios microcode parport_pc parport evdev processor thermal_sys psmouse i2c_piix4 serio_raw i2c_core button ext3 jbd mbcache sg sr_mod cdrom virtio_net ata_generic virtio_blk virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [   52.810032] CPU 0 
> [   52.810032] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [   52.810032] RIP: 0010:[<ffffffff81128733>]  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032] RSP: 0018:ffff88003eaf3bc0  EFLAGS: 00010093
> [   52.810032] RAX: 00000000017eac3c RBX: ffff88003e9bb700 RCX: 0000000002aaaaab
> [   52.810032] RDX: 0000000000000000 RSI: 0000000000010000 RDI: 0000000000000060
> [   52.810032] RBP: ffff88008f809670 R08: 09f911029d74e35b R09: 0000000000000000
> [   52.810032] R10: 00000000000001d3 R11: 0000000000000002 R12: ffff88008f809000
> [   52.810032] R13: ffffffff812e1b0e R14: 0000000000000000 R15: 0000000000010c00
> [   52.810032] FS:  00007f63fc263700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [   52.810032] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [   52.810032] CR2: 00007fff8d895b78 CR3: 000000007c866000 CR4: 00000000000006f0
> [   52.810032] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   52.810032] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [   52.810032] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [   52.810032] Stack:
> [   52.810032]  ffff88003e9bb980 ffff88008f809670 ffff880037ba8e18 ffff88008f809678
> [   52.810032]  ffff88003e9bb700 0000000000000282 ffff88003e9bf270 ffffffff812e1b0e
> [   52.810032]  0000000000000001 ffffffff81128fe3 ffff88003e80f5e8 ffff88003eb31748
> [   52.810032] Call Trace:
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.810032]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.810032]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.810032]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.810032]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.810032]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] Code: 89 ea 49 89 38 8b 73 14 8b 7b 0c e8 18 f6 ff ff 49 b8 5b e3 74 9d 02 11 f9 09 4c 89 00 44 8b 7b 14 44 89 f8 e9 fa fe ff ff 0f 0b <0f> 0b 48 8b 40 30 e9 d9 fe ff ff e8 c6 43 3b 00 0f 0b 48 8b 40 
> [   52.810032] RIP  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032]  RSP <ffff88003eaf3bc0>
> [   52.810032] ---[ end trace c699c8cecd5870a3 ]---
> 
> 
> And other times, I see a filesystem related slab corruption when doing the eject.
> Here I have also seen a bad rss-counter state message. 
> 
> [  232.114232] BUG: Bad rss-counter state mm:ffff88007d9c1f80 idx:0 val:1
> [  232.115214] BUG: unable to handle kernel NULL pointer dereference at           (null)
> [  232.115807] IP: [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.116186] PGD 7cdec067 PUD 7c946067 PMD 0 
> [  232.116627] Oops: 0000 [#3] SMP 
> [  232.116990] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor thermal_sys button ext3 jbd mbcache virtio_net sg sr_mod cdrom virtio_blk ata_generic virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [  232.120013] CPU 2 
> [  232.120013] Pid: 880, comm: dhclient Tainted: G      D      3.6.0-rc7-guest #1 Bochs Bochs
> [  232.120013] RIP: 0010:[<ffffffffa00cfce3>]  [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.120013] RSP: 0018:ffff88007cd6fab8  EFLAGS: 00010246
> [  232.120013] RAX: ffff88003e513f50 RBX: ffff88003e513f50 RCX: 0000000000000000
> [  232.120013] RDX: 0000000000000000 RSI: ffff88003e513f50 RDI: ffff880097800000
> [  232.120013] RBP: ffff88003e513f50 R08: 000000003e513f01 R09: 0000000180240024
> [  232.120013] R10: ffff88003e513f50 R11: 00000000000198e0 R12: 0000000000000000
> [  232.120013] R13: ffffffffa00eb437 R14: ffff880097800000 R15: 000000000000027a
> [  232.120013] FS:  00007f082638d700(0000) GS:ffff88003ec80000(0000) knlGS:0000000000000000
> [  232.120013] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [  232.120013] CR2: 0000000000000000 CR3: 000000007c94c000 CR4: 00000000000006e0
> [  232.120013] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  232.120013] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  232.120013] Process dhclient (pid: 880, threadinfo ffff88007cd6e000, task ffff88007ca46800)
> [  232.120013] Stack:
> [  232.120013]  ffff88007dc205b0 ffffffff8116645f ffff88007dc205b0 ffff88007dc205b0
> [  232.120013]  ffff88007cf58800 0000000000000000 000000000000000e 0000000000000000
> [  232.120013]  000000000000027a ffffffff8112b934 0000005000000003 0000000000000fff
> [  232.120013] Call Trace:
> [  232.120013]  [<ffffffff8116645f>] ? __find_get_block+0x7f/0x200
> [  232.120013]  [<ffffffff8112b934>] ? kmem_cache_alloc+0xe4/0x140
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffffa00d0279>] ? journal_get_write_access+0x29/0x50 [jbd]
> [  232.120013]  [<ffffffffa00eaeef>] ? __ext3_get_inode_loc+0xcf/0x360 [ext3]
> [  232.120013]  [<ffffffffa0101317>] ? __ext3_journal_get_write_access+0x27/0x60 [ext3]
> [  232.120013]  [<ffffffffa00eb213>] ? ext3_reserve_inode_write+0x73/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb27b>] ? ext3_mark_inode_dirty+0x3b/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffff8115ded6>] ? __mark_inode_dirty+0x36/0x230
> [  232.120013]  [<ffffffff811504a1>] ? update_time+0x71/0xb0
> [  232.120013]  [<ffffffff811536c9>] ? mnt_clone_write+0x9/0x20
> [  232.120013]  [<ffffffff81150581>] ? file_update_time+0xa1/0xf0
> [  232.120013]  [<ffffffff8103385c>] ? ptep_set_access_flags+0x6c/0x70
> [  232.120013]  [<ffffffff810e3f30>] ? __generic_file_aio_write+0x1a0/0x3c0
> [  232.120013]  [<ffffffff811396fb>] ? __sb_start_write+0x6b/0x130
> [  232.120013]  [<ffffffff810e41ce>] ? generic_file_aio_write+0x7e/0x100
> [  232.120013]  [<ffffffff81137484>] ? do_sync_write+0x94/0xd0
> [  232.120013]  [<ffffffff81137caa>] ? vfs_write+0xaa/0x160
> [  232.120013]  [<ffffffff81137f87>] ? sys_write+0x47/0x90
> [  232.120013]  [<ffffffff814e5765>] ? async_page_fault+0x25/0x30
> [  232.120013]  [<ffffffff814eca79>] ? system_call_fastpath+0x16/0x1b
> [  232.120013] Code: 54 24 2c f6 47 14 04 74 1f 41 bc e2 ff ff ff 48 81 c4 98 00 00 00 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 1f 40 00 4c 8b 27 <4d> 8b 3c 24 41 f6 07 02 75 d4 65 48 8b 04 25 80 b9 00 00 48 89 
> 
> Is this a known issue? If yes, can you point me to any relevant patches?
> 
> When I do an SCI(hardware) eject, I have not seen corruptions. The acpi driver is
> evaluating fewer objects in this path I think, but I don't see why corruption can't
> happen here as well.
> 
> I have seen similar problems with CONFIG_SLUB (I did not have debug_options
> there but I can also provide those if helpful)

Thanks for testing it.
It is not a know issue. I will start to investigate it.

Wen Congyang

> 
> [1] https://lkml.org/lkml/2012/9/6/635
> [2] https://lkml.org/lkml/2012/9/11/542
> [3] https://lkml.org/lkml/2012/9/20/37
> [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> 
> thanks,
> 
> - Vasilis
> 


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-26 16:58 ` Vasilis Liaskovitis
@ 2012-09-27  1:03   ` Wen Congyang
  2012-09-27  8:53   ` Wen Congyang
  2012-09-27 10:06   ` Wen Congyang
  2 siblings, 0 replies; 62+ messages in thread
From: Wen Congyang @ 2012-09-27  1:03 UTC (permalink / raw)
  To: Vasilis Liaskovitis
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

At 09/27/2012 12:58 AM, Vasilis Liaskovitis Wrote:
> Testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
> Running in a guest (qemu+seabios from [4]). 
> CONFIG_SLAB=y
> CONFIG_DEBUG_SLAB=y
> 
> - succesfull hot-add and online
> - succesfull hot-remove with SCI (qemu) eject
> - attempt to hot-readd same memory
> 
> When the pages are re-onlined on hot-readd, I get a bad_page state for many
> pages e.g.

Can you provide your config file?

Thanks
Wen Congyang

> 
> [   59.611278] init_memory_mapping: [mem 0x80000000-0x9fffffff]
> [   59.637836] Built 2 zonelists in Node order, mobility grouping on.  Total pages: 547617
> [   59.638739] Policy zone: Normal
> [   59.650840] BUG: Bad page state in process bash  pfn:9b6dc
> [   59.651124] page:ffffea0002200020 count:0 mapcount:0 mapping:          (null) index:0xfdfdfdfdfdfdfdfd
> [   59.651494] page flags: 0x2fdfdfdfd5df9fd(locked|referenced|uptodate|dirty|lru|active|slab|owner_priv_1|private|private_2|writeback|head|tail|swapcache|reclaim|swapbacked|unevictable|uncached|compound_lock)
> [   59.653604] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor button thermal_sys ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net ata_piix virtio_blk libata virtio_pci virtio_ring virtio scsi_mod
> [   59.656998] Pid: 988, comm: bash Not tainted 3.6.0-rc7-guest #12
> [   59.657172] Call Trace:
> [   59.657275]  [<ffffffff810e9b30>] ? bad_page+0xb0/0x100
> [   59.657434]  [<ffffffff810ea4c3>] ? free_pages_prepare+0xb3/0x100
> [   59.657610]  [<ffffffff810ea668>] ? free_hot_cold_page+0x48/0x1a0
> [   59.657787]  [<ffffffff8112cc08>] ? online_pages_range+0x68/0xa0
> [   59.657961]  [<ffffffff8112cba0>] ? __online_page_increment_counters+0x10/0x10
> [   59.658162]  [<ffffffff81045561>] ? walk_system_ram_range+0x101/0x110
> [   59.658346]  [<ffffffff814c4f95>] ? online_pages+0x1a5/0x2b0
> [   59.658515]  [<ffffffff8135663d>] ? __memory_block_change_state+0x20d/0x270
> [   59.658710]  [<ffffffff81356756>] ? store_mem_state+0xb6/0xf0
> [   59.658878]  [<ffffffff8119e482>] ? sysfs_write_file+0xd2/0x160
> [   59.659052]  [<ffffffff8113769a>] ? vfs_write+0xaa/0x160
> [   59.659212]  [<ffffffff81137977>] ? sys_write+0x47/0x90
> [   59.659371]  [<ffffffff814e2f25>] ? async_page_fault+0x25/0x30
> [   59.659543]  [<ffffffff814ea239>] ? system_call_fastpath+0x16/0x1b
> [   59.659720] Disabling lock debugging due to kernel taint
> 
> Patch 20/21 deals with a similar scenario, but only for __PG_HWPOISON flag.
> Did i miss any other patch for this?
> 
> thanks,
> 
> - Vasilis
> 
> [1] https://lkml.org/lkml/2012/9/6/635
> [2] https://lkml.org/lkml/2012/9/11/542
> [3] https://lkml.org/lkml/2012/9/20/37
> [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-26 16:46 ` [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory Vasilis Liaskovitis
  2012-09-27  0:59   ` Wen Congyang
@ 2012-09-27  6:37   ` Wen Congyang
  2012-09-27 10:35     ` Vasilis Liaskovitis
  2012-10-08 10:19   ` Wen Congyang
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 62+ messages in thread
From: Wen Congyang @ 2012-09-27  6:37 UTC (permalink / raw)
  To: Vasilis Liaskovitis
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

Hi Vasilis Liaskovitis

At 09/27/2012 12:46 AM, Vasilis Liaskovitis Wrote:
> Hi,
> 
> I am testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
> Running in a guest (qemu+seabios from [4]). 
> CONFIG_SLAB=y
> CONFIG_DEBUG_SLAB=y
> 
> After succesfull hot-add and online, I am doing a hot-remove with "echo 1 > /sys/bus/acpi/devices/PNP/eject"
> When I do the OSPM-eject, I often get slab corruption in "acpi-state" cache, or in other caches

I can't reproduce this problem. Can you provide the following information:
1. config file
2. qemu's command line

You said you did OSPM-eject. Do you mean write 1 to /sys/bus/acpi/devices/PNP0C80:XX/eject?

Thanks
Wen Congyang

> 
> [  170.566995] Slab corruption (Not tainted): Acpi-State start=ffff88009fc1e548, len=80
> [  170.567265] Redzone: 0x0/0x0.
> [  170.567399] Last user: [<          (null)>](0x0)
> [  170.567667] 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568078] 010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568487] 020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568894] 030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569302] 040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569712] Prev obj: start=000000009fc1e4d0, len=80
> [  170.569869] BUG: unable to handle kernel paging request at 000000009fc1e520
> [  170.570171] IP: [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.570397] PGD 7cf37067 PUD 0 
> [  170.570619] Oops: 0000 [#1] SMP 
> [  170.570843] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis microcode tpm tpm_bios psmouse parport_pc serio_raw evdev parport i2c_piix4 processor thermal_sys i2c_core button ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net virtio_blk ata_piix libata scsi_mod virtio_pci virtio_ring virtio
> [  170.573474] CPU 0 
> [  170.573568] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [  170.573830] RIP: 0010:[<ffffffff8112803c>]  [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.574106] RSP: 0018:ffff88003eaf3a70  EFLAGS: 00010202
> [  170.574268] RAX: 000000009fc1e4c8 RBX: 0000000000000002 RCX: 00000000000024b8
> [  170.574468] RDX: 000000009fc1e4c8 RSI: 000000009fc1e4c8 RDI: ffff88003e9bb980
> [  170.574668] RBP: ffff88003e9bb980 R08: ffff880037964078 R09: 0000000000000000
> [  170.574870] R10: 000000000000021e R11: 0000000000000002 R12: 000000009fc1e4c8
> [  170.575070] R13: 000000009fc1e520 R14: 000000000000004f R15: 00000000ffffffa5
> [  170.575274] FS:  00007fc6b7530700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [  170.575494] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [  170.575665] CR2: 000000009fc1e520 CR3: 000000007c9c1000 CR4: 00000000000006f0
> [  170.575870] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  170.576075] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  170.576276] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [  170.576507] Stack:
> [  170.576599]  0000000000000010 0000000001893fbe ffff88009fc1e000 0000000000000050
> [  170.576938]  000000009fc1e4c8 000000000000004f 00000000ffffffa5 ffffffff8112899f
> [  170.576938]  ffff88003eb309d8 ffffffff81712d6d ffff88003e9bb980 ffff88009fc1e540
> [  170.576938] Call Trace:
> [  170.576938]  [<ffffffff8112899f>] ? check_poison_obj+0x1df/0x1f0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff81128a9d>] ? cache_alloc_debugcheck_after.isra.52+0xed/0x220
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff8112beb5>] ? kmem_cache_alloc+0xb5/0x1e0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff812edf2d>] ? acpi_ds_result_push+0x5d/0x12e
> [  170.576938]  [<ffffffff812ed127>] ? acpi_ds_exec_end_op+0x28e/0x3d3
> [  170.576938]  [<ffffffff812fd86a>] ? acpi_ps_parse_loop+0x79f/0x931
> [  170.576938]  [<ffffffff812fdd6c>] ? acpi_ps_parse_aml+0x89/0x261
> [  170.576938]  [<ffffffff812fe50c>] ? acpi_ps_execute_method+0x1be/0x266
> [  170.576938]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [  170.576938]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [  170.576938]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [  170.576938]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [  170.576938]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [  170.576938]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [  170.576938]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [  170.576938]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [  170.576938]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [  170.576938]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [  170.576938]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [  170.576938]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [  170.576938] Code: cb 75 dc 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 8b 7f 0c 4c 89 e2 e8 02 fd ff ff 4c 89 e6 49 89 c5 48 89 ef e8 d4 fc ff ff <49> 8b 55 00 48 8b 30 48 c7 c7 8c 39 6f 81 31 c0 e8 3e 34 3b 00 
> 
> Other times, the problem happens on a slab object free:
> 
> [   52.313366] Offlined Pages 32768
> [   52.800232] slab error in verify_redzone_free(): cache `Acpi-ParseExt': memory outside object was overwritten
> [   52.801298] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12
> [   52.802039] Call Trace:
> [   52.802443]  [<ffffffff811280cb>] ? __slab_error.isra.46+0x1b/0x30
> [   52.803199]  [<ffffffff811287b6>] ? cache_free_debugcheck+0x256/0x260
> [   52.803940]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.804645]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.805321]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.806023]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.806762]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.807499]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.808183]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.808897]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.809659]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] ffff88008f809670: redzone 1:0x0, redzone 2:0x0.
> [   52.810032] ------------[ cut here ]------------
> [   52.810032] kernel BUG at mm/slab.c:3125!
> [   52.810032] invalid opcode: 0000 [#1] SMP 
> [   52.810032] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis tpm tpm_bios microcode parport_pc parport evdev processor thermal_sys psmouse i2c_piix4 serio_raw i2c_core button ext3 jbd mbcache sg sr_mod cdrom virtio_net ata_generic virtio_blk virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [   52.810032] CPU 0 
> [   52.810032] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [   52.810032] RIP: 0010:[<ffffffff81128733>]  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032] RSP: 0018:ffff88003eaf3bc0  EFLAGS: 00010093
> [   52.810032] RAX: 00000000017eac3c RBX: ffff88003e9bb700 RCX: 0000000002aaaaab
> [   52.810032] RDX: 0000000000000000 RSI: 0000000000010000 RDI: 0000000000000060
> [   52.810032] RBP: ffff88008f809670 R08: 09f911029d74e35b R09: 0000000000000000
> [   52.810032] R10: 00000000000001d3 R11: 0000000000000002 R12: ffff88008f809000
> [   52.810032] R13: ffffffff812e1b0e R14: 0000000000000000 R15: 0000000000010c00
> [   52.810032] FS:  00007f63fc263700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [   52.810032] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [   52.810032] CR2: 00007fff8d895b78 CR3: 000000007c866000 CR4: 00000000000006f0
> [   52.810032] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   52.810032] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [   52.810032] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [   52.810032] Stack:
> [   52.810032]  ffff88003e9bb980 ffff88008f809670 ffff880037ba8e18 ffff88008f809678
> [   52.810032]  ffff88003e9bb700 0000000000000282 ffff88003e9bf270 ffffffff812e1b0e
> [   52.810032]  0000000000000001 ffffffff81128fe3 ffff88003e80f5e8 ffff88003eb31748
> [   52.810032] Call Trace:
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.810032]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.810032]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.810032]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.810032]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.810032]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] Code: 89 ea 49 89 38 8b 73 14 8b 7b 0c e8 18 f6 ff ff 49 b8 5b e3 74 9d 02 11 f9 09 4c 89 00 44 8b 7b 14 44 89 f8 e9 fa fe ff ff 0f 0b <0f> 0b 48 8b 40 30 e9 d9 fe ff ff e8 c6 43 3b 00 0f 0b 48 8b 40 
> [   52.810032] RIP  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032]  RSP <ffff88003eaf3bc0>
> [   52.810032] ---[ end trace c699c8cecd5870a3 ]---
> 
> 
> And other times, I see a filesystem related slab corruption when doing the eject.
> Here I have also seen a bad rss-counter state message. 
> 
> [  232.114232] BUG: Bad rss-counter state mm:ffff88007d9c1f80 idx:0 val:1
> [  232.115214] BUG: unable to handle kernel NULL pointer dereference at           (null)
> [  232.115807] IP: [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.116186] PGD 7cdec067 PUD 7c946067 PMD 0 
> [  232.116627] Oops: 0000 [#3] SMP 
> [  232.116990] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor thermal_sys button ext3 jbd mbcache virtio_net sg sr_mod cdrom virtio_blk ata_generic virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [  232.120013] CPU 2 
> [  232.120013] Pid: 880, comm: dhclient Tainted: G      D      3.6.0-rc7-guest #1 Bochs Bochs
> [  232.120013] RIP: 0010:[<ffffffffa00cfce3>]  [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.120013] RSP: 0018:ffff88007cd6fab8  EFLAGS: 00010246
> [  232.120013] RAX: ffff88003e513f50 RBX: ffff88003e513f50 RCX: 0000000000000000
> [  232.120013] RDX: 0000000000000000 RSI: ffff88003e513f50 RDI: ffff880097800000
> [  232.120013] RBP: ffff88003e513f50 R08: 000000003e513f01 R09: 0000000180240024
> [  232.120013] R10: ffff88003e513f50 R11: 00000000000198e0 R12: 0000000000000000
> [  232.120013] R13: ffffffffa00eb437 R14: ffff880097800000 R15: 000000000000027a
> [  232.120013] FS:  00007f082638d700(0000) GS:ffff88003ec80000(0000) knlGS:0000000000000000
> [  232.120013] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [  232.120013] CR2: 0000000000000000 CR3: 000000007c94c000 CR4: 00000000000006e0
> [  232.120013] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  232.120013] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  232.120013] Process dhclient (pid: 880, threadinfo ffff88007cd6e000, task ffff88007ca46800)
> [  232.120013] Stack:
> [  232.120013]  ffff88007dc205b0 ffffffff8116645f ffff88007dc205b0 ffff88007dc205b0
> [  232.120013]  ffff88007cf58800 0000000000000000 000000000000000e 0000000000000000
> [  232.120013]  000000000000027a ffffffff8112b934 0000005000000003 0000000000000fff
> [  232.120013] Call Trace:
> [  232.120013]  [<ffffffff8116645f>] ? __find_get_block+0x7f/0x200
> [  232.120013]  [<ffffffff8112b934>] ? kmem_cache_alloc+0xe4/0x140
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffffa00d0279>] ? journal_get_write_access+0x29/0x50 [jbd]
> [  232.120013]  [<ffffffffa00eaeef>] ? __ext3_get_inode_loc+0xcf/0x360 [ext3]
> [  232.120013]  [<ffffffffa0101317>] ? __ext3_journal_get_write_access+0x27/0x60 [ext3]
> [  232.120013]  [<ffffffffa00eb213>] ? ext3_reserve_inode_write+0x73/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb27b>] ? ext3_mark_inode_dirty+0x3b/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffff8115ded6>] ? __mark_inode_dirty+0x36/0x230
> [  232.120013]  [<ffffffff811504a1>] ? update_time+0x71/0xb0
> [  232.120013]  [<ffffffff811536c9>] ? mnt_clone_write+0x9/0x20
> [  232.120013]  [<ffffffff81150581>] ? file_update_time+0xa1/0xf0
> [  232.120013]  [<ffffffff8103385c>] ? ptep_set_access_flags+0x6c/0x70
> [  232.120013]  [<ffffffff810e3f30>] ? __generic_file_aio_write+0x1a0/0x3c0
> [  232.120013]  [<ffffffff811396fb>] ? __sb_start_write+0x6b/0x130
> [  232.120013]  [<ffffffff810e41ce>] ? generic_file_aio_write+0x7e/0x100
> [  232.120013]  [<ffffffff81137484>] ? do_sync_write+0x94/0xd0
> [  232.120013]  [<ffffffff81137caa>] ? vfs_write+0xaa/0x160
> [  232.120013]  [<ffffffff81137f87>] ? sys_write+0x47/0x90
> [  232.120013]  [<ffffffff814e5765>] ? async_page_fault+0x25/0x30
> [  232.120013]  [<ffffffff814eca79>] ? system_call_fastpath+0x16/0x1b
> [  232.120013] Code: 54 24 2c f6 47 14 04 74 1f 41 bc e2 ff ff ff 48 81 c4 98 00 00 00 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 1f 40 00 4c 8b 27 <4d> 8b 3c 24 41 f6 07 02 75 d4 65 48 8b 04 25 80 b9 00 00 48 89 
> 
> Is this a known issue? If yes, can you point me to any relevant patches?
> 
> When I do an SCI(hardware) eject, I have not seen corruptions. The acpi driver is
> evaluating fewer objects in this path I think, but I don't see why corruption can't
> happen here as well.
> 
> I have seen similar problems with CONFIG_SLUB (I did not have debug_options
> there but I can also provide those if helpful)
> 
> [1] https://lkml.org/lkml/2012/9/6/635
> [2] https://lkml.org/lkml/2012/9/11/542
> [3] https://lkml.org/lkml/2012/9/20/37
> [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> 
> thanks,
> 
> - Vasilis
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-26 16:58 ` Vasilis Liaskovitis
  2012-09-27  1:03   ` Wen Congyang
@ 2012-09-27  8:53   ` Wen Congyang
  2012-09-27 10:06   ` Wen Congyang
  2 siblings, 0 replies; 62+ messages in thread
From: Wen Congyang @ 2012-09-27  8:53 UTC (permalink / raw)
  To: Vasilis Liaskovitis
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

At 09/27/2012 12:58 AM, Vasilis Liaskovitis Wrote:
> Testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
> Running in a guest (qemu+seabios from [4]). 
> CONFIG_SLAB=y
> CONFIG_DEBUG_SLAB=y
> 
> - succesfull hot-add and online
> - succesfull hot-remove with SCI (qemu) eject
> - attempt to hot-readd same memory
> 
> When the pages are re-onlined on hot-readd, I get a bad_page state for many
> pages e.g.

I have reproduced this problem, and I investigate it now.

Thanks
Wen Congyang

> 
> [   59.611278] init_memory_mapping: [mem 0x80000000-0x9fffffff]
> [   59.637836] Built 2 zonelists in Node order, mobility grouping on.  Total pages: 547617
> [   59.638739] Policy zone: Normal
> [   59.650840] BUG: Bad page state in process bash  pfn:9b6dc
> [   59.651124] page:ffffea0002200020 count:0 mapcount:0 mapping:          (null) index:0xfdfdfdfdfdfdfdfd
> [   59.651494] page flags: 0x2fdfdfdfd5df9fd(locked|referenced|uptodate|dirty|lru|active|slab|owner_priv_1|private|private_2|writeback|head|tail|swapcache|reclaim|swapbacked|unevictable|uncached|compound_lock)
> [   59.653604] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor button thermal_sys ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net ata_piix virtio_blk libata virtio_pci virtio_ring virtio scsi_mod
> [   59.656998] Pid: 988, comm: bash Not tainted 3.6.0-rc7-guest #12
> [   59.657172] Call Trace:
> [   59.657275]  [<ffffffff810e9b30>] ? bad_page+0xb0/0x100
> [   59.657434]  [<ffffffff810ea4c3>] ? free_pages_prepare+0xb3/0x100
> [   59.657610]  [<ffffffff810ea668>] ? free_hot_cold_page+0x48/0x1a0
> [   59.657787]  [<ffffffff8112cc08>] ? online_pages_range+0x68/0xa0
> [   59.657961]  [<ffffffff8112cba0>] ? __online_page_increment_counters+0x10/0x10
> [   59.658162]  [<ffffffff81045561>] ? walk_system_ram_range+0x101/0x110
> [   59.658346]  [<ffffffff814c4f95>] ? online_pages+0x1a5/0x2b0
> [   59.658515]  [<ffffffff8135663d>] ? __memory_block_change_state+0x20d/0x270
> [   59.658710]  [<ffffffff81356756>] ? store_mem_state+0xb6/0xf0
> [   59.658878]  [<ffffffff8119e482>] ? sysfs_write_file+0xd2/0x160
> [   59.659052]  [<ffffffff8113769a>] ? vfs_write+0xaa/0x160
> [   59.659212]  [<ffffffff81137977>] ? sys_write+0x47/0x90
> [   59.659371]  [<ffffffff814e2f25>] ? async_page_fault+0x25/0x30
> [   59.659543]  [<ffffffff814ea239>] ? system_call_fastpath+0x16/0x1b
> [   59.659720] Disabling lock debugging due to kernel taint
> 
> Patch 20/21 deals with a similar scenario, but only for __PG_HWPOISON flag.
> Did i miss any other patch for this?
> 
> thanks,
> 
> - Vasilis
> 
> [1] https://lkml.org/lkml/2012/9/6/635
> [2] https://lkml.org/lkml/2012/9/11/542
> [3] https://lkml.org/lkml/2012/9/20/37
> [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-26 16:58 ` Vasilis Liaskovitis
  2012-09-27  1:03   ` Wen Congyang
  2012-09-27  8:53   ` Wen Congyang
@ 2012-09-27 10:06   ` Wen Congyang
  2012-09-27 11:02     ` Vasilis Liaskovitis
  2 siblings, 1 reply; 62+ messages in thread
From: Wen Congyang @ 2012-09-27 10:06 UTC (permalink / raw)
  To: Vasilis Liaskovitis
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

At 09/27/2012 12:58 AM, Vasilis Liaskovitis Wrote:
> Testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
> Running in a guest (qemu+seabios from [4]). 
> CONFIG_SLAB=y
> CONFIG_DEBUG_SLAB=y
> 
> - succesfull hot-add and online
> - succesfull hot-remove with SCI (qemu) eject
> - attempt to hot-readd same memory
> 
> When the pages are re-onlined on hot-readd, I get a bad_page state for many
> pages e.g.
> 
> [   59.611278] init_memory_mapping: [mem 0x80000000-0x9fffffff]
> [   59.637836] Built 2 zonelists in Node order, mobility grouping on.  Total pages: 547617
> [   59.638739] Policy zone: Normal
> [   59.650840] BUG: Bad page state in process bash  pfn:9b6dc
> [   59.651124] page:ffffea0002200020 count:0 mapcount:0 mapping:          (null) index:0xfdfdfdfdfdfdfdfd
> [   59.651494] page flags: 0x2fdfdfdfd5df9fd(locked|referenced|uptodate|dirty|lru|active|slab|owner_priv_1|private|private_2|writeback|head|tail|swapcache|reclaim|swapbacked|unevictable|uncached|compound_lock)
> [   59.653604] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor button thermal_sys ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net ata_piix virtio_blk libata virtio_pci virtio_ring virtio scsi_mod
> [   59.656998] Pid: 988, comm: bash Not tainted 3.6.0-rc7-guest #12
> [   59.657172] Call Trace:
> [   59.657275]  [<ffffffff810e9b30>] ? bad_page+0xb0/0x100
> [   59.657434]  [<ffffffff810ea4c3>] ? free_pages_prepare+0xb3/0x100
> [   59.657610]  [<ffffffff810ea668>] ? free_hot_cold_page+0x48/0x1a0
> [   59.657787]  [<ffffffff8112cc08>] ? online_pages_range+0x68/0xa0
> [   59.657961]  [<ffffffff8112cba0>] ? __online_page_increment_counters+0x10/0x10
> [   59.658162]  [<ffffffff81045561>] ? walk_system_ram_range+0x101/0x110
> [   59.658346]  [<ffffffff814c4f95>] ? online_pages+0x1a5/0x2b0
> [   59.658515]  [<ffffffff8135663d>] ? __memory_block_change_state+0x20d/0x270
> [   59.658710]  [<ffffffff81356756>] ? store_mem_state+0xb6/0xf0
> [   59.658878]  [<ffffffff8119e482>] ? sysfs_write_file+0xd2/0x160
> [   59.659052]  [<ffffffff8113769a>] ? vfs_write+0xaa/0x160
> [   59.659212]  [<ffffffff81137977>] ? sys_write+0x47/0x90
> [   59.659371]  [<ffffffff814e2f25>] ? async_page_fault+0x25/0x30
> [   59.659543]  [<ffffffff814ea239>] ? system_call_fastpath+0x16/0x1b
> [   59.659720] Disabling lock debugging due to kernel taint
> 
> Patch 20/21 deals with a similar scenario, but only for __PG_HWPOISON flag.
> Did i miss any other patch for this?

Please try the following patch:
>From a38ec678e0a9b48b252f457d7910b7527049dc43 Mon Sep 17 00:00:00 2001
From: Wen Congyang <wency@cn.fujitsu.com>
Date: Thu, 27 Sep 2012 17:27:57 +0800
Subject: [PATCH] clear the memory to store page information

---
 mm/sparse.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index ab9d755..36dda08 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -639,7 +639,6 @@ static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
 got_map_page:
 	ret = (struct page *)pfn_to_kaddr(page_to_pfn(page));
 got_map_ptr:
-	memset(ret, 0, memmap_size);
 
 	return ret;
 }
@@ -761,6 +760,8 @@ int __meminit sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
 		goto out;
 	}
 
+	memset(memmap, 0, sizeof(struct page) * nr_pages);
+
 	ms->section_mem_map |= SECTION_MARKED_PRESENT;
 
 	ret = sparse_init_one_section(ms, section_nr, memmap, usemap);
-- 
1.7.1

Thanks
Wen Congyang

> 
> thanks,
> 
> - Vasilis
> 
> [1] https://lkml.org/lkml/2012/9/6/635
> [2] https://lkml.org/lkml/2012/9/11/542
> [3] https://lkml.org/lkml/2012/9/20/37
> [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> 
> 
> 


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-27  6:37   ` Wen Congyang
@ 2012-09-27 10:35     ` Vasilis Liaskovitis
  2012-09-28  1:41       ` Wen Congyang
  0 siblings, 1 reply; 62+ messages in thread
From: Vasilis Liaskovitis @ 2012-09-27 10:35 UTC (permalink / raw)
  To: Wen Congyang
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]

On Thu, Sep 27, 2012 at 02:37:14PM +0800, Wen Congyang wrote:
> Hi Vasilis Liaskovitis
> 
> At 09/27/2012 12:46 AM, Vasilis Liaskovitis Wrote:
> > Hi,
> > 
> > I am testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
> > Running in a guest (qemu+seabios from [4]). 
> > CONFIG_SLAB=y
> > CONFIG_DEBUG_SLAB=y
> > 
> > After succesfull hot-add and online, I am doing a hot-remove with "echo 1 > /sys/bus/acpi/devices/PNP/eject"
> > When I do the OSPM-eject, I often get slab corruption in "acpi-state" cache, or in other caches
> 
> I can't reproduce this problem. Can you provide the following information:
> 1. config file
> 2. qemu's command line
> 
> You said you did OSPM-eject. Do you mean write 1 to /sys/bus/acpi/devices/PNP0C80:XX/eject?
yes.

example qemu command line with one dimm:

"/opt/qemu-kvm-memhp/bin/qemu-system-x86_64 -bios
/opt/extra/vliaskov/devel/seabios-upstream/out/bios.bin -enable-kvm -M pc -smp
4,maxcpus=8 -cpu host -m 2048 -drive file=/opt/extra/debian-template.raw,if=none,id=drive-virtio-disk0,format=raw
-device virtio-blk-pci,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-vga cirrus -netdev type=tap,id=guest0,vhost=on -device virtio-net-pci,netdev=guest0
-monitor unix:/tmp/qemu.monitor11,server,nowait -chardev stdio,id=seabios  -device
isa-debugcon,iobase=0x402,chardev=seabios
-dimm id=n0,size=512M,node=0"

or last line with 2 numa nodes:
"-dimm id=n0,size=512M,node=0 -dimm id=n1,size=512M,node=1 -numa node,nodeid=0 -numa node,nodeid=1"

attached config. Tree is at:
https://github.com/vliaskov/linux/commits/memhp-fujitsu

thanks,
- Vasilis

[-- Attachment #2: config-3.6.0-rc7-guest --]
[-- Type: text/plain, Size: 87660 bytes --]

#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.6.0-rc7 Kernel Configuration
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_GPIO=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
CONFIG_ARCH_CPU_PROBE_RELEASE=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_HAVE_IRQ_WORK=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION="-guest"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
# CONFIG_FHANDLE is not set
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
# CONFIG_TASK_XACCT is not set
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y
# CONFIG_AUDIT_LOGINUID_IMMUTABLE is not set
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_IRQ_DOMAIN=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_PREEMPT_RCU is not set
CONFIG_RCU_FANOUT=64
CONFIG_RCU_FANOUT_LEAF=16
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_RCU_FAST_NO_HZ is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
# CONFIG_RESOURCE_COUNTERS is not set
# CONFIG_CGROUP_PERF is not set
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_CFS_BANDWIDTH is not set
# CONFIG_RT_GROUP_SCHED is not set
# CONFIG_BLK_CGROUP is not set
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_OPROFILE=m
# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_NMI_TIMER=y
CONFIG_KPROBES=y
# CONFIG_JUMP_LABEL is not set
CONFIG_OPTPROBES=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_KRETPROBES=y
CONFIG_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_USE_GENERIC_SMP_HELPERS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP_FILTER=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=y
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
# CONFIG_ACORN_PARTITION_CUMANA is not set
# CONFIG_ACORN_PARTITION_EESOX is not set
CONFIG_ACORN_PARTITION_ICS=y
# CONFIG_ACORN_PARTITION_ADFS is not set
# CONFIG_ACORN_PARTITION_POWERTEC is not set
CONFIG_ACORN_PARTITION_RISCIX=y
CONFIG_OSF_PARTITION=y
CONFIG_AMIGA_PARTITION=y
CONFIG_ATARI_PARTITION=y
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
CONFIG_SOLARIS_X86_PARTITION=y
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
# CONFIG_SYSV68_PARTITION is not set
CONFIG_BLOCK_COMPAT=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_DEADLINE is not set
# CONFIG_DEFAULT_CFQ is not set
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"
CONFIG_PREEMPT_NOTIFIERS=y
# CONFIG_INLINE_SPIN_TRYLOCK is not set
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK is not set
# CONFIG_INLINE_SPIN_LOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_READ_TRYLOCK is not set
# CONFIG_INLINE_READ_LOCK is not set
# CONFIG_INLINE_READ_LOCK_BH is not set
# CONFIG_INLINE_READ_LOCK_IRQ is not set
# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
CONFIG_INLINE_READ_UNLOCK=y
# CONFIG_INLINE_READ_UNLOCK_BH is not set
CONFIG_INLINE_READ_UNLOCK_IRQ=y
# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_WRITE_TRYLOCK is not set
# CONFIG_INLINE_WRITE_LOCK is not set
# CONFIG_INLINE_WRITE_LOCK_BH is not set
# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
CONFIG_INLINE_WRITE_UNLOCK=y
# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_FREEZER=y

#
# Processor type and features
#
CONFIG_ZONE_DMA=y
CONFIG_SMP=y
CONFIG_X86_MPPARSE=y
# CONFIG_X86_EXTENDED_PLATFORM is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_PARAVIRT_GUEST=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
# CONFIG_XEN is not set
# CONFIG_XEN_PRIVILEGED_GUEST is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_SPINLOCKS is not set
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_NO_BOOTMEM=y
# CONFIG_MEMTEST is not set
CONFIG_MK8=y
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
# CONFIG_GENERIC_CPU is not set
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INTEL_USERCOPY=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
# CONFIG_PROCESSOR_SELECT is not set
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_GART_IOMMU=y
CONFIG_CALGARY_IOMMU=y
CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS=512
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
CONFIG_X86_MCE_INJECT=m
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_I8K is not set
CONFIG_MICROCODE=m
CONFIG_MICROCODE_INTEL=y
CONFIG_MICROCODE_AMD=y
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_X86_MSR=m
CONFIG_X86_CPUID=m
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
CONFIG_NUMA=y
CONFIG_AMD_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_NODES_SPAN_OTHER_NODES=y
CONFIG_NUMA_EMU=y
CONFIG_NODES_SHIFT=6
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_MEMORY_PROBE=y
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_NEED_MULTIPLE_NODES=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
CONFIG_MEMORY_ISOLATION=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_SPARSE=y
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_COMPACTION=y
CONFIG_MIGRATION=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
CONFIG_MEMORY_FAILURE=y
CONFIG_HWPOISON_INJECT=m
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
CONFIG_CROSS_MEMORY_ATTACH=y
# CONFIG_CLEANCACHE is not set
# CONFIG_FRONTSWAP is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
CONFIG_ARCH_RANDOM=y
CONFIG_EFI=y
# CONFIG_EFI_STUB is not set
CONFIG_SECCOMP=y
CONFIG_CC_STACKPROTECTOR=y
CONFIG_HZ_100=y
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=100
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
# CONFIG_KEXEC_JUMP is not set
CONFIG_PHYSICAL_START=0x1000000
CONFIG_RELOCATABLE=y
CONFIG_PHYSICAL_ALIGN=0x1000000
CONFIG_HOTPLUG_CPU=y
# CONFIG_COMPAT_VDSO is not set
# CONFIG_CMDLINE_BOOL is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_USE_PERCPU_NUMA_NODE_ID=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM_RUNTIME=y
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_PROCFS=y
# CONFIG_ACPI_PROCFS_POWER is not set
# CONFIG_ACPI_EC_DEBUGFS is not set
# CONFIG_ACPI_PROC_EVENT is not set
CONFIG_ACPI_AC=m
CONFIG_ACPI_BATTERY=m
CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_VIDEO=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_IPMI=m
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
CONFIG_ACPI_THERMAL=m
CONFIG_ACPI_NUMA=y
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_PCI_SLOT=m
CONFIG_X86_PM_TIMER=y
CONFIG_ACPI_CONTAINER=m
CONFIG_ACPI_HOTPLUG_MEMORY=m
CONFIG_ACPI_SBS=m
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_CUSTOM_METHOD is not set
# CONFIG_ACPI_BGRT is not set
# CONFIG_ACPI_APEI is not set
CONFIG_SFI=y

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_STAT=m
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

#
# x86 CPU frequency scaling drivers
#
# CONFIG_X86_PCC_CPUFREQ is not set
CONFIG_X86_ACPI_CPUFREQ=m
CONFIG_X86_POWERNOW_K8=m
CONFIG_X86_SPEEDSTEP_CENTRINO=m
# CONFIG_X86_P4_CLOCKMOD is not set

#
# shared options
#
# CONFIG_X86_SPEEDSTEP_LIB is not set
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
# CONFIG_INTEL_IDLE is not set

#
# Memory power savings
#
CONFIG_I7300_IDLE_IOAT_CHANNEL=y
CONFIG_I7300_IDLE=m

#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_DOMAINS=y
# CONFIG_PCI_CNB20LE_QUIRK is not set
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=m
CONFIG_PCIEAER=y
# CONFIG_PCIE_ECRC is not set
CONFIG_PCIEAER_INJECT=m
CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_PCIEASPM_DEFAULT=y
# CONFIG_PCIEASPM_POWERSAVE is not set
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_PCIE_PME=y
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
# CONFIG_PCI_DEBUG is not set
# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set
CONFIG_PCI_STUB=m
CONFIG_HT_IRQ=y
CONFIG_PCI_ATS=y
CONFIG_PCI_IOV=y
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
CONFIG_PCI_IOAPIC=y
CONFIG_PCI_LABEL=y
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
CONFIG_PCCARD=m
CONFIG_PCMCIA=m
CONFIG_PCMCIA_LOAD_CIS=y
CONFIG_CARDBUS=y

#
# PC-card bridges
#
# CONFIG_YENTA is not set
# CONFIG_PD6729 is not set
# CONFIG_I82092 is not set
CONFIG_HOTPLUG_PCI=m
CONFIG_HOTPLUG_PCI_FAKE=m
CONFIG_HOTPLUG_PCI_ACPI=m
CONFIG_HOTPLUG_PCI_ACPI_IBM=m
CONFIG_HOTPLUG_PCI_CPCI=y
CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m
CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
CONFIG_HOTPLUG_PCI_SHPC=m
# CONFIG_RAPIDIO is not set

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=m
CONFIG_IA32_EMULATION=y
CONFIG_IA32_AOUT=y
# CONFIG_X86_X32 is not set
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_KEYS_COMPAT=y
CONFIG_HAVE_TEXT_POKE_SMP=y
CONFIG_X86_DEV_DMA_OPS=y
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_UNIX=y
# CONFIG_UNIX_DIAG is not set
CONFIG_XFRM=y
CONFIG_XFRM_ALGO=m
CONFIG_XFRM_USER=m
CONFIG_XFRM_SUB_POLICY=y
CONFIG_XFRM_MIGRATE=y
# CONFIG_XFRM_STATISTICS is not set
CONFIG_XFRM_IPCOMP=m
CONFIG_NET_KEY=m
CONFIG_NET_KEY_MIGRATE=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
# CONFIG_IP_FIB_TRIE_STATS is not set
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_ROUTE_CLASSID=y
# CONFIG_IP_PNP is not set
CONFIG_NET_IPIP=m
# CONFIG_NET_IPGRE_DEMUX is not set
CONFIG_IP_MROUTE=y
# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
# CONFIG_ARPD is not set
CONFIG_SYN_COOKIES=y
# CONFIG_NET_IPVTI is not set
CONFIG_INET_AH=m
CONFIG_INET_ESP=m
CONFIG_INET_IPCOMP=m
CONFIG_INET_XFRM_TUNNEL=m
CONFIG_INET_TUNNEL=m
CONFIG_INET_XFRM_MODE_TRANSPORT=m
CONFIG_INET_XFRM_MODE_TUNNEL=m
CONFIG_INET_XFRM_MODE_BEET=m
CONFIG_INET_LRO=m
CONFIG_INET_DIAG=m
CONFIG_INET_TCP_DIAG=m
# CONFIG_INET_UDP_DIAG is not set
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=m
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=m
CONFIG_TCP_CONG_HTCP=m
CONFIG_TCP_CONG_HSTCP=m
CONFIG_TCP_CONG_HYBLA=m
CONFIG_TCP_CONG_VEGAS=m
CONFIG_TCP_CONG_SCALABLE=m
CONFIG_TCP_CONG_LP=m
CONFIG_TCP_CONG_VENO=m
CONFIG_TCP_CONG_YEAH=m
CONFIG_TCP_CONG_ILLINOIS=m
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=y
CONFIG_IPV6_PRIVACY=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_INET6_AH=m
CONFIG_INET6_ESP=m
CONFIG_INET6_IPCOMP=m
CONFIG_IPV6_MIP6=y
CONFIG_INET6_XFRM_TUNNEL=m
CONFIG_INET6_TUNNEL=m
CONFIG_INET6_XFRM_MODE_TRANSPORT=m
CONFIG_INET6_XFRM_MODE_TUNNEL=m
CONFIG_INET6_XFRM_MODE_BEET=m
CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
CONFIG_IPV6_SIT=m
# CONFIG_IPV6_SIT_6RD is not set
CONFIG_IPV6_NDISC_NODETYPE=y
CONFIG_IPV6_TUNNEL=m
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
# CONFIG_IPV6_MROUTE_MULTIPLE_TABLES is not set
CONFIG_IPV6_PIMSM_V2=y
# CONFIG_NETLABEL is not set
CONFIG_NETWORK_SECMARK=y
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
CONFIG_NETFILTER_ADVANCED=y
CONFIG_BRIDGE_NETFILTER=y

#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_NETLINK=m
# CONFIG_NETFILTER_NETLINK_ACCT is not set
CONFIG_NETFILTER_NETLINK_QUEUE=m
CONFIG_NETFILTER_NETLINK_LOG=m
CONFIG_NF_CONNTRACK=m
CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_PROCFS=y
CONFIG_NF_CONNTRACK_EVENTS=y
# CONFIG_NF_CONNTRACK_TIMEOUT is not set
# CONFIG_NF_CONNTRACK_TIMESTAMP is not set
CONFIG_NF_CT_PROTO_DCCP=m
CONFIG_NF_CT_PROTO_GRE=m
CONFIG_NF_CT_PROTO_SCTP=m
CONFIG_NF_CT_PROTO_UDPLITE=m
CONFIG_NF_CONNTRACK_AMANDA=m
CONFIG_NF_CONNTRACK_FTP=m
CONFIG_NF_CONNTRACK_H323=m
CONFIG_NF_CONNTRACK_IRC=m
CONFIG_NF_CONNTRACK_BROADCAST=m
CONFIG_NF_CONNTRACK_NETBIOS_NS=m
# CONFIG_NF_CONNTRACK_SNMP is not set
CONFIG_NF_CONNTRACK_PPTP=m
CONFIG_NF_CONNTRACK_SANE=m
CONFIG_NF_CONNTRACK_SIP=m
CONFIG_NF_CONNTRACK_TFTP=m
CONFIG_NF_CT_NETLINK=m
# CONFIG_NF_CT_NETLINK_TIMEOUT is not set
# CONFIG_NETFILTER_NETLINK_QUEUE_CT is not set
CONFIG_NETFILTER_TPROXY=m
CONFIG_NETFILTER_XTABLES=m

#
# Xtables combined modules
#
CONFIG_NETFILTER_XT_MARK=m
CONFIG_NETFILTER_XT_CONNMARK=m

#
# Xtables targets
#
# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set
# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
# CONFIG_NETFILTER_XT_TARGET_CT is not set
CONFIG_NETFILTER_XT_TARGET_DSCP=m
CONFIG_NETFILTER_XT_TARGET_HL=m
# CONFIG_NETFILTER_XT_TARGET_HMARK is not set
# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set
CONFIG_NETFILTER_XT_TARGET_LED=m
# CONFIG_NETFILTER_XT_TARGET_LOG is not set
CONFIG_NETFILTER_XT_TARGET_MARK=m
CONFIG_NETFILTER_XT_TARGET_NFLOG=m
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
CONFIG_NETFILTER_XT_TARGET_RATEEST=m
# CONFIG_NETFILTER_XT_TARGET_TEE is not set
CONFIG_NETFILTER_XT_TARGET_TPROXY=m
CONFIG_NETFILTER_XT_TARGET_TRACE=m
CONFIG_NETFILTER_XT_TARGET_SECMARK=m
CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m

#
# Xtables matches
#
# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set
CONFIG_NETFILTER_XT_MATCH_CLUSTER=m
CONFIG_NETFILTER_XT_MATCH_COMMENT=m
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
# CONFIG_NETFILTER_XT_MATCH_CPU is not set
CONFIG_NETFILTER_XT_MATCH_DCCP=m
# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_ECN=m
CONFIG_NETFILTER_XT_MATCH_ESP=m
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_HL=m
CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
CONFIG_NETFILTER_XT_MATCH_IPVS=m
CONFIG_NETFILTER_XT_MATCH_LENGTH=m
CONFIG_NETFILTER_XT_MATCH_LIMIT=m
CONFIG_NETFILTER_XT_MATCH_MAC=m
CONFIG_NETFILTER_XT_MATCH_MARK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set
CONFIG_NETFILTER_XT_MATCH_OSF=m
CONFIG_NETFILTER_XT_MATCH_OWNER=m
CONFIG_NETFILTER_XT_MATCH_POLICY=m
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
CONFIG_NETFILTER_XT_MATCH_QUOTA=m
CONFIG_NETFILTER_XT_MATCH_RATEEST=m
CONFIG_NETFILTER_XT_MATCH_REALM=m
CONFIG_NETFILTER_XT_MATCH_RECENT=m
CONFIG_NETFILTER_XT_MATCH_SCTP=m
CONFIG_NETFILTER_XT_MATCH_SOCKET=m
CONFIG_NETFILTER_XT_MATCH_STATE=m
CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
CONFIG_NETFILTER_XT_MATCH_STRING=m
CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
CONFIG_NETFILTER_XT_MATCH_TIME=m
CONFIG_NETFILTER_XT_MATCH_U32=m
# CONFIG_IP_SET is not set
CONFIG_IP_VS=m
CONFIG_IP_VS_IPV6=y
# CONFIG_IP_VS_DEBUG is not set
CONFIG_IP_VS_TAB_BITS=12

#
# IPVS transport protocol load balancing support
#
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_AH_ESP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y
# CONFIG_IP_VS_PROTO_SCTP is not set

#
# IPVS scheduler
#
CONFIG_IP_VS_RR=m
CONFIG_IP_VS_WRR=m
CONFIG_IP_VS_LC=m
CONFIG_IP_VS_WLC=m
CONFIG_IP_VS_LBLC=m
CONFIG_IP_VS_LBLCR=m
CONFIG_IP_VS_DH=m
CONFIG_IP_VS_SH=m
CONFIG_IP_VS_SED=m
CONFIG_IP_VS_NQ=m

#
# IPVS SH scheduler
#
CONFIG_IP_VS_SH_TAB_BITS=8

#
# IPVS application helper
#
CONFIG_IP_VS_FTP=m
CONFIG_IP_VS_NFCT=y
# CONFIG_IP_VS_PE_SIP is not set

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=m
CONFIG_NF_CONNTRACK_IPV4=m
CONFIG_NF_CONNTRACK_PROC_COMPAT=y
CONFIG_IP_NF_QUEUE=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_MATCH_AH=m
CONFIG_IP_NF_MATCH_ECN=m
# CONFIG_IP_NF_MATCH_RPFILTER is not set
CONFIG_IP_NF_MATCH_TTL=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_TARGET_ULOG=m
CONFIG_NF_NAT=m
CONFIG_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_TARGET_NETMAP=m
CONFIG_IP_NF_TARGET_REDIRECT=m
CONFIG_NF_NAT_PROTO_DCCP=m
CONFIG_NF_NAT_PROTO_GRE=m
CONFIG_NF_NAT_PROTO_UDPLITE=m
CONFIG_NF_NAT_PROTO_SCTP=m
CONFIG_NF_NAT_FTP=m
CONFIG_NF_NAT_IRC=m
CONFIG_NF_NAT_TFTP=m
CONFIG_NF_NAT_AMANDA=m
CONFIG_NF_NAT_PPTP=m
CONFIG_NF_NAT_H323=m
CONFIG_NF_NAT_SIP=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP_NF_TARGET_CLUSTERIP=m
CONFIG_IP_NF_TARGET_ECN=m
CONFIG_IP_NF_TARGET_TTL=m
CONFIG_IP_NF_RAW=m
CONFIG_IP_NF_SECURITY=m
CONFIG_IP_NF_ARPTABLES=m
CONFIG_IP_NF_ARPFILTER=m
CONFIG_IP_NF_ARP_MANGLE=m

#
# IPv6: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV6=m
CONFIG_NF_CONNTRACK_IPV6=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_MATCH_AH=m
CONFIG_IP6_NF_MATCH_EUI64=m
CONFIG_IP6_NF_MATCH_FRAG=m
CONFIG_IP6_NF_MATCH_OPTS=m
CONFIG_IP6_NF_MATCH_HL=m
CONFIG_IP6_NF_MATCH_IPV6HEADER=m
CONFIG_IP6_NF_MATCH_MH=m
# CONFIG_IP6_NF_MATCH_RPFILTER is not set
CONFIG_IP6_NF_MATCH_RT=m
CONFIG_IP6_NF_TARGET_HL=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_MANGLE=m
CONFIG_IP6_NF_RAW=m
CONFIG_IP6_NF_SECURITY=m

#
# DECnet: Netfilter Configuration
#
CONFIG_DECNET_NF_GRABULATOR=m
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_AMONG=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BRIDGE_EBT_LIMIT=m
CONFIG_BRIDGE_EBT_MARK=m
CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_STP=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE_EBT_ARPREPLY=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_MARK_T=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_ULOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
CONFIG_IP_DCCP=m
CONFIG_INET_DCCP_DIAG=m

#
# DCCP CCIDs Configuration (EXPERIMENTAL)
#
# CONFIG_IP_DCCP_CCID2_DEBUG is not set
CONFIG_IP_DCCP_CCID3=y
# CONFIG_IP_DCCP_CCID3_DEBUG is not set
CONFIG_IP_DCCP_TFRC_LIB=y

#
# DCCP Kernel Hacking
#
# CONFIG_IP_DCCP_DEBUG is not set
# CONFIG_NET_DCCPPROBE is not set
CONFIG_IP_SCTP=y
# CONFIG_NET_SCTPPROBE is not set
# CONFIG_SCTP_DBG_MSG is not set
# CONFIG_SCTP_DBG_OBJCNT is not set
# CONFIG_SCTP_HMAC_NONE is not set
# CONFIG_SCTP_HMAC_SHA1 is not set
CONFIG_SCTP_HMAC_MD5=y
CONFIG_RDS=m
CONFIG_RDS_RDMA=m
CONFIG_RDS_TCP=m
# CONFIG_RDS_DEBUG is not set
CONFIG_TIPC=m
CONFIG_TIPC_ADVANCED=y
CONFIG_TIPC_PORTS=8191
CONFIG_ATM=m
CONFIG_ATM_CLIP=m
# CONFIG_ATM_CLIP_NO_ICMP is not set
CONFIG_ATM_LANE=m
CONFIG_ATM_MPOA=m
CONFIG_ATM_BR2684=m
# CONFIG_ATM_BR2684_IPFILTER is not set
# CONFIG_L2TP is not set
CONFIG_STP=m
CONFIG_GARP=m
CONFIG_BRIDGE=m
CONFIG_BRIDGE_IGMP_SNOOPING=y
# CONFIG_NET_DSA is not set
CONFIG_VLAN_8021Q=m
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_DECNET=m
# CONFIG_DECNET_ROUTER is not set
CONFIG_LLC=m
CONFIG_LLC2=m
CONFIG_IPX=m
# CONFIG_IPX_INTERN is not set
# CONFIG_ATALK is not set
CONFIG_X25=m
CONFIG_LAPB=m
CONFIG_WAN_ROUTER=m
# CONFIG_PHONET is not set
CONFIG_IEEE802154=m
# CONFIG_IEEE802154_6LOWPAN is not set
# CONFIG_MAC802154 is not set
CONFIG_NET_SCHED=y

#
# Queueing/Scheduling
#
CONFIG_NET_SCH_CBQ=m
CONFIG_NET_SCH_HTB=m
CONFIG_NET_SCH_HFSC=m
CONFIG_NET_SCH_ATM=m
CONFIG_NET_SCH_PRIO=m
CONFIG_NET_SCH_MULTIQ=m
CONFIG_NET_SCH_RED=m
# CONFIG_NET_SCH_SFB is not set
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_TEQL=m
CONFIG_NET_SCH_TBF=m
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_DSMARK=m
CONFIG_NET_SCH_NETEM=m
CONFIG_NET_SCH_DRR=m
# CONFIG_NET_SCH_MQPRIO is not set
# CONFIG_NET_SCH_CHOKE is not set
# CONFIG_NET_SCH_QFQ is not set
# CONFIG_NET_SCH_CODEL is not set
# CONFIG_NET_SCH_FQ_CODEL is not set
CONFIG_NET_SCH_INGRESS=m
# CONFIG_NET_SCH_PLUG is not set

#
# Classification
#
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=m
CONFIG_NET_CLS_TCINDEX=m
CONFIG_NET_CLS_ROUTE4=m
CONFIG_NET_CLS_FW=m
CONFIG_NET_CLS_U32=m
CONFIG_CLS_U32_PERF=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_CLS_RSVP=m
CONFIG_NET_CLS_RSVP6=m
CONFIG_NET_CLS_FLOW=m
CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=m
CONFIG_NET_EMATCH_NBYTE=m
CONFIG_NET_EMATCH_U32=m
CONFIG_NET_EMATCH_META=m
CONFIG_NET_EMATCH_TEXT=m
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m
CONFIG_NET_ACT_SKBEDIT=m
# CONFIG_NET_ACT_CSUM is not set
CONFIG_NET_CLS_IND=y
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=y
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_XPS=y
# CONFIG_NETPRIO_CGROUP is not set
CONFIG_BQL=y
# CONFIG_BPF_JIT is not set

#
# Network testing
#
CONFIG_NET_PKTGEN=m
# CONFIG_NET_TCPPROBE is not set
CONFIG_NET_DROP_MONITOR=y
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
CONFIG_AF_RXRPC=m
# CONFIG_AF_RXRPC_DEBUG is not set
CONFIG_RXKAD=m
CONFIG_FIB_RULES=y
# CONFIG_WIRELESS is not set
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_RFKILL_REGULATOR is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set
CONFIG_HAVE_BPF_JIT=y

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
# CONFIG_DEVTMPFS_MOUNT is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=m
CONFIG_DMA_SHARED_BUFFER=y
CONFIG_CONNECTOR=m
# CONFIG_MTD is not set
CONFIG_PARPORT=m
CONFIG_PARPORT_PC=m
CONFIG_PARPORT_SERIAL=m
# CONFIG_PARPORT_PC_FIFO is not set
# CONFIG_PARPORT_PC_SUPERIO is not set
# CONFIG_PARPORT_PC_PCMCIA is not set
# CONFIG_PARPORT_GSC is not set
CONFIG_PARPORT_AX88796=m
CONFIG_PARPORT_1284=y
CONFIG_PARPORT_NOT_PC=y
CONFIG_PNP=y
# CONFIG_PNP_DEBUG_MESSAGES is not set

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
CONFIG_BLK_CPQ_DA=m
CONFIG_BLK_CPQ_CISS_DA=m
CONFIG_CISS_SCSI_TAPE=y
CONFIG_BLK_DEV_DAC960=m
CONFIG_BLK_DEV_UMEM=m
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
CONFIG_BLK_DEV_DRBD=m
# CONFIG_DRBD_FAULT_INJECTION is not set
CONFIG_BLK_DEV_NBD=m
# CONFIG_BLK_DEV_NVME is not set
CONFIG_BLK_DEV_OSD=m
CONFIG_BLK_DEV_SX8=m
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=m
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=65536
# CONFIG_BLK_DEV_XIP is not set
CONFIG_CDROM_PKTCDVD=m
CONFIG_CDROM_PKTCDVD_BUFFERS=8
# CONFIG_CDROM_PKTCDVD_WCACHE is not set
CONFIG_ATA_OVER_ETH=m
CONFIG_VIRTIO_BLK=m
# CONFIG_BLK_DEV_HD is not set
# CONFIG_BLK_DEV_RBD is not set

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_AD525X_DPOT is not set
CONFIG_IBM_ASM=m
CONFIG_PHANTOM=m
# CONFIG_INTEL_MID_PTI is not set
CONFIG_SGI_IOC4=m
CONFIG_TIFM_CORE=m
CONFIG_TIFM_7XX1=m
CONFIG_ICS932S401=m
CONFIG_ENCLOSURE_SERVICES=m
CONFIG_HP_ILO=m
# CONFIG_APDS9802ALS is not set
CONFIG_ISL29003=m
# CONFIG_ISL29020 is not set
CONFIG_SENSORS_TSL2550=m
# CONFIG_SENSORS_BH1780 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_SENSORS_APDS990X is not set
# CONFIG_HMC6352 is not set
CONFIG_DS1682=m
# CONFIG_TI_DAC7512 is not set
# CONFIG_VMWARE_BALLOON is not set
# CONFIG_BMP085_I2C is not set
# CONFIG_BMP085_SPI is not set
# CONFIG_PCH_PHUB is not set
# CONFIG_USB_SWITCH_FSA9480 is not set
CONFIG_C2PORT=m
CONFIG_C2PORT_DURAMAR_2150=m

#
# EEPROM support
#
CONFIG_EEPROM_AT24=m
CONFIG_EEPROM_AT25=m
CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
CONFIG_EEPROM_93CX6=m
# CONFIG_EEPROM_93XX46 is not set
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y

#
# Texas Instruments shared transport line discipline
#
# CONFIG_TI_ST is not set
# CONFIG_SENSORS_LIS3_I2C is not set

#
# Altera FPGA firmware download module
#
# CONFIG_ALTERA_STAPL is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set

#
# SCSI device support
#
CONFIG_SCSI_MOD=m
CONFIG_RAID_ATTRS=m
CONFIG_SCSI=m
CONFIG_SCSI_DMA=y
CONFIG_SCSI_TGT=m
CONFIG_SCSI_NETLINK=y
# CONFIG_SCSI_PROC_FS is not set

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=m
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
CONFIG_BLK_DEV_SR=m
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=m
CONFIG_CHR_DEV_SCH=m
CONFIG_SCSI_ENCLOSURE=m
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=m
CONFIG_SCSI_FC_ATTRS=m
CONFIG_SCSI_FC_TGT_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=m
CONFIG_SCSI_SAS_ATTRS=m
CONFIG_SCSI_SAS_LIBSAS=m
CONFIG_SCSI_SAS_ATA=y
CONFIG_SCSI_SAS_HOST_SMP=y
CONFIG_SCSI_SRP_ATTRS=m
CONFIG_SCSI_SRP_TGT_ATTRS=y
CONFIG_SCSI_LOWLEVEL=y
CONFIG_ISCSI_TCP=m
CONFIG_ISCSI_BOOT_SYSFS=m
CONFIG_SCSI_CXGB3_ISCSI=m
# CONFIG_SCSI_CXGB4_ISCSI is not set
CONFIG_SCSI_BNX2_ISCSI=m
# CONFIG_SCSI_BNX2X_FCOE is not set
CONFIG_BE2ISCSI=m
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_HPSA is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_MVUMI is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
CONFIG_MEGARAID_NEWGEN=y
CONFIG_MEGARAID_MM=m
CONFIG_MEGARAID_MAILBOX=m
CONFIG_MEGARAID_LEGACY=m
CONFIG_MEGARAID_SAS=m
CONFIG_SCSI_MPT2SAS=m
CONFIG_SCSI_MPT2SAS_MAX_SGE=128
# CONFIG_SCSI_MPT2SAS_LOGGING is not set
# CONFIG_SCSI_UFSHCD is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_VMWARE_PVSCSI is not set
CONFIG_LIBFC=m
CONFIG_LIBFCOE=m
# CONFIG_FCOE is not set
# CONFIG_FCOE_FNIC is not set
# CONFIG_SCSI_DMX3191D is not set
CONFIG_SCSI_EATA=m
CONFIG_SCSI_EATA_TAGGED_QUEUE=y
CONFIG_SCSI_EATA_LINKED_COMMANDS=y
CONFIG_SCSI_EATA_MAX_TAGS=16
# CONFIG_SCSI_FUTURE_DOMAIN is not set
CONFIG_SCSI_GDTH=m
# CONFIG_SCSI_ISCI is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_IMM is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
CONFIG_SCSI_SRP=m
# CONFIG_SCSI_BFA_FC is not set
CONFIG_SCSI_VIRTIO=m
# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
CONFIG_SCSI_DH=m
CONFIG_SCSI_DH_RDAC=m
# CONFIG_SCSI_DH_HP_SW is not set
# CONFIG_SCSI_DH_EMC is not set
# CONFIG_SCSI_DH_ALUA is not set
CONFIG_SCSI_OSD_INITIATOR=m
CONFIG_SCSI_OSD_ULD=m
CONFIG_SCSI_OSD_DPRINT_SENSE=1
# CONFIG_SCSI_OSD_DEBUG is not set
CONFIG_ATA=m
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_ACPI=y
CONFIG_SATA_PMP=y

#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI=m
# CONFIG_SATA_AHCI_PLATFORM is not set
CONFIG_SATA_INIC162X=m
# CONFIG_SATA_ACARD_AHCI is not set
CONFIG_SATA_SIL24=m
CONFIG_ATA_SFF=y

#
# SFF controllers with custom DMA interface
#
CONFIG_PDC_ADMA=m
CONFIG_SATA_QSTOR=m
CONFIG_SATA_SX4=m
CONFIG_ATA_BMDMA=y

#
# SATA SFF controllers with BMDMA
#
CONFIG_ATA_PIIX=m
CONFIG_SATA_MV=m
CONFIG_SATA_NV=m
CONFIG_SATA_PROMISE=m
CONFIG_SATA_SIL=m
CONFIG_SATA_SIS=m
CONFIG_SATA_SVW=m
CONFIG_SATA_ULI=m
CONFIG_SATA_VIA=m
CONFIG_SATA_VITESSE=m

#
# PATA SFF controllers with BMDMA
#
CONFIG_PATA_ALI=m
CONFIG_PATA_AMD=m
# CONFIG_PATA_ARASAN_CF is not set
CONFIG_PATA_ARTOP=m
CONFIG_PATA_ATIIXP=m
CONFIG_PATA_ATP867X=m
CONFIG_PATA_CMD64X=m
CONFIG_PATA_CS5520=m
CONFIG_PATA_CS5530=m
# CONFIG_PATA_CS5536 is not set
# CONFIG_PATA_CYPRESS is not set
CONFIG_PATA_EFAR=m
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
CONFIG_PATA_IT821X=m
CONFIG_PATA_JMICRON=m
CONFIG_PATA_MARVELL=m
CONFIG_PATA_NETCELL=m
# CONFIG_PATA_NINJA32 is not set
CONFIG_PATA_NS87415=m
CONFIG_PATA_OLDPIIX=m
# CONFIG_PATA_OPTIDMA is not set
CONFIG_PATA_PDC2027X=m
CONFIG_PATA_PDC_OLD=m
# CONFIG_PATA_RADISYS is not set
CONFIG_PATA_RDC=m
CONFIG_PATA_SC1200=m
CONFIG_PATA_SCH=m
CONFIG_PATA_SERVERWORKS=m
CONFIG_PATA_SIL680=m
CONFIG_PATA_SIS=m
# CONFIG_PATA_TOSHIBA is not set
CONFIG_PATA_TRIFLEX=m
CONFIG_PATA_VIA=m
# CONFIG_PATA_WINBOND is not set

#
# PIO-only SFF controllers
#
# CONFIG_PATA_CMD640_PCI is not set
CONFIG_PATA_MPIIX=m
CONFIG_PATA_NS87410=m
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_PCMCIA is not set
# CONFIG_PATA_PLATFORM is not set
CONFIG_PATA_RZ1000=m

#
# Generic fallback / legacy drivers
#
# CONFIG_PATA_ACPI is not set
CONFIG_ATA_GENERIC=m
# CONFIG_PATA_LEGACY is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=m
CONFIG_MD_LINEAR=m
CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m
CONFIG_MD_RAID10=m
CONFIG_MD_RAID456=m
# CONFIG_MULTICORE_RAID456 is not set
CONFIG_MD_MULTIPATH=m
CONFIG_MD_FAULTY=m
CONFIG_BLK_DEV_DM=m
# CONFIG_DM_DEBUG is not set
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
# CONFIG_DM_THIN_PROVISIONING is not set
CONFIG_DM_MIRROR=m
# CONFIG_DM_RAID is not set
CONFIG_DM_LOG_USERSPACE=m
CONFIG_DM_ZERO=m
CONFIG_DM_MULTIPATH=m
CONFIG_DM_MULTIPATH_QL=m
CONFIG_DM_MULTIPATH_ST=m
CONFIG_DM_DELAY=m
CONFIG_DM_UEVENT=y
# CONFIG_DM_FLAKEY is not set
# CONFIG_DM_VERITY is not set
# CONFIG_TARGET_CORE is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#
# CONFIG_FIREWIRE is not set
# CONFIG_FIREWIRE_NOSY is not set
CONFIG_I2O=m
CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
CONFIG_I2O_EXT_ADAPTEC=y
CONFIG_I2O_EXT_ADAPTEC_DMA64=y
CONFIG_I2O_CONFIG=m
CONFIG_I2O_CONFIG_OLD_IOCTL=y
CONFIG_I2O_BUS=m
CONFIG_I2O_BLOCK=m
CONFIG_I2O_SCSI=m
CONFIG_I2O_PROC=m
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
CONFIG_NET_CORE=y
CONFIG_BONDING=m
CONFIG_DUMMY=m
CONFIG_EQUALIZER=m
CONFIG_NET_FC=y
CONFIG_MII=m
CONFIG_IEEE802154_DRIVERS=m
CONFIG_IEEE802154_FAKEHARD=m
CONFIG_IFB=m
# CONFIG_NET_TEAM is not set
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
CONFIG_NETCONSOLE=m
CONFIG_NETCONSOLE_DYNAMIC=y
CONFIG_NETPOLL=y
# CONFIG_NETPOLL_TRAP is not set
CONFIG_NET_POLL_CONTROLLER=y
CONFIG_TUN=m
CONFIG_VETH=m
CONFIG_VIRTIO_NET=m
CONFIG_SUNGEM_PHY=m
CONFIG_ARCNET=m
CONFIG_ARCNET_1201=m
CONFIG_ARCNET_1051=m
CONFIG_ARCNET_RAW=m
CONFIG_ARCNET_CAP=m
CONFIG_ARCNET_COM90xx=m
CONFIG_ARCNET_COM90xxIO=m
CONFIG_ARCNET_RIM_I=m
CONFIG_ARCNET_COM20020=m
CONFIG_ARCNET_COM20020_PCI=m
# CONFIG_ARCNET_COM20020_CS is not set
# CONFIG_ATM_DRIVERS is not set

#
# CAIF transport drivers
#
CONFIG_ETHERNET=y
CONFIG_MDIO=m
CONFIG_NET_VENDOR_3COM=y
# CONFIG_PCMCIA_3C574 is not set
# CONFIG_PCMCIA_3C589 is not set
CONFIG_VORTEX=m
CONFIG_TYPHOON=m
CONFIG_NET_VENDOR_ADAPTEC=y
CONFIG_ADAPTEC_STARFIRE=m
CONFIG_NET_VENDOR_ALTEON=y
CONFIG_ACENIC=m
# CONFIG_ACENIC_OMIT_TIGON_I is not set
CONFIG_NET_VENDOR_AMD=y
CONFIG_AMD8111_ETH=m
CONFIG_PCNET32=m
# CONFIG_PCMCIA_NMCLAN is not set
CONFIG_NET_VENDOR_ATHEROS=y
CONFIG_ATL2=m
CONFIG_ATL1=m
CONFIG_ATL1E=m
CONFIG_ATL1C=m
CONFIG_NET_VENDOR_BROADCOM=y
CONFIG_B44=m
CONFIG_B44_PCI_AUTOSELECT=y
CONFIG_B44_PCICORE_AUTOSELECT=y
CONFIG_B44_PCI=y
CONFIG_BNX2=y
CONFIG_CNIC=m
CONFIG_TIGON3=m
CONFIG_BNX2X=m
CONFIG_NET_VENDOR_BROCADE=y
# CONFIG_BNA is not set
# CONFIG_NET_CALXEDA_XGMAC is not set
CONFIG_NET_VENDOR_CHELSIO=y
CONFIG_CHELSIO_T1=m
CONFIG_CHELSIO_T1_1G=y
CONFIG_CHELSIO_T3=m
# CONFIG_CHELSIO_T4 is not set
# CONFIG_CHELSIO_T4VF is not set
CONFIG_NET_VENDOR_CISCO=y
CONFIG_ENIC=m
CONFIG_DNET=m
CONFIG_NET_VENDOR_DEC=y
CONFIG_NET_TULIP=y
CONFIG_DE2104X=m
CONFIG_DE2104X_DSL=0
CONFIG_TULIP=m
# CONFIG_TULIP_MWI is not set
# CONFIG_TULIP_MMIO is not set
CONFIG_TULIP_NAPI=y
CONFIG_TULIP_NAPI_HW_MITIGATION=y
CONFIG_DE4X5=m
CONFIG_WINBOND_840=m
CONFIG_DM9102=m
CONFIG_ULI526X=m
# CONFIG_PCMCIA_XIRCOM is not set
CONFIG_NET_VENDOR_DLINK=y
# CONFIG_DE600 is not set
# CONFIG_DE620 is not set
CONFIG_DL2K=m
CONFIG_SUNDANCE=m
# CONFIG_SUNDANCE_MMIO is not set
CONFIG_NET_VENDOR_EMULEX=y
CONFIG_BE2NET=m
CONFIG_NET_VENDOR_EXAR=y
CONFIG_S2IO=m
CONFIG_VXGE=m
# CONFIG_VXGE_DEBUG_TRACE_ALL is not set
CONFIG_NET_VENDOR_FUJITSU=y
# CONFIG_PCMCIA_FMVJ18X is not set
CONFIG_NET_VENDOR_HP=y
CONFIG_HP100=m
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=m
CONFIG_E1000=m
CONFIG_E1000E=m
CONFIG_IGB=m
CONFIG_IGB_DCA=y
# CONFIG_IGB_PTP is not set
CONFIG_IGBVF=m
CONFIG_IXGB=m
CONFIG_IXGBE=m
CONFIG_IXGBE_HWMON=y
CONFIG_IXGBE_DCA=y
CONFIG_IXGBE_DCB=y
# CONFIG_IXGBE_PTP is not set
# CONFIG_IXGBEVF is not set
CONFIG_NET_VENDOR_I825XX=y
# CONFIG_ZNET is not set
CONFIG_IP1000=m
CONFIG_JME=m
CONFIG_NET_VENDOR_MARVELL=y
CONFIG_SKGE=m
# CONFIG_SKGE_DEBUG is not set
# CONFIG_SKGE_GENESIS is not set
CONFIG_SKY2=m
# CONFIG_SKY2_DEBUG is not set
CONFIG_NET_VENDOR_MELLANOX=y
CONFIG_MLX4_EN=m
CONFIG_MLX4_EN_DCB=y
CONFIG_MLX4_CORE=m
CONFIG_MLX4_DEBUG=y
CONFIG_NET_VENDOR_MICREL=y
CONFIG_KS8842=m
CONFIG_KS8851=m
CONFIG_KS8851_MLL=m
# CONFIG_KSZ884X_PCI is not set
CONFIG_NET_VENDOR_MICROCHIP=y
CONFIG_ENC28J60=m
# CONFIG_ENC28J60_WRITEVERIFY is not set
CONFIG_NET_VENDOR_MYRI=y
CONFIG_MYRI10GE=m
CONFIG_MYRI10GE_DCA=y
CONFIG_FEALNX=m
CONFIG_NET_VENDOR_NATSEMI=y
CONFIG_NATSEMI=m
CONFIG_NS83820=m
CONFIG_NET_VENDOR_8390=y
# CONFIG_PCMCIA_AXNET is not set
CONFIG_NE2K_PCI=m
# CONFIG_PCMCIA_PCNET is not set
CONFIG_NET_VENDOR_NVIDIA=y
CONFIG_FORCEDETH=m
CONFIG_NET_VENDOR_OKI=y
# CONFIG_PCH_GBE is not set
CONFIG_ETHOC=m
CONFIG_NET_PACKET_ENGINE=y
CONFIG_HAMACHI=m
CONFIG_YELLOWFIN=m
CONFIG_NET_VENDOR_QLOGIC=y
CONFIG_QLA3XXX=m
CONFIG_QLCNIC=m
CONFIG_QLGE=m
CONFIG_NETXEN_NIC=m
CONFIG_NET_VENDOR_REALTEK=y
# CONFIG_ATP is not set
CONFIG_8139CP=m
CONFIG_8139TOO=m
# CONFIG_8139TOO_PIO is not set
CONFIG_8139TOO_TUNE_TWISTER=y
CONFIG_8139TOO_8129=y
# CONFIG_8139_OLD_RX_RESET is not set
CONFIG_R8169=m
CONFIG_NET_VENDOR_RDC=y
CONFIG_R6040=m
CONFIG_NET_VENDOR_SEEQ=y
# CONFIG_SEEQ8005 is not set
CONFIG_NET_VENDOR_SILAN=y
CONFIG_SC92031=m
CONFIG_NET_VENDOR_SIS=y
CONFIG_SIS900=m
CONFIG_SIS190=m
CONFIG_SFC=m
CONFIG_SFC_MCDI_MON=y
CONFIG_SFC_SRIOV=y
CONFIG_NET_VENDOR_SMSC=y
# CONFIG_PCMCIA_SMC91C92 is not set
CONFIG_EPIC100=m
CONFIG_SMSC9420=m
CONFIG_NET_VENDOR_STMICRO=y
# CONFIG_STMMAC_ETH is not set
CONFIG_NET_VENDOR_SUN=y
CONFIG_HAPPYMEAL=m
CONFIG_SUNGEM=m
CONFIG_CASSINI=m
CONFIG_NIU=m
CONFIG_NET_VENDOR_TEHUTI=y
CONFIG_TEHUTI=m
CONFIG_NET_VENDOR_TI=y
CONFIG_TLAN=m
CONFIG_NET_VENDOR_VIA=y
CONFIG_VIA_RHINE=m
# CONFIG_VIA_RHINE_MMIO is not set
CONFIG_VIA_VELOCITY=m
CONFIG_NET_VENDOR_WIZNET=y
# CONFIG_WIZNET_W5100 is not set
# CONFIG_WIZNET_W5300 is not set
CONFIG_NET_VENDOR_XIRCOM=y
# CONFIG_PCMCIA_XIRC2PS is not set
CONFIG_FDDI=y
CONFIG_DEFXX=m
# CONFIG_DEFXX_MMIO is not set
CONFIG_SKFP=m
CONFIG_HIPPI=y
CONFIG_ROADRUNNER=m
# CONFIG_ROADRUNNER_LARGE_RINGS is not set
CONFIG_NET_SB1000=m
CONFIG_PHYLIB=m

#
# MII PHY device drivers
#
# CONFIG_AMD_PHY is not set
CONFIG_MARVELL_PHY=m
CONFIG_DAVICOM_PHY=m
CONFIG_QSEMI_PHY=m
CONFIG_LXT_PHY=m
CONFIG_CICADA_PHY=m
CONFIG_VITESSE_PHY=m
CONFIG_SMSC_PHY=m
CONFIG_BROADCOM_PHY=m
# CONFIG_BCM87XX_PHY is not set
CONFIG_ICPLUS_PHY=m
CONFIG_REALTEK_PHY=m
CONFIG_NATIONAL_PHY=m
CONFIG_STE10XP=m
CONFIG_LSI_ET1011C_PHY=m
# CONFIG_MICREL_PHY is not set
CONFIG_MDIO_BITBANG=m
# CONFIG_MDIO_GPIO is not set
# CONFIG_MICREL_KS8995MA is not set
CONFIG_PLIP=m
CONFIG_PPP=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_FILTER=y
CONFIG_PPP_MPPE=m
CONFIG_PPP_MULTILINK=y
CONFIG_PPPOATM=m
CONFIG_PPPOE=m
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_SLIP=m
CONFIG_SLHC=m
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y

#
# USB Network Adapters
#
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_USBNET is not set
# CONFIG_USB_IPHETH is not set
# CONFIG_WLAN is not set

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
# CONFIG_WAN is not set
CONFIG_VMXNET3=m
# CONFIG_ISDN is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_FF_MEMLESS=m
CONFIG_INPUT_POLLDEV=m
CONFIG_INPUT_SPARSEKMAP=m
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
CONFIG_INPUT_EVDEV=m
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ADP5588=m
# CONFIG_KEYBOARD_ADP5589 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
CONFIG_KEYBOARD_LKKBD=m
# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_KEYBOARD_GPIO_POLLED is not set
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
CONFIG_KEYBOARD_LM8323=m
# CONFIG_KEYBOARD_LM8333 is not set
CONFIG_KEYBOARD_MAX7359=m
# CONFIG_KEYBOARD_MCS is not set
# CONFIG_KEYBOARD_MPR121 is not set
CONFIG_KEYBOARD_NEWTON=m
CONFIG_KEYBOARD_OPENCORES=m
CONFIG_KEYBOARD_STOWAWAY=m
CONFIG_KEYBOARD_SUNKBD=m
# CONFIG_KEYBOARD_OMAP4 is not set
CONFIG_KEYBOARD_XTKBD=m
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
CONFIG_MOUSE_PS2_ELANTECH=y
CONFIG_MOUSE_PS2_SENTELIC=y
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
CONFIG_MOUSE_SERIAL=m
CONFIG_MOUSE_APPLETOUCH=m
CONFIG_MOUSE_BCM5974=m
CONFIG_MOUSE_VSXXXAA=m
# CONFIG_MOUSE_GPIO is not set
CONFIG_MOUSE_SYNAPTICS_I2C=m
# CONFIG_MOUSE_SYNAPTICS_USB is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=m
CONFIG_SERIO_CT82C710=m
CONFIG_SERIO_PARKBD=m
CONFIG_SERIO_PCIPS2=m
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=m
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_SERIAL_NONSTANDARD is not set
CONFIG_NOZOMI=m
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
# CONFIG_DEVKMEM is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_PNP=y
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
CONFIG_SERIAL_8250_RSA=y

#
# Non-8250 serial port support
#
CONFIG_SERIAL_MAX3100=m
# CONFIG_SERIAL_MAX3107 is not set
# CONFIG_SERIAL_MFD_HSU is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_JSM=m
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_IFX6X60 is not set
# CONFIG_SERIAL_PCH_UART is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
# CONFIG_TTY_PRINTK is not set
CONFIG_PRINTER=m
# CONFIG_LP_CONSOLE is not set
CONFIG_PPDEV=m
CONFIG_HVC_DRIVER=y
CONFIG_VIRTIO_CONSOLE=m
CONFIG_IPMI_HANDLER=m
# CONFIG_IPMI_PANIC_EVENT is not set
CONFIG_IPMI_DEVICE_INTERFACE=m
CONFIG_IPMI_SI=m
CONFIG_IPMI_WATCHDOG=m
CONFIG_IPMI_POWEROFF=m
CONFIG_HW_RANDOM=m
CONFIG_HW_RANDOM_TIMERIOMEM=m
CONFIG_HW_RANDOM_INTEL=m
CONFIG_HW_RANDOM_AMD=m
CONFIG_HW_RANDOM_VIA=m
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_NVRAM=m
CONFIG_R3964=m
CONFIG_APPLICOM=m

#
# PCMCIA character devices
#
# CONFIG_SYNCLINK_CS is not set
# CONFIG_CARDMAN_4000 is not set
# CONFIG_CARDMAN_4040 is not set
# CONFIG_IPWIRELESS is not set
CONFIG_MWAVE=m
CONFIG_RAW_DRIVER=m
CONFIG_MAX_RAW_DEVS=256
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_HANGCHECK_TIMER=m
CONFIG_TCG_TPM=m
CONFIG_TCG_TIS=m
CONFIG_TCG_NSC=m
CONFIG_TCG_ATMEL=m
CONFIG_TCG_INFINEON=m
CONFIG_TELCLOCK=m
CONFIG_DEVPORT=y
CONFIG_I2C=m
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=m
# CONFIG_I2C_MUX is not set
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_SMBUS=m
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_ALGOPCA=m

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
CONFIG_I2C_ALI1535=m
CONFIG_I2C_ALI1563=m
CONFIG_I2C_ALI15X3=m
CONFIG_I2C_AMD756=m
CONFIG_I2C_AMD756_S4882=m
CONFIG_I2C_AMD8111=m
CONFIG_I2C_I801=m
CONFIG_I2C_ISCH=m
CONFIG_I2C_PIIX4=m
CONFIG_I2C_NFORCE2=m
CONFIG_I2C_NFORCE2_S4985=m
CONFIG_I2C_SIS5595=m
CONFIG_I2C_SIS630=m
CONFIG_I2C_SIS96X=m
CONFIG_I2C_VIA=m
CONFIG_I2C_VIAPRO=m

#
# ACPI drivers
#
CONFIG_I2C_SCMI=m

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EG20T is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_INTEL_MID is not set
CONFIG_I2C_OCORES=m
CONFIG_I2C_PCA_PLATFORM=m
# CONFIG_I2C_PXA_PCI is not set
CONFIG_I2C_SIMTEC=m
# CONFIG_I2C_XILINX is not set

#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_DIOLAN_U2C is not set
CONFIG_I2C_PARPORT=m
CONFIG_I2C_PARPORT_LIGHT=m
CONFIG_I2C_TAOS_EVM=m
CONFIG_I2C_TINY_USB=m

#
# Other I2C/SMBus bus drivers
#
CONFIG_I2C_STUB=m
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
CONFIG_SPI_BITBANG=m
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_GPIO is not set
# CONFIG_SPI_LM70_LLP is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_TOPCLIFF_PCH is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
CONFIG_SPI_TLE62X0=m
# CONFIG_HSI is not set

#
# PPS support
#
# CONFIG_PPS is not set

#
# PPS generators support
#

#
# PTP clock support
#

#
# Enable Device Drivers -> PPS to see the PTP clock options.
#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIOLIB=y
# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set

#
# Memory mapped GPIO drivers:
#
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_IT8761E is not set
# CONFIG_GPIO_SCH is not set
# CONFIG_GPIO_ICH is not set
# CONFIG_GPIO_VX855 is not set

#
# I2C GPIO expanders:
#
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_ADP5588 is not set

#
# PCI GPIO expanders:
#
# CONFIG_GPIO_BT8XX is not set
# CONFIG_GPIO_AMD8111 is not set
# CONFIG_GPIO_LANGWELL is not set
# CONFIG_GPIO_PCH is not set
# CONFIG_GPIO_ML_IOH is not set
# CONFIG_GPIO_RDC321X is not set

#
# SPI GPIO expanders:
#
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MCP23S08 is not set
# CONFIG_GPIO_MC33880 is not set
# CONFIG_GPIO_74X164 is not set

#
# AC97 GPIO expanders:
#

#
# MODULbus GPIO expanders:
#
# CONFIG_W1 is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_PDA_POWER=m
# CONFIG_TEST_POWER is not set
# CONFIG_BATTERY_DS2780 is not set
# CONFIG_BATTERY_DS2781 is not set
CONFIG_BATTERY_DS2782=m
# CONFIG_BATTERY_SBS is not set
CONFIG_BATTERY_BQ27x00=m
CONFIG_BATTERY_BQ27X00_I2C=y
CONFIG_BATTERY_BQ27X00_PLATFORM=y
CONFIG_BATTERY_MAX17040=m
# CONFIG_BATTERY_MAX17042 is not set
CONFIG_CHARGER_PCF50633=m
# CONFIG_CHARGER_MAX8903 is not set
# CONFIG_CHARGER_LP8727 is not set
# CONFIG_CHARGER_GPIO is not set
# CONFIG_CHARGER_MANAGER is not set
# CONFIG_CHARGER_SMB347 is not set
# CONFIG_POWER_AVS is not set
CONFIG_HWMON=y
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
CONFIG_SENSORS_ABITUGURU=m
CONFIG_SENSORS_ABITUGURU3=m
# CONFIG_SENSORS_AD7314 is not set
CONFIG_SENSORS_AD7414=m
CONFIG_SENSORS_AD7418=m
CONFIG_SENSORS_ADCXX=m
CONFIG_SENSORS_ADM1021=m
CONFIG_SENSORS_ADM1025=m
CONFIG_SENSORS_ADM1026=m
CONFIG_SENSORS_ADM1029=m
CONFIG_SENSORS_ADM1031=m
CONFIG_SENSORS_ADM9240=m
# CONFIG_SENSORS_ADT7411 is not set
CONFIG_SENSORS_ADT7462=m
CONFIG_SENSORS_ADT7470=m
CONFIG_SENSORS_ADT7475=m
# CONFIG_SENSORS_ASC7621 is not set
CONFIG_SENSORS_K8TEMP=m
# CONFIG_SENSORS_K10TEMP is not set
# CONFIG_SENSORS_FAM15H_POWER is not set
CONFIG_SENSORS_ASB100=m
CONFIG_SENSORS_ATXP1=m
# CONFIG_SENSORS_DS620 is not set
CONFIG_SENSORS_DS1621=m
CONFIG_SENSORS_I5K_AMB=m
CONFIG_SENSORS_F71805F=m
CONFIG_SENSORS_F71882FG=m
CONFIG_SENSORS_F75375S=m
CONFIG_SENSORS_FSCHMD=m
CONFIG_SENSORS_G760A=m
CONFIG_SENSORS_GL518SM=m
CONFIG_SENSORS_GL520SM=m
# CONFIG_SENSORS_GPIO_FAN is not set
# CONFIG_SENSORS_HIH6130 is not set
CONFIG_SENSORS_CORETEMP=m
CONFIG_SENSORS_IBMAEM=m
CONFIG_SENSORS_IBMPEX=m
CONFIG_SENSORS_IT87=m
# CONFIG_SENSORS_JC42 is not set
# CONFIG_SENSORS_LINEAGE is not set
CONFIG_SENSORS_LM63=m
CONFIG_SENSORS_LM70=m
# CONFIG_SENSORS_LM73 is not set
CONFIG_SENSORS_LM75=m
CONFIG_SENSORS_LM77=m
CONFIG_SENSORS_LM78=m
CONFIG_SENSORS_LM80=m
CONFIG_SENSORS_LM83=m
CONFIG_SENSORS_LM85=m
CONFIG_SENSORS_LM87=m
CONFIG_SENSORS_LM90=m
CONFIG_SENSORS_LM92=m
CONFIG_SENSORS_LM93=m
# CONFIG_SENSORS_LTC4151 is not set
CONFIG_SENSORS_LTC4215=m
CONFIG_SENSORS_LTC4245=m
# CONFIG_SENSORS_LTC4261 is not set
CONFIG_SENSORS_LM95241=m
# CONFIG_SENSORS_LM95245 is not set
CONFIG_SENSORS_MAX1111=m
# CONFIG_SENSORS_MAX16065 is not set
CONFIG_SENSORS_MAX1619=m
# CONFIG_SENSORS_MAX1668 is not set
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6642 is not set
CONFIG_SENSORS_MAX6650=m
# CONFIG_SENSORS_MCP3021 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
CONFIG_SENSORS_PC87360=m
CONFIG_SENSORS_PC87427=m
CONFIG_SENSORS_PCF8591=m
# CONFIG_PMBUS is not set
# CONFIG_SENSORS_SHT15 is not set
# CONFIG_SENSORS_SHT21 is not set
CONFIG_SENSORS_SIS5595=m
# CONFIG_SENSORS_SMM665 is not set
CONFIG_SENSORS_DME1737=m
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC6W201 is not set
CONFIG_SENSORS_SMSC47M1=m
CONFIG_SENSORS_SMSC47M192=m
CONFIG_SENSORS_SMSC47B397=m
# CONFIG_SENSORS_SCH56XX_COMMON is not set
# CONFIG_SENSORS_ADS1015 is not set
CONFIG_SENSORS_ADS7828=m
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_INA2XX is not set
CONFIG_SENSORS_THMC50=m
# CONFIG_SENSORS_TMP102 is not set
CONFIG_SENSORS_TMP401=m
CONFIG_SENSORS_TMP421=m
CONFIG_SENSORS_VIA_CPUTEMP=m
CONFIG_SENSORS_VIA686A=m
CONFIG_SENSORS_VT1211=m
CONFIG_SENSORS_VT8231=m
CONFIG_SENSORS_W83781D=m
CONFIG_SENSORS_W83791D=m
CONFIG_SENSORS_W83792D=m
CONFIG_SENSORS_W83793=m
# CONFIG_SENSORS_W83795 is not set
CONFIG_SENSORS_W83L785TS=m
CONFIG_SENSORS_W83L786NG=m
CONFIG_SENSORS_W83627HF=m
CONFIG_SENSORS_W83627EHF=m
CONFIG_SENSORS_APPLESMC=m

#
# ACPI drivers
#
# CONFIG_SENSORS_ACPI_POWER is not set
CONFIG_SENSORS_ATK0110=m
CONFIG_THERMAL=m
CONFIG_THERMAL_HWMON=y
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
CONFIG_SSB=m
CONFIG_SSB_SPROM=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
CONFIG_SSB_PCIHOST=y
# CONFIG_SSB_B43_PCI_BRIDGE is not set
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
# CONFIG_SSB_PCMCIAHOST is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
CONFIG_SSB_SDIOHOST=y
# CONFIG_SSB_SILENT is not set
# CONFIG_SSB_DEBUG is not set
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
CONFIG_SSB_DRIVER_PCICORE=y
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=m
CONFIG_MFD_SM501=m
# CONFIG_MFD_SM501_GPIO is not set
CONFIG_HTC_PASIC3=m
# CONFIG_MFD_LM3533 is not set
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
# CONFIG_MFD_TPS65217 is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_STMPE is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_DA9052_SPI is not set
# CONFIG_MFD_ARIZONA_I2C is not set
# CONFIG_MFD_ARIZONA_SPI is not set
# CONFIG_MFD_WM831X_SPI is not set
CONFIG_MFD_PCF50633=m
CONFIG_PCF50633_ADC=m
CONFIG_PCF50633_GPIO=m
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_ABX500_CORE is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_MFD_CS5535 is not set
# CONFIG_MFD_TIMBERDALE is not set
CONFIG_LPC_SCH=m
# CONFIG_LPC_ICH is not set
# CONFIG_MFD_RDC321X is not set
# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_WL1273_CORE is not set
CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
# CONFIG_REGULATOR_DUMMY is not set
CONFIG_REGULATOR_FIXED_VOLTAGE=m
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
CONFIG_REGULATOR_USERSPACE_CONSUMER=m
# CONFIG_REGULATOR_GPIO is not set
# CONFIG_REGULATOR_AD5398 is not set
# CONFIG_REGULATOR_ISL6271A is not set
CONFIG_REGULATOR_MAX1586=m
# CONFIG_REGULATOR_MAX8649 is not set
# CONFIG_REGULATOR_MAX8660 is not set
# CONFIG_REGULATOR_MAX8952 is not set
CONFIG_REGULATOR_LP3971=m
# CONFIG_REGULATOR_LP3972 is not set
CONFIG_REGULATOR_PCF50633=m
# CONFIG_REGULATOR_TPS62360 is not set
CONFIG_REGULATOR_TPS65023=m
CONFIG_REGULATOR_TPS6507X=m
# CONFIG_REGULATOR_TPS6524X is not set
# CONFIG_MEDIA_SUPPORT is not set

#
# Graphics support
#
CONFIG_AGP=y
CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
CONFIG_AGP_SIS=y
CONFIG_AGP_VIA=y
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
# CONFIG_VGA_SWITCHEROO is not set
CONFIG_DRM=m
CONFIG_DRM_KMS_HELPER=m
# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
CONFIG_DRM_TTM=m
CONFIG_DRM_TDFX=m
CONFIG_DRM_R128=m
CONFIG_DRM_RADEON=m
# CONFIG_DRM_RADEON_KMS is not set
# CONFIG_DRM_NOUVEAU is not set

#
# I2C encoder or helper chips
#
# CONFIG_DRM_I2C_CH7006 is not set
# CONFIG_DRM_I2C_SIL164 is not set
CONFIG_DRM_I810=m
CONFIG_DRM_I915=m
# CONFIG_DRM_I915_KMS is not set
CONFIG_DRM_MGA=m
CONFIG_DRM_SIS=m
CONFIG_DRM_VIA=m
CONFIG_DRM_SAVAGE=m
# CONFIG_DRM_VMWGFX is not set
# CONFIG_DRM_GMA500 is not set
# CONFIG_DRM_UDL is not set
# CONFIG_DRM_AST is not set
# CONFIG_DRM_MGAG200 is not set
# CONFIG_DRM_CIRRUS_QEMU is not set
# CONFIG_STUB_POULSBO is not set
CONFIG_VGASTATE=m
CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
CONFIG_FB_DDC=m
CONFIG_FB_BOOT_VESA_SUPPORT=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=m
CONFIG_FB_SYS_COPYAREA=m
CONFIG_FB_SYS_IMAGEBLIT=m
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=m
# CONFIG_FB_WMT_GE_ROPS is not set
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_HECUBA=m
CONFIG_FB_SVGALIB=m
# CONFIG_FB_MACMODES is not set
CONFIG_FB_BACKLIGHT=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
CONFIG_FB_CIRRUS=m
CONFIG_FB_PM2=m
CONFIG_FB_PM2_FIFO_DISCONNECT=y
CONFIG_FB_CYBER2000=m
CONFIG_FB_CYBER2000_DDC=y
CONFIG_FB_ARC=m
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
CONFIG_FB_VGA16=m
CONFIG_FB_UVESA=m
CONFIG_FB_VESA=y
CONFIG_FB_EFI=y
CONFIG_FB_N411=m
CONFIG_FB_HGA=m
CONFIG_FB_S1D13XXX=m
CONFIG_FB_NVIDIA=m
# CONFIG_FB_NVIDIA_I2C is not set
# CONFIG_FB_NVIDIA_DEBUG is not set
CONFIG_FB_NVIDIA_BACKLIGHT=y
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
CONFIG_FB_LE80578=m
CONFIG_FB_CARILLO_RANCH=m
# CONFIG_FB_INTEL is not set
CONFIG_FB_MATROX=m
CONFIG_FB_MATROX_MILLENIUM=y
CONFIG_FB_MATROX_MYSTIQUE=y
CONFIG_FB_MATROX_G=y
CONFIG_FB_MATROX_I2C=m
CONFIG_FB_MATROX_MAVEN=m
CONFIG_FB_RADEON=m
CONFIG_FB_RADEON_I2C=y
CONFIG_FB_RADEON_BACKLIGHT=y
# CONFIG_FB_RADEON_DEBUG is not set
CONFIG_FB_ATY128=m
CONFIG_FB_ATY128_BACKLIGHT=y
CONFIG_FB_ATY=m
CONFIG_FB_ATY_CT=y
# CONFIG_FB_ATY_GENERIC_LCD is not set
CONFIG_FB_ATY_GX=y
CONFIG_FB_ATY_BACKLIGHT=y
CONFIG_FB_S3=m
CONFIG_FB_S3_DDC=y
CONFIG_FB_SAVAGE=m
# CONFIG_FB_SAVAGE_I2C is not set
# CONFIG_FB_SAVAGE_ACCEL is not set
CONFIG_FB_SIS=m
CONFIG_FB_SIS_300=y
CONFIG_FB_SIS_315=y
CONFIG_FB_VIA=m
# CONFIG_FB_VIA_DIRECT_PROCFS is not set
# CONFIG_FB_VIA_X_COMPATIBILITY is not set
CONFIG_FB_NEOMAGIC=m
CONFIG_FB_KYRO=m
CONFIG_FB_3DFX=m
# CONFIG_FB_3DFX_ACCEL is not set
CONFIG_FB_3DFX_I2C=y
CONFIG_FB_VOODOO1=m
CONFIG_FB_VT8623=m
CONFIG_FB_TRIDENT=m
CONFIG_FB_ARK=m
CONFIG_FB_PM3=m
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_GEODE is not set
# CONFIG_FB_TMIO is not set
CONFIG_FB_SM501=m
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
CONFIG_FB_VIRTUAL=m
CONFIG_FB_METRONOME=m
CONFIG_FB_MB862XX=m
CONFIG_FB_MB862XX_PCI_GDC=y
CONFIG_FB_MB862XX_I2C=y
# CONFIG_FB_BROADSHEET is not set
# CONFIG_FB_AUO_K190X is not set
# CONFIG_EXYNOS_VIDEO is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_BACKLIGHT_PROGEAR=m
# CONFIG_BACKLIGHT_APPLE is not set
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_PCF50633 is not set
# CONFIG_BACKLIGHT_LP855X is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
# CONFIG_LOGO is not set
# CONFIG_SOUND is not set

#
# HID support
#
CONFIG_HID=y
# CONFIG_HID_BATTERY_STRENGTH is not set
CONFIG_HIDRAW=y
# CONFIG_UHID is not set
CONFIG_HID_GENERIC=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=m
# CONFIG_HID_ACRUX is not set
CONFIG_HID_APPLE=m
# CONFIG_HID_AUREAL is not set
CONFIG_HID_BELKIN=m
CONFIG_HID_CHERRY=m
CONFIG_HID_CHICONY=m
CONFIG_HID_CYPRESS=m
CONFIG_HID_DRAGONRISE=m
CONFIG_DRAGONRISE_FF=y
# CONFIG_HID_EMS_FF is not set
CONFIG_HID_EZKEY=m
# CONFIG_HID_HOLTEK is not set
# CONFIG_HID_KEYTOUCH is not set
CONFIG_HID_KYE=m
# CONFIG_HID_UCLOGIC is not set
# CONFIG_HID_WALTOP is not set
CONFIG_HID_GYRATION=m
CONFIG_HID_TWINHAN=m
CONFIG_HID_KENSINGTON=m
# CONFIG_HID_LCPOWER is not set
# CONFIG_HID_LENOVO_TPKBD is not set
CONFIG_HID_LOGITECH=m
CONFIG_HID_LOGITECH_DJ=m
CONFIG_LOGITECH_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
# CONFIG_LOGIG940_FF is not set
CONFIG_LOGIWHEELS_FF=y
CONFIG_HID_MICROSOFT=m
CONFIG_HID_MONTEREY=m
# CONFIG_HID_MULTITOUCH is not set
CONFIG_HID_NTRIG=m
# CONFIG_HID_ORTEK is not set
CONFIG_HID_PANTHERLORD=m
CONFIG_PANTHERLORD_FF=y
CONFIG_HID_PETALYNX=m
# CONFIG_HID_PICOLCD is not set
# CONFIG_HID_PRIMAX is not set
# CONFIG_HID_ROCCAT is not set
# CONFIG_HID_SAITEK is not set
CONFIG_HID_SAMSUNG=m
CONFIG_HID_SONY=m
# CONFIG_HID_SPEEDLINK is not set
CONFIG_HID_SUNPLUS=m
CONFIG_HID_GREENASIA=m
CONFIG_GREENASIA_FF=y
CONFIG_HID_SMARTJOYPLUS=m
CONFIG_SMARTJOYPLUS_FF=y
# CONFIG_HID_TIVO is not set
CONFIG_HID_TOPSEED=m
CONFIG_HID_THRUSTMASTER=m
CONFIG_THRUSTMASTER_FF=y
CONFIG_HID_ZEROPLUS=m
CONFIG_ZEROPLUS_FF=y
# CONFIG_HID_ZYDACRON is not set

#
# USB HID support
#
CONFIG_USB_HID=y
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB_ARCH_HAS_XHCI=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_SUSPEND=y
# CONFIG_USB_OTG is not set
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_MON=m
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=m
CONFIG_USB_XHCI_HCD=m
# CONFIG_USB_XHCI_HCD_DEBUGGING is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_OXU210HP_HCD=m
CONFIG_USB_ISP116X_HCD=m
# CONFIG_USB_ISP1760_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
CONFIG_USB_OHCI_HCD=y
# CONFIG_USB_OHCI_HCD_PLATFORM is not set
# CONFIG_USB_EHCI_HCD_PLATFORM is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_SL811_HCD=m
# CONFIG_USB_SL811_HCD_ISO is not set
# CONFIG_USB_SL811_CS is not set
CONFIG_USB_R8A66597_HCD=m
# CONFIG_USB_HCD_SSB is not set
# CONFIG_USB_CHIPIDEA is not set

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
# CONFIG_USB_WDM is not set
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=m
# CONFIG_USB_STORAGE_DEBUG is not set
# CONFIG_USB_STORAGE_REALTEK is not set
CONFIG_USB_STORAGE_DATAFAB=m
CONFIG_USB_STORAGE_FREECOM=m
CONFIG_USB_STORAGE_ISD200=m
CONFIG_USB_STORAGE_USBAT=m
CONFIG_USB_STORAGE_SDDR09=m
CONFIG_USB_STORAGE_SDDR55=m
CONFIG_USB_STORAGE_JUMPSHOT=m
CONFIG_USB_STORAGE_ALAUDA=m
CONFIG_USB_STORAGE_ONETOUCH=m
CONFIG_USB_STORAGE_KARMA=m
CONFIG_USB_STORAGE_CYPRESS_ATACB=m
# CONFIG_USB_STORAGE_ENE_UB6250 is not set
# CONFIG_USB_UAS is not set
# CONFIG_USB_LIBUSUAL is not set

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set

#
# USB port drivers
#
# CONFIG_USB_USS720 is not set
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYPRESS_CY7C63 is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_FTDI_ELAN is not set
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_YUREX is not set

#
# USB Physical Layer drivers
#
# CONFIG_USB_ISP1301 is not set
# CONFIG_USB_ATM is not set
# CONFIG_USB_GADGET is not set

#
# OTG and related infrastructure
#
# CONFIG_USB_GPIO_VBUS is not set
# CONFIG_NOP_USB_XCEIV is not set
# CONFIG_UWB is not set
CONFIG_MMC=m
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set
# CONFIG_MMC_CLKGATE is not set

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=m
CONFIG_MMC_BLOCK_MINORS=8
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_SDIO_UART=m
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_SDHCI=m
CONFIG_MMC_SDHCI_PCI=m
# CONFIG_MMC_RICOH_MMC is not set
CONFIG_MMC_SDHCI_PLTFM=m
CONFIG_MMC_WBSD=m
CONFIG_MMC_TIFM_SD=m
CONFIG_MMC_SPI=m
# CONFIG_MMC_SDRICOH_CS is not set
CONFIG_MMC_CB710=m
CONFIG_MMC_VIA_SDMMC=m
# CONFIG_MMC_VUB300 is not set
# CONFIG_MMC_USHC is not set
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y

#
# LED drivers
#
# CONFIG_LEDS_LM3530 is not set
CONFIG_LEDS_PCA9532=m
# CONFIG_LEDS_PCA9532_GPIO is not set
# CONFIG_LEDS_GPIO is not set
CONFIG_LEDS_LP3944=m
# CONFIG_LEDS_LP5521 is not set
# CONFIG_LEDS_LP5523 is not set
CONFIG_LEDS_CLEVO_MAIL=m
CONFIG_LEDS_PCA955X=m
# CONFIG_LEDS_PCA9633 is not set
CONFIG_LEDS_DAC124S085=m
# CONFIG_LEDS_REGULATOR is not set
CONFIG_LEDS_BD2802=m
# CONFIG_LEDS_INTEL_SS4200 is not set
# CONFIG_LEDS_LT3593 is not set
# CONFIG_LEDS_TCA6507 is not set
# CONFIG_LEDS_LM3556 is not set
# CONFIG_LEDS_OT200 is not set
# CONFIG_LEDS_BLINKM is not set
CONFIG_LEDS_TRIGGERS=y

#
# LED Triggers
#
CONFIG_LEDS_TRIGGER_TIMER=m
# CONFIG_LEDS_TRIGGER_ONESHOT is not set
CONFIG_LEDS_TRIGGER_HEARTBEAT=m
CONFIG_LEDS_TRIGGER_BACKLIGHT=m
# CONFIG_LEDS_TRIGGER_GPIO is not set
CONFIG_LEDS_TRIGGER_DEFAULT_ON=m

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
# CONFIG_ACCESSIBILITY is not set
CONFIG_INFINIBAND=m
CONFIG_INFINIBAND_USER_MAD=m
CONFIG_INFINIBAND_USER_ACCESS=m
CONFIG_INFINIBAND_USER_MEM=y
CONFIG_INFINIBAND_ADDR_TRANS=y
CONFIG_INFINIBAND_MTHCA=m
CONFIG_INFINIBAND_MTHCA_DEBUG=y
CONFIG_INFINIBAND_IPATH=m
CONFIG_INFINIBAND_QIB=m
# CONFIG_INFINIBAND_AMSO1100 is not set
# CONFIG_INFINIBAND_CXGB3 is not set
CONFIG_MLX4_INFINIBAND=m
# CONFIG_INFINIBAND_NES is not set
# CONFIG_INFINIBAND_OCRDMA is not set
CONFIG_INFINIBAND_IPOIB=m
CONFIG_INFINIBAND_IPOIB_CM=y
CONFIG_INFINIBAND_IPOIB_DEBUG=y
# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
CONFIG_INFINIBAND_SRP=m
CONFIG_INFINIBAND_ISER=m
CONFIG_EDAC=y

#
# Reporting subsystems
#
CONFIG_EDAC_LEGACY_SYSFS=y
# CONFIG_EDAC_DEBUG is not set
CONFIG_EDAC_DECODE_MCE=m
# CONFIG_EDAC_MCE_INJ is not set
CONFIG_EDAC_MM_EDAC=m
CONFIG_EDAC_AMD64=m
# CONFIG_EDAC_AMD64_ERROR_INJECTION is not set
# CONFIG_EDAC_E752X is not set
# CONFIG_EDAC_I82975X is not set
# CONFIG_EDAC_I3000 is not set
# CONFIG_EDAC_I3200 is not set
# CONFIG_EDAC_X38 is not set
# CONFIG_EDAC_I5400 is not set
# CONFIG_EDAC_I7CORE is not set
# CONFIG_EDAC_I5000 is not set
# CONFIG_EDAC_I5100 is not set
# CONFIG_EDAC_I7300 is not set
# CONFIG_EDAC_SBRIDGE is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
CONFIG_RTC_DRV_DS1307=m
CONFIG_RTC_DRV_DS1374=m
CONFIG_RTC_DRV_DS1672=m
# CONFIG_RTC_DRV_DS3232 is not set
CONFIG_RTC_DRV_MAX6900=m
CONFIG_RTC_DRV_RS5C372=m
CONFIG_RTC_DRV_ISL1208=m
# CONFIG_RTC_DRV_ISL12022 is not set
CONFIG_RTC_DRV_X1205=m
CONFIG_RTC_DRV_PCF8563=m
CONFIG_RTC_DRV_PCF8583=m
CONFIG_RTC_DRV_M41T80=m
# CONFIG_RTC_DRV_M41T80_WDT is not set
# CONFIG_RTC_DRV_BQ32K is not set
CONFIG_RTC_DRV_S35390A=m
CONFIG_RTC_DRV_FM3130=m
CONFIG_RTC_DRV_RX8581=m
CONFIG_RTC_DRV_RX8025=m
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T93 is not set
CONFIG_RTC_DRV_M41T94=m
CONFIG_RTC_DRV_DS1305=m
CONFIG_RTC_DRV_DS1390=m
CONFIG_RTC_DRV_MAX6902=m
CONFIG_RTC_DRV_R9701=m
CONFIG_RTC_DRV_RS5C348=m
CONFIG_RTC_DRV_DS3234=m
CONFIG_RTC_DRV_PCF2123=m

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
CONFIG_RTC_DRV_DS1286=m
CONFIG_RTC_DRV_DS1511=m
CONFIG_RTC_DRV_DS1553=m
CONFIG_RTC_DRV_DS1742=m
CONFIG_RTC_DRV_STK17TA8=m
CONFIG_RTC_DRV_M48T86=m
CONFIG_RTC_DRV_M48T35=m
CONFIG_RTC_DRV_M48T59=m
# CONFIG_RTC_DRV_MSM6242 is not set
CONFIG_RTC_DRV_BQ4802=m
# CONFIG_RTC_DRV_RP5C01 is not set
CONFIG_RTC_DRV_V3020=m
CONFIG_RTC_DRV_PCF50633=m

#
# on-CPU RTC drivers
#
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
# CONFIG_INTEL_MID_DMAC is not set
CONFIG_INTEL_IOATDMA=m
# CONFIG_TIMB_DMA is not set
# CONFIG_PCH_DMA is not set
CONFIG_DMA_ENGINE=y

#
# DMA Clients
#
CONFIG_NET_DMA=y
CONFIG_ASYNC_TX_DMA=y
# CONFIG_DMATEST is not set
CONFIG_DCA=m
# CONFIG_AUXDISPLAY is not set
CONFIG_UIO=m
# CONFIG_UIO_CIF is not set
# CONFIG_UIO_PDRV is not set
# CONFIG_UIO_PDRV_GENIRQ is not set
# CONFIG_UIO_AEC is not set
# CONFIG_UIO_SERCOS3 is not set
# CONFIG_UIO_PCI_GENERIC is not set
# CONFIG_UIO_NETX is not set
# CONFIG_VFIO is not set
CONFIG_VIRTIO=m
CONFIG_VIRTIO_RING=m

#
# Virtio drivers
#
CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_MMIO=m
# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set

#
# Microsoft Hyper-V guest support
#
# CONFIG_HYPERV is not set
# CONFIG_STAGING is not set
# CONFIG_X86_PLATFORM_DEVICES is not set

#
# Hardware Spinlock drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y
CONFIG_IOMMU_API=y
CONFIG_IOMMU_SUPPORT=y
CONFIG_AMD_IOMMU=y
# CONFIG_AMD_IOMMU_STATS is not set
# CONFIG_AMD_IOMMU_V2 is not set
# CONFIG_INTEL_IOMMU is not set
# CONFIG_IRQ_REMAP is not set

#
# Remoteproc drivers (EXPERIMENTAL)
#

#
# Rpmsg drivers (EXPERIMENTAL)
#
# CONFIG_VIRT_DRIVERS is not set
# CONFIG_PM_DEVFREQ is not set
# CONFIG_EXTCON is not set
# CONFIG_MEMORY is not set
# CONFIG_IIO is not set
# CONFIG_VME_BUS is not set
# CONFIG_PWM is not set

#
# Firmware Drivers
#
CONFIG_EDD=m
# CONFIG_EDD_OFF is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_EFI_VARS=m
CONFIG_DELL_RBU=m
CONFIG_DCDBAS=m
CONFIG_DMIID=y
# CONFIG_DMI_SYSFS is not set
CONFIG_ISCSI_IBFT_FIND=y
CONFIG_ISCSI_IBFT=m
# CONFIG_GOOGLE_FIRMWARE is not set

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
CONFIG_EXT2_FS=m
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=m
CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=m
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD=m
# CONFIG_JBD_DEBUG is not set
CONFIG_JBD2=m
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=m
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
CONFIG_XFS_FS=y
# CONFIG_XFS_QUOTA is not set
# CONFIG_XFS_POSIX_ACL is not set
# CONFIG_XFS_RT is not set
# CONFIG_XFS_DEBUG is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set
# CONFIG_NILFS2_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_FANOTIFY is not set
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=m
CONFIG_QFMT_V1=m
CONFIG_QFMT_V2=m
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y
CONFIG_AUTOFS4_FS=m
CONFIG_FUSE_FS=m
CONFIG_CUSE=m
CONFIG_GENERIC_ACL=y

#
# Caches
#
CONFIG_FSCACHE=m
CONFIG_FSCACHE_STATS=y
# CONFIG_FSCACHE_HISTOGRAM is not set
# CONFIG_FSCACHE_DEBUG is not set
# CONFIG_FSCACHE_OBJECT_LIST is not set
CONFIG_CACHEFILES=m
# CONFIG_CACHEFILES_DEBUG is not set
# CONFIG_CACHEFILES_HISTOGRAM is not set

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y

#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_CONFIGFS_FS=y
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
CONFIG_ECRYPT_FS=m
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_LOGFS is not set
# CONFIG_CRAMFS is not set
CONFIG_SQUASHFS=m
# CONFIG_SQUASHFS_XATTR is not set
CONFIG_SQUASHFS_ZLIB=y
# CONFIG_SQUASHFS_LZO is not set
# CONFIG_SQUASHFS_XZ is not set
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
CONFIG_MINIX_FS=m
CONFIG_OMFS_FS=m
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX6FS_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_PSTORE is not set
CONFIG_SYSV_FS=m
CONFIG_UFS_FS=m
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_UFS_DEBUG is not set
CONFIG_EXOFS_FS=m
# CONFIG_EXOFS_DEBUG is not set
CONFIG_ORE=m
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=m
CONFIG_NFS_V2=m
CONFIG_NFS_V3=m
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=m
# CONFIG_NFS_SWAP is not set
# CONFIG_NFS_V4_1 is not set
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
CONFIG_NFSD=m
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
# CONFIG_NFSD_FAULT_INJECTION is not set
CONFIG_LOCKD=m
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=m
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=m
CONFIG_SUNRPC_GSS=m
CONFIG_SUNRPC_XPRT_RDMA=m
CONFIG_RPCSEC_GSS_KRB5=m
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_CEPH_FS is not set
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
CONFIG_CIFS_WEAK_PW_HASH=y
CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_DEBUG2 is not set
CONFIG_CIFS_DFS_UPCALL=y
# CONFIG_CIFS_FSCACHE is not set
# CONFIG_CIFS_ACL is not set
# CONFIG_NCP_FS is not set
CONFIG_CODA_FS=m
CONFIG_AFS_FS=m
# CONFIG_AFS_DEBUG is not set
CONFIG_AFS_FSCACHE=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=m
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
CONFIG_NLS_ASCII=m
CONFIG_NLS_ISO8859_1=m
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
CONFIG_NLS_ISO8859_15=m
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_MAC_ROMAN is not set
# CONFIG_NLS_MAC_CELTIC is not set
# CONFIG_NLS_MAC_CENTEURO is not set
# CONFIG_NLS_MAC_CROATIAN is not set
# CONFIG_NLS_MAC_CYRILLIC is not set
# CONFIG_NLS_MAC_GAELIC is not set
# CONFIG_NLS_MAC_GREEK is not set
# CONFIG_NLS_MAC_ICELAND is not set
# CONFIG_NLS_MAC_INUIT is not set
# CONFIG_NLS_MAC_ROMANIAN is not set
# CONFIG_NLS_MAC_TURKISH is not set
CONFIG_NLS_UTF8=m
CONFIG_DLM=y
CONFIG_DLM_DEBUG=y

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_PRINTK_TIME=y
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
CONFIG_STRIP_ASM_SYMS=y
# CONFIG_READABLE_ASM is not set
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
# CONFIG_LOCKUP_DETECTOR is not set
# CONFIG_HARDLOCKUP_DETECTOR is not set
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
# CONFIG_DETECT_HUNG_TASK is not set
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_OBJECTS is not set
CONFIG_DEBUG_SLAB=y
CONFIG_DEBUG_SLAB_LEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
# CONFIG_SPARSE_RCU_POINTER is not set
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_ATOMIC_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_INFO_REDUCED is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_VIRTUAL is not set
# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
# CONFIG_FRAME_POINTER is not set
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_RCU_TORTURE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=60
# CONFIG_RCU_CPU_STALL_INFO is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_KPROBES_SANITY_TEST is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_DEBUG_PER_CPU_MAPS is not set
# CONFIG_LKDTM is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_EVENT_POWER_TRACING_DEPRECATED=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_FTRACE_SYSCALLS is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
# CONFIG_PROFILE_ALL_BRANCHES is not set
# CONFIG_STACK_TRACER is not set
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_KPROBE_EVENT=y
# CONFIG_UPROBE_EVENT is not set
CONFIG_PROBE_EVENTS=y
# CONFIG_FTRACE_STARTUP_TEST is not set
# CONFIG_MMIOTRACE is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
# CONFIG_DYNAMIC_DEBUG is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_ASYNC_RAID6_TEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
# CONFIG_KMEMCHECK is not set
# CONFIG_TEST_KSTRTOX is not set
CONFIG_STRICT_DEVMEM=y
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
# CONFIG_EARLY_PRINTK_DBGP is not set
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_X86_PTDUMP is not set
CONFIG_DEBUG_RODATA=y
CONFIG_DEBUG_RODATA_TEST=y
# CONFIG_DEBUG_SET_MODULE_RONX is not set
# CONFIG_DEBUG_NX_TEST is not set
# CONFIG_DEBUG_TLBFLUSH is not set
# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=0
# CONFIG_DEBUG_BOOT_PARAMS is not set
# CONFIG_CPA_DEBUG is not set
CONFIG_OPTIMIZE_INLINING=y
# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
# CONFIG_DEBUG_NMI_SELFTEST is not set

#
# Security options
#
CONFIG_KEYS=y
# CONFIG_TRUSTED_KEYS is not set
# CONFIG_ENCRYPTED_KEYS is not set
CONFIG_KEYS_DEBUG_PROC_KEYS=y
# CONFIG_SECURITY_DMESG_RESTRICT is not set
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_NETWORK_XFRM=y
CONFIG_SECURITY_PATH=y
CONFIG_LSM_MMAP_MIN_ADDR=65536
CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
CONFIG_SECURITY_SELINUX_DISABLE=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
CONFIG_SECURITY_TOMOYO=y
CONFIG_SECURITY_TOMOYO_MAX_ACCEPT_ENTRY=2048
CONFIG_SECURITY_TOMOYO_MAX_AUDIT_LOG=1024
# CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER is not set
CONFIG_SECURITY_TOMOYO_POLICY_LOADER="/sbin/tomoyo-init"
CONFIG_SECURITY_TOMOYO_ACTIVATION_TRIGGER="/sbin/init"
# CONFIG_SECURITY_APPARMOR is not set
# CONFIG_SECURITY_YAMA is not set
# CONFIG_IMA is not set
# CONFIG_EVM is not set
CONFIG_DEFAULT_SECURITY_SELINUX=y
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_DEFAULT_SECURITY="selinux"
CONFIG_XOR_BLOCKS=m
CONFIG_ASYNC_CORE=m
CONFIG_ASYNC_MEMCPY=m
CONFIG_ASYNC_XOR=m
CONFIG_ASYNC_PQ=m
CONFIG_ASYNC_RAID6_RECOV=m
CONFIG_ASYNC_TX_DISABLE_PQ_VAL_DMA=y
CONFIG_ASYNC_TX_DISABLE_XOR_VAL_DMA=y
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=m
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=m
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_USER is not set
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
# CONFIG_CRYPTO_PCRYPT is not set
CONFIG_CRYPTO_WORKQUEUE=y
# CONFIG_CRYPTO_CRYPTD is not set
CONFIG_CRYPTO_AUTHENC=m
CONFIG_CRYPTO_TEST=m

#
# Authenticated Encryption with Associated Data
#
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_GCM=m
CONFIG_CRYPTO_SEQIV=m

#
# Block modes
#
CONFIG_CRYPTO_CBC=m
CONFIG_CRYPTO_CTR=m
CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_XTS=m

#
# Hash modes
#
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_XCBC=m
CONFIG_CRYPTO_VMAC=m

#
# Digest
#
CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_CRC32C_INTEL=m
CONFIG_CRYPTO_GHASH=m
CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_RMD128=m
CONFIG_CRYPTO_RMD160=m
CONFIG_CRYPTO_RMD256=m
CONFIG_CRYPTO_RMD320=m
CONFIG_CRYPTO_SHA1=y
# CONFIG_CRYPTO_SHA1_SSSE3 is not set
CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_TGR192=m
CONFIG_CRYPTO_WP512=m
# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set

#
# Ciphers
#
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_AES_X86_64=m
# CONFIG_CRYPTO_AES_NI_INTEL is not set
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_BLOWFISH_COMMON=m
# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
CONFIG_CRYPTO_CAMELLIA=m
# CONFIG_CRYPTO_CAMELLIA_X86_64 is not set
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_DES=m
CONFIG_CRYPTO_FCRYPT=m
CONFIG_CRYPTO_KHAZAD=m
CONFIG_CRYPTO_SALSA20=m
CONFIG_CRYPTO_SALSA20_X86_64=m
CONFIG_CRYPTO_SEED=m
CONFIG_CRYPTO_SERPENT=m
# CONFIG_CRYPTO_SERPENT_SSE2_X86_64 is not set
# CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set
CONFIG_CRYPTO_TEA=m
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_TWOFISH_COMMON=m
CONFIG_CRYPTO_TWOFISH_X86_64=m
# CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set
# CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_ZLIB=m
CONFIG_CRYPTO_LZO=m

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
# CONFIG_CRYPTO_USER_API_HASH is not set
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_PADLOCK is not set
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_APIC_ARCHITECTURE=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
# CONFIG_KVM_MMU_AUDIT is not set
CONFIG_VHOST_NET=m
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_RAID6_PQ=m
CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_IO=y
CONFIG_CRC_CCITT=m
CONFIG_CRC16=m
CONFIG_CRC_T10DIF=m
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
CONFIG_CRC7=m
CONFIG_LIBCRC32C=y
# CONFIG_CRC8 is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_IA64=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_TEXTSEARCH=y
CONFIG_TEXTSEARCH_KMP=m
CONFIG_TEXTSEARCH_BM=m
CONFIG_TEXTSEARCH_FSM=m
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_CHECK_SIGNATURE=y
CONFIG_CPU_RMAP=y
CONFIG_DQL=y
CONFIG_NLATTR=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_LRU_CACHE=m
# CONFIG_AVERAGE is not set
# CONFIG_CORDIC is not set
# CONFIG_DDR is not set

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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-27 10:06   ` Wen Congyang
@ 2012-09-27 11:02     ` Vasilis Liaskovitis
  0 siblings, 0 replies; 62+ messages in thread
From: Vasilis Liaskovitis @ 2012-09-27 11:02 UTC (permalink / raw)
  To: Wen Congyang
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

On Thu, Sep 27, 2012 at 06:06:30PM +0800, Wen Congyang wrote:
> Please try the following patch:
> From a38ec678e0a9b48b252f457d7910b7527049dc43 Mon Sep 17 00:00:00 2001
> From: Wen Congyang <wency@cn.fujitsu.com>
> Date: Thu, 27 Sep 2012 17:27:57 +0800
> Subject: [PATCH] clear the memory to store page information

this solves the hot re-add problem for me.
thanks for the quick solution.

- Vasilis

> 
> ---
>  mm/sparse.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/sparse.c b/mm/sparse.c
> index ab9d755..36dda08 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -639,7 +639,6 @@ static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
>  got_map_page:
>  	ret = (struct page *)pfn_to_kaddr(page_to_pfn(page));
>  got_map_ptr:
> -	memset(ret, 0, memmap_size);
>  
>  	return ret;
>  }
> @@ -761,6 +760,8 @@ int __meminit sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
>  		goto out;
>  	}
>  
> +	memset(memmap, 0, sizeof(struct page) * nr_pages);
> +
>  	ms->section_mem_map |= SECTION_MARKED_PRESENT;
>  
>  	ret = sparse_init_one_section(ms, section_nr, memmap, usemap);
> -- 
> 1.7.1
> 
> Thanks
> Wen Congyang
> 
> > 
> > thanks,
> > 
> > - Vasilis
> > 
> > [1] https://lkml.org/lkml/2012/9/6/635
> > [2] https://lkml.org/lkml/2012/9/11/542
> > [3] https://lkml.org/lkml/2012/9/20/37
> > [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> > 
> > 
> > 
> 

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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-27 10:35     ` Vasilis Liaskovitis
@ 2012-09-28  1:41       ` Wen Congyang
  0 siblings, 0 replies; 62+ messages in thread
From: Wen Congyang @ 2012-09-28  1:41 UTC (permalink / raw)
  To: Vasilis Liaskovitis
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

At 09/27/2012 06:35 PM, Vasilis Liaskovitis Wrote:
> On Thu, Sep 27, 2012 at 02:37:14PM +0800, Wen Congyang wrote:
>> Hi Vasilis Liaskovitis
>>
>> At 09/27/2012 12:46 AM, Vasilis Liaskovitis Wrote:
>>> Hi,
>>>
>>> I am testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
>>> Running in a guest (qemu+seabios from [4]). 
>>> CONFIG_SLAB=y
>>> CONFIG_DEBUG_SLAB=y
>>>
>>> After succesfull hot-add and online, I am doing a hot-remove with "echo 1 > /sys/bus/acpi/devices/PNP/eject"
>>> When I do the OSPM-eject, I often get slab corruption in "acpi-state" cache, or in other caches
>>
>> I can't reproduce this problem. Can you provide the following information:
>> 1. config file
>> 2. qemu's command line
>>
>> You said you did OSPM-eject. Do you mean write 1 to /sys/bus/acpi/devices/PNP0C80:XX/eject?
> yes.
> 
> example qemu command line with one dimm:
> 
> "/opt/qemu-kvm-memhp/bin/qemu-system-x86_64 -bios
> /opt/extra/vliaskov/devel/seabios-upstream/out/bios.bin -enable-kvm -M pc -smp
> 4,maxcpus=8 -cpu host -m 2048 -drive file=/opt/extra/debian-template.raw,if=none,id=drive-virtio-disk0,format=raw
> -device virtio-blk-pci,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
> -vga cirrus -netdev type=tap,id=guest0,vhost=on -device virtio-net-pci,netdev=guest0
> -monitor unix:/tmp/qemu.monitor11,server,nowait -chardev stdio,id=seabios  -device
> isa-debugcon,iobase=0x402,chardev=seabios
> -dimm id=n0,size=512M,node=0"
> 
> or last line with 2 numa nodes:
> "-dimm id=n0,size=512M,node=0 -dimm id=n1,size=512M,node=1 -numa node,nodeid=0 -numa node,nodeid=1"

I have reproduced this problem. It only can be reproduced when the dimm's memory is on node 0.
I investigate it now.

Thanks
Wen Congyang

> 
> attached config. Tree is at:
> https://github.com/vliaskov/linux/commits/memhp-fujitsu
> 
> thanks,
> - Vasilis


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

* Re: [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages()
  2012-09-05  9:25 ` [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages() wency
@ 2012-09-28  2:22   ` Ni zhan Chen
  2012-09-28  3:50     ` Yasuaki Ishimatsu
  0 siblings, 1 reply; 62+ messages in thread
From: Ni zhan Chen @ 2012-09-28  2:22 UTC (permalink / raw)
  To: wency
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>
> remove_memory() only try to offline pages. It is called in two cases:
> 1. hot remove a memory device
> 2. echo offline >/sys/devices/system/memory/memoryXX/state
>
> In the 1st case, we should also change memory block's state, and notify
> the userspace that the memory block's state is changed after offlining
> pages.
>
> So rename remove_memory() to offline_memory()/offline_pages(). And in
> the 1st case, offline_memory() will be used. The function offline_memory()
> is not implemented. In the 2nd case, offline_pages() will be used.

But this time there is not a function associated with add_memory.

>
> CC: David Rientjes <rientjes@google.com>
> CC: Jiang Liu <liuj97@gmail.com>
> CC: Len Brown <len.brown@intel.com>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Christoph Lameter <cl@linux.com>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
>   drivers/acpi/acpi_memhotplug.c |    2 +-
>   drivers/base/memory.c          |    9 +++------
>   include/linux/memory_hotplug.h |    3 ++-
>   mm/memory_hotplug.c            |   22 ++++++++++++++--------
>   4 files changed, 20 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
> index 24c807f..2a7beac 100644
> --- a/drivers/acpi/acpi_memhotplug.c
> +++ b/drivers/acpi/acpi_memhotplug.c
> @@ -318,7 +318,7 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
>   	 */
>   	list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
>   		if (info->enabled) {
> -			result = remove_memory(info->start_addr, info->length);
> +			result = offline_memory(info->start_addr, info->length);
>   			if (result)
>   				return result;
>   		}
> diff --git a/drivers/base/memory.c b/drivers/base/memory.c
> index 7dda4f7..44e7de6 100644
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -248,26 +248,23 @@ static bool pages_correctly_reserved(unsigned long start_pfn,
>   static int
>   memory_block_action(unsigned long phys_index, unsigned long action)
>   {
> -	unsigned long start_pfn, start_paddr;
> +	unsigned long start_pfn;
>   	unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block;
>   	struct page *first_page;
>   	int ret;
>   
>   	first_page = pfn_to_page(phys_index << PFN_SECTION_SHIFT);
> +	start_pfn = page_to_pfn(first_page);
>   
>   	switch (action) {
>   		case MEM_ONLINE:
> -			start_pfn = page_to_pfn(first_page);
> -
>   			if (!pages_correctly_reserved(start_pfn, nr_pages))
>   				return -EBUSY;
>   
>   			ret = online_pages(start_pfn, nr_pages);
>   			break;
>   		case MEM_OFFLINE:
> -			start_paddr = page_to_pfn(first_page) << PAGE_SHIFT;
> -			ret = remove_memory(start_paddr,
> -					    nr_pages << PAGE_SHIFT);
> +			ret = offline_pages(start_pfn, nr_pages);
>   			break;
>   		default:
>   			WARN(1, KERN_WARNING "%s(%ld, %ld) unknown action: "
> diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
> index 910550f..c183f39 100644
> --- a/include/linux/memory_hotplug.h
> +++ b/include/linux/memory_hotplug.h
> @@ -233,7 +233,8 @@ static inline int is_mem_section_removable(unsigned long pfn,
>   extern int mem_online_node(int nid);
>   extern int add_memory(int nid, u64 start, u64 size);
>   extern int arch_add_memory(int nid, u64 start, u64 size);
> -extern int remove_memory(u64 start, u64 size);
> +extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
> +extern int offline_memory(u64 start, u64 size);
>   extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
>   								int nr_pages);
>   extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms);
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 3ad25f9..bb42316 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -866,7 +866,7 @@ check_pages_isolated(unsigned long start_pfn, unsigned long end_pfn)
>   	return offlined;
>   }
>   
> -static int __ref offline_pages(unsigned long start_pfn,
> +static int __ref __offline_pages(unsigned long start_pfn,
>   		  unsigned long end_pfn, unsigned long timeout)
>   {
>   	unsigned long pfn, nr_pages, expire;
> @@ -994,18 +994,24 @@ out:
>   	return ret;
>   }
>   
> -int remove_memory(u64 start, u64 size)
> +int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
>   {
> -	unsigned long start_pfn, end_pfn;
> +	return __offline_pages(start_pfn, start_pfn + nr_pages, 120 * HZ);
> +}
>   
> -	start_pfn = PFN_DOWN(start);
> -	end_pfn = start_pfn + PFN_DOWN(size);
> -	return offline_pages(start_pfn, end_pfn, 120 * HZ);
> +int offline_memory(u64 start, u64 size)
> +{
> +	return -EINVAL;
>   }
>   #else
> -int remove_memory(u64 start, u64 size)
> +int offline_pages(unsigned long start, unsigned long size)
> +{
> +	return -EINVAL;
> +}
> +
> +int offline_memory(u64 start, u64 size)
>   {
>   	return -EINVAL;
>   }
>   #endif /* CONFIG_MEMORY_HOTREMOVE */
> -EXPORT_SYMBOL_GPL(remove_memory);
> +EXPORT_SYMBOL_GPL(offline_memory);


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

* Re: [RFC v9 PATCH 03/21] memory-hotplug: store the node id in acpi_memory_device
  2012-09-05  9:25 ` [RFC v9 PATCH 03/21] memory-hotplug: store the node id in acpi_memory_device wency
@ 2012-09-28  3:21   ` Ni zhan Chen
  2012-10-01  7:38     ` Yasuaki Ishimatsu
  0 siblings, 1 reply; 62+ messages in thread
From: Ni zhan Chen @ 2012-09-28  3:21 UTC (permalink / raw)
  To: wency
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
> From: Wen Congyang <wency@cn.fujitsu.com>
>
> The memory device has only one node id. Store the node id when
> enable the memory device, and we can reuse it when removing the
> memory device.

one question:
if use numa emulation, memory device will associated to one node or ...?

>
> CC: David Rientjes <rientjes@google.com>
> CC: Jiang Liu <liuj97@gmail.com>
> CC: Len Brown <len.brown@intel.com>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Christoph Lameter <cl@linux.com>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> ---
>   drivers/acpi/acpi_memhotplug.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
> index 2a7beac..7873832 100644
> --- a/drivers/acpi/acpi_memhotplug.c
> +++ b/drivers/acpi/acpi_memhotplug.c
> @@ -83,6 +83,7 @@ struct acpi_memory_info {
>   struct acpi_memory_device {
>   	struct acpi_device * device;
>   	unsigned int state;	/* State of the memory device */
> +	int nid;
>   	struct list_head res_list;
>   };
>   
> @@ -256,6 +257,9 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
>   		info->enabled = 1;
>   		num_enabled++;
>   	}
> +
> +	mem_device->nid = node;
> +
>   	if (!num_enabled) {
>   		printk(KERN_ERR PREFIX "add_memory failed\n");
>   		mem_device->state = MEMORY_INVALID_STATE;


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

* Re: [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not
  2012-09-11  2:24     ` Yasuaki Ishimatsu
  2012-09-11  2:46       ` Wen Congyang
@ 2012-09-28  3:37       ` Ni zhan Chen
  1 sibling, 0 replies; 62+ messages in thread
From: Ni zhan Chen @ 2012-09-28  3:37 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: Wen Congyang, x86, linux-mm, linux-kernel, linuxppc-dev,
	linux-acpi, linux-s390, linux-sh, linux-ia64, cmetcalf,
	sparclinux, rientjes, liuj97, len.brown, benh, paulus, cl,
	minchan.kim, akpm, kosaki.motohiro

On 09/11/2012 10:24 AM, Yasuaki Ishimatsu wrote:
> Hi Wen,
>
> 2012/09/11 11:15, Wen Congyang wrote:
>> Hi, ishimatsu
>>
>> At 09/05/2012 05:25 PM, wency@cn.fujitsu.com Wrote:
>>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>>
>>> If system supports memory hot-remove, online_pages() may online 
>>> removed pages.
>>> So online_pages() need to check whether onlining pages are present 
>>> or not.
>>
>> Because we use memory_block_change_state() to hotremoving memory, I 
>> think
>> this patch can be removed. What do you think?
>
> Pleae teach me detals a little more. If we use 
> memory_block_change_state(),
> does the conflict never occur? Why?

since memory hot-add or hot-remove is based on memblock, if check in 
memory_block_change_state()
can guarantee conflict never occur?

>
> Thansk,
> Yasuaki Ishimatsu
>
>> Thanks
>> Wen Congyang
>>
>>>
>>> CC: David Rientjes <rientjes@google.com>
>>> CC: Jiang Liu <liuj97@gmail.com>
>>> CC: Len Brown <len.brown@intel.com>
>>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> CC: Paul Mackerras <paulus@samba.org>
>>> CC: Christoph Lameter <cl@linux.com>
>>> Cc: Minchan Kim <minchan.kim@gmail.com>
>>> CC: Andrew Morton <akpm@linux-foundation.org>
>>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>> CC: Wen Congyang <wency@cn.fujitsu.com>
>>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>> ---
>>>   include/linux/mmzone.h |   19 +++++++++++++++++++
>>>   mm/memory_hotplug.c    |   13 +++++++++++++
>>>   2 files changed, 32 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
>>> index 2daa54f..ac3ae30 100644
>>> --- a/include/linux/mmzone.h
>>> +++ b/include/linux/mmzone.h
>>> @@ -1180,6 +1180,25 @@ void sparse_init(void);
>>>   #define sparse_index_init(_sec, _nid)  do {} while (0)
>>>   #endif /* CONFIG_SPARSEMEM */
>>>
>>> +#ifdef CONFIG_SPARSEMEM
>>> +static inline int pfns_present(unsigned long pfn, unsigned long 
>>> nr_pages)
>>> +{
>>> +    int i;
>>> +    for (i = 0; i < nr_pages; i++) {
>>> +        if (pfn_present(pfn + i))
>>> +            continue;
>>> +        else
>>> +            return -EINVAL;
>>> +    }
>>> +    return 0;
>>> +}
>>> +#else
>>> +static inline int pfns_present(unsigned long pfn, unsigned long 
>>> nr_pages)
>>> +{
>>> +    return 0;
>>> +}
>>> +#endif /* CONFIG_SPARSEMEM*/
>>> +
>>>   #ifdef CONFIG_NODES_SPAN_OTHER_NODES
>>>   bool early_pfn_in_nid(unsigned long pfn, int nid);
>>>   #else
>>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>>> index 49f7747..299747d 100644
>>> --- a/mm/memory_hotplug.c
>>> +++ b/mm/memory_hotplug.c
>>> @@ -467,6 +467,19 @@ int __ref online_pages(unsigned long pfn, 
>>> unsigned long nr_pages)
>>>       struct memory_notify arg;
>>>
>>>       lock_memory_hotplug();
>>> +    /*
>>> +     * If system supports memory hot-remove, the memory may have been
>>> +     * removed. So we check whether the memory has been removed or 
>>> not.
>>> +     *
>>> +     * Note: When CONFIG_SPARSEMEM is defined, pfns_present() become
>>> +     *       effective. If CONFIG_SPARSEMEM is not defined, 
>>> pfns_present()
>>> +     *       always returns 0.
>>> +     */
>>> +    ret = pfns_present(pfn, nr_pages);
>>> +    if (ret) {
>>> +        unlock_memory_hotplug();
>>> +        return ret;
>>> +    }
>>>       arg.start_pfn = pfn;
>>>       arg.nr_pages = nr_pages;
>>>       arg.status_change_nid = -1;
>>
>
>
> -- 
> 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>
>


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

* Re: [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages()
  2012-09-28  2:22   ` Ni zhan Chen
@ 2012-09-28  3:50     ` Yasuaki Ishimatsu
  2012-09-28 22:15       ` KOSAKI Motohiro
  0 siblings, 1 reply; 62+ messages in thread
From: Yasuaki Ishimatsu @ 2012-09-28  3:50 UTC (permalink / raw)
  To: Ni zhan Chen
  Cc: wency, x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro

Hi Chen,

2012/09/28 11:22, Ni zhan Chen wrote:
> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>
>> remove_memory() only try to offline pages. It is called in two cases:
>> 1. hot remove a memory device
>> 2. echo offline >/sys/devices/system/memory/memoryXX/state
>>
>> In the 1st case, we should also change memory block's state, and notify
>> the userspace that the memory block's state is changed after offlining
>> pages.
>>
>> So rename remove_memory() to offline_memory()/offline_pages(). And in
>> the 1st case, offline_memory() will be used. The function offline_memory()
>> is not implemented. In the 2nd case, offline_pages() will be used.
>
> But this time there is not a function associated with add_memory.

To associate with add_memory() later, we renamed it.

Thanks,
Yasuaki Ishimatsu

>
>>
>> CC: David Rientjes <rientjes@google.com>
>> CC: Jiang Liu <liuj97@gmail.com>
>> CC: Len Brown <len.brown@intel.com>
>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> CC: Paul Mackerras <paulus@samba.org>
>> CC: Christoph Lameter <cl@linux.com>
>> Cc: Minchan Kim <minchan.kim@gmail.com>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>> ---
>>   drivers/acpi/acpi_memhotplug.c |    2 +-
>>   drivers/base/memory.c          |    9 +++------
>>   include/linux/memory_hotplug.h |    3 ++-
>>   mm/memory_hotplug.c            |   22 ++++++++++++++--------
>>   4 files changed, 20 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
>> index 24c807f..2a7beac 100644
>> --- a/drivers/acpi/acpi_memhotplug.c
>> +++ b/drivers/acpi/acpi_memhotplug.c
>> @@ -318,7 +318,7 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
>>        */
>>       list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
>>           if (info->enabled) {
>> -            result = remove_memory(info->start_addr, info->length);
>> +            result = offline_memory(info->start_addr, info->length);
>>               if (result)
>>                   return result;
>>           }
>> diff --git a/drivers/base/memory.c b/drivers/base/memory.c
>> index 7dda4f7..44e7de6 100644
>> --- a/drivers/base/memory.c
>> +++ b/drivers/base/memory.c
>> @@ -248,26 +248,23 @@ static bool pages_correctly_reserved(unsigned long start_pfn,
>>   static int
>>   memory_block_action(unsigned long phys_index, unsigned long action)
>>   {
>> -    unsigned long start_pfn, start_paddr;
>> +    unsigned long start_pfn;
>>       unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block;
>>       struct page *first_page;
>>       int ret;
>>       first_page = pfn_to_page(phys_index << PFN_SECTION_SHIFT);
>> +    start_pfn = page_to_pfn(first_page);
>>       switch (action) {
>>           case MEM_ONLINE:
>> -            start_pfn = page_to_pfn(first_page);
>> -
>>               if (!pages_correctly_reserved(start_pfn, nr_pages))
>>                   return -EBUSY;
>>               ret = online_pages(start_pfn, nr_pages);
>>               break;
>>           case MEM_OFFLINE:
>> -            start_paddr = page_to_pfn(first_page) << PAGE_SHIFT;
>> -            ret = remove_memory(start_paddr,
>> -                        nr_pages << PAGE_SHIFT);
>> +            ret = offline_pages(start_pfn, nr_pages);
>>               break;
>>           default:
>>               WARN(1, KERN_WARNING "%s(%ld, %ld) unknown action: "
>> diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
>> index 910550f..c183f39 100644
>> --- a/include/linux/memory_hotplug.h
>> +++ b/include/linux/memory_hotplug.h
>> @@ -233,7 +233,8 @@ static inline int is_mem_section_removable(unsigned long pfn,
>>   extern int mem_online_node(int nid);
>>   extern int add_memory(int nid, u64 start, u64 size);
>>   extern int arch_add_memory(int nid, u64 start, u64 size);
>> -extern int remove_memory(u64 start, u64 size);
>> +extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
>> +extern int offline_memory(u64 start, u64 size);
>>   extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
>>                                   int nr_pages);
>>   extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms);
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index 3ad25f9..bb42316 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -866,7 +866,7 @@ check_pages_isolated(unsigned long start_pfn, unsigned long end_pfn)
>>       return offlined;
>>   }
>> -static int __ref offline_pages(unsigned long start_pfn,
>> +static int __ref __offline_pages(unsigned long start_pfn,
>>             unsigned long end_pfn, unsigned long timeout)
>>   {
>>       unsigned long pfn, nr_pages, expire;
>> @@ -994,18 +994,24 @@ out:
>>       return ret;
>>   }
>> -int remove_memory(u64 start, u64 size)
>> +int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
>>   {
>> -    unsigned long start_pfn, end_pfn;
>> +    return __offline_pages(start_pfn, start_pfn + nr_pages, 120 * HZ);
>> +}
>> -    start_pfn = PFN_DOWN(start);
>> -    end_pfn = start_pfn + PFN_DOWN(size);
>> -    return offline_pages(start_pfn, end_pfn, 120 * HZ);
>> +int offline_memory(u64 start, u64 size)
>> +{
>> +    return -EINVAL;
>>   }
>>   #else
>> -int remove_memory(u64 start, u64 size)
>> +int offline_pages(unsigned long start, unsigned long size)
>> +{
>> +    return -EINVAL;
>> +}
>> +
>> +int offline_memory(u64 start, u64 size)
>>   {
>>       return -EINVAL;
>>   }
>>   #endif /* CONFIG_MEMORY_HOTREMOVE */
>> -EXPORT_SYMBOL_GPL(remove_memory);
>> +EXPORT_SYMBOL_GPL(offline_memory);
>



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

* Re: [RFC v9 PATCH 04/21] memory-hotplug: offline and remove memory when removing the memory device
  2012-09-05  9:25 ` [RFC v9 PATCH 04/21] memory-hotplug: offline and remove memory when removing the memory device wency
@ 2012-09-28  4:48   ` Ni zhan Chen
  0 siblings, 0 replies; 62+ messages in thread
From: Ni zhan Chen @ 2012-09-28  4:48 UTC (permalink / raw)
  To: wency
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>
> We should offline and remove memory when removing the memory device.
> The memory device can be removed by 2 ways:
> 1. send eject request by SCI
> 2. echo 1 >/sys/bus/pci/devices/PNP0C80:XX/eject
>
> In the 1st case, acpi_memory_disable_device() will be called. In the 2nd
> case, acpi_memory_device_remove() will be called. acpi_memory_device_remove()
> will also be called when we unbind the memory device from the driver
> acpi_memhotplug. If the type is ACPI_BUS_REMOVAL_EJECT, it means
> that the user wants to eject the memory device, and we should offline
> and remove memory in acpi_memory_device_remove().
>
> The function remove_memory() is not implemeted now. It only check whether
> all memory has been offllined now.
>
> CC: David Rientjes <rientjes@google.com>
> CC: Jiang Liu <liuj97@gmail.com>
> CC: Len Brown <len.brown@intel.com>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Christoph Lameter <cl@linux.com>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
>   drivers/acpi/acpi_memhotplug.c |   45 +++++++++++++++++++++++++++++++++------
>   drivers/base/memory.c          |   39 ++++++++++++++++++++++++++++++++++
>   include/linux/memory.h         |    5 ++++
>   include/linux/memory_hotplug.h |    5 ++++
>   mm/memory_hotplug.c            |   22 +++++++++++++++++++
>   5 files changed, 109 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
> index 7873832..9d47458 100644
> --- a/drivers/acpi/acpi_memhotplug.c
> +++ b/drivers/acpi/acpi_memhotplug.c
> @@ -29,6 +29,7 @@
>   #include <linux/module.h>
>   #include <linux/init.h>
>   #include <linux/types.h>
> +#include <linux/memory.h>
>   #include <linux/memory_hotplug.h>
>   #include <linux/slab.h>
>   #include <acpi/acpi_drivers.h>
> @@ -310,25 +311,44 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
>   	return 0;
>   }
>   
> -static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
> +static int
> +acpi_memory_device_remove_memory(struct acpi_memory_device *mem_device)
>   {
>   	int result;
>   	struct acpi_memory_info *info, *n;
> +	int node = mem_device->nid;
>   
> -
> -	/*
> -	 * Ask the VM to offline this memory range.
> -	 * Note: Assume that this function returns zero on success
> -	 */
>   	list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
>   		if (info->enabled) {
>   			result = offline_memory(info->start_addr, info->length);
>   			if (result)
>   				return result;
> +
> +			result = remove_memory(node, info->start_addr,
> +					       info->length);
> +			if (result)
> +				return result;
>   		}
> +
> +		list_del(&info->list);
>   		kfree(info);
>   	}
>   
> +	return 0;
> +}
> +
> +static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
> +{
> +	int result;
> +
> +	/*
> +	 * Ask the VM to offline this memory range.
> +	 * Note: Assume that this function returns zero on success
> +	 */
> +	result = acpi_memory_device_remove_memory(mem_device);
> +	if (result)
> +		return result;
> +
>   	/* Power-off and eject the device */
>   	result = acpi_memory_powerdown_device(mem_device);
>   	if (result) {
> @@ -477,12 +497,23 @@ static int acpi_memory_device_add(struct acpi_device *device)
>   static int acpi_memory_device_remove(struct acpi_device *device, int type)
>   {
>   	struct acpi_memory_device *mem_device = NULL;
> -
> +	int result;
>   
>   	if (!device || !acpi_driver_data(device))
>   		return -EINVAL;
>   
>   	mem_device = acpi_driver_data(device);
> +
> +	if (type == ACPI_BUS_REMOVAL_EJECT) {
> +		/*
> +		 * offline and remove memory only when the memory device is
> +		 * ejected.
> +		 */
> +		result = acpi_memory_device_remove_memory(mem_device);
> +		if (result)
> +			return result;
> +	}
> +
>   	kfree(mem_device);
>   
>   	return 0;
> diff --git a/drivers/base/memory.c b/drivers/base/memory.c
> index 86c8821..038be73 100644
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -70,6 +70,45 @@ void unregister_memory_isolate_notifier(struct notifier_block *nb)
>   }
>   EXPORT_SYMBOL(unregister_memory_isolate_notifier);
>   
> +bool is_memblk_offline(unsigned long start, unsigned long size)
> +{
> +	struct memory_block *mem = NULL;
> +	struct mem_section *section;
> +	unsigned long start_pfn, end_pfn;
> +	unsigned long pfn, section_nr;
> +
> +	start_pfn = PFN_DOWN(start);
> +	end_pfn = PFN_UP(start + size);
> +
> +	for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
> +		section_nr = pfn_to_section_nr(pfn);
> +		if (!present_section_nr(section_nr))
> +			continue;
> +
> +		section = __nr_to_section(section_nr);
> +		/* same memblock? */
> +		if (mem)
> +			if ((section_nr >= mem->start_section_nr) &&
> +			    (section_nr <= mem->end_section_nr))
> +				continue;
> +
> +		mem = find_memory_block_hinted(section, mem);
> +		if (!mem)
> +			continue;
> +		if (mem->state == MEM_OFFLINE)
> +			continue;
> +
> +		kobject_put(&mem->dev.kobj);
> +		return false;
> +	}
> +
> +	if (mem)
> +		kobject_put(&mem->dev.kobj);
> +
> +	return true;
> +}
> +EXPORT_SYMBOL(is_memblk_offline);
> +
>   /*
>    * register_memory - Setup a sysfs device for a memory block
>    */
> diff --git a/include/linux/memory.h b/include/linux/memory.h
> index 1ac7f6e..7c66126 100644
> --- a/include/linux/memory.h
> +++ b/include/linux/memory.h
> @@ -106,6 +106,10 @@ static inline int memory_isolate_notify(unsigned long val, void *v)
>   {
>   	return 0;
>   }
> +static inline bool is_memblk_offline(unsigned long start, unsigned long size)
> +{
> +	return false;
> +}
>   #else
>   extern int register_memory_notifier(struct notifier_block *nb);
>   extern void unregister_memory_notifier(struct notifier_block *nb);
> @@ -120,6 +124,7 @@ extern int memory_isolate_notify(unsigned long val, void *v);
>   extern struct memory_block *find_memory_block_hinted(struct mem_section *,
>   							struct memory_block *);
>   extern struct memory_block *find_memory_block(struct mem_section *);
> +extern bool is_memblk_offline(unsigned long start, unsigned long size);
>   #define CONFIG_MEM_BLOCK_SIZE	(PAGES_PER_SECTION<<PAGE_SHIFT)
>   enum mem_add_context { BOOT, HOTPLUG };
>   #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
> diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
> index 0b040bb..fd84ea9 100644
> --- a/include/linux/memory_hotplug.h
> +++ b/include/linux/memory_hotplug.h
> @@ -222,6 +222,7 @@ static inline void unlock_memory_hotplug(void) {}
>   #ifdef CONFIG_MEMORY_HOTREMOVE
>   
>   extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages);
> +extern int remove_memory(int nid, u64 start, u64 size);
>   
>   #else
>   static inline int is_mem_section_removable(unsigned long pfn,
> @@ -229,6 +230,10 @@ static inline int is_mem_section_removable(unsigned long pfn,
>   {
>   	return 0;
>   }
> +static inline int remove_memory(int nid, u64 start, u64 size)
> +{
> +	return -EBUSY;
> +}
>   #endif /* CONFIG_MEMORY_HOTREMOVE */
>   
>   extern int mem_online_node(int nid);
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 6fc1908..49f7747 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1038,6 +1038,28 @@ int offline_memory(u64 start, u64 size)
>   
>   	return 0;
>   }
> +
> +int remove_memory(int nid, u64 start, u64 size)
> +{
> +	int ret = -EBUSY;
> +	lock_memory_hotplug();
> +	/*
> +	 * The memory might become online by other task, even if you offine it.

s/offine/offline

> +	 * So we check whether the memory has been onlined or not.
> +	 */
> +	if (!is_memblk_offline(start, size)) {
> +		pr_warn("memory removing [mem %#010llx-%#010llx] failed, "
> +			"because the memmory range is online\n",
> +			start, start + size);
> +		ret = -EAGAIN;
> +	}
> +
> +	unlock_memory_hotplug();
> +	return ret;
> +
> +}
> +EXPORT_SYMBOL_GPL(remove_memory);
> +
>   #else
>   int offline_pages(unsigned long start, unsigned long size)
>   {


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

* Re: [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages()
  2012-09-28  3:50     ` Yasuaki Ishimatsu
@ 2012-09-28 22:15       ` KOSAKI Motohiro
  2012-10-02  1:18         ` Yasuaki Ishimatsu
  0 siblings, 1 reply; 62+ messages in thread
From: KOSAKI Motohiro @ 2012-09-28 22:15 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: Ni zhan Chen, wency, x86, linux-mm, linux-kernel, linuxppc-dev,
	linux-acpi, linux-s390, linux-sh, linux-ia64, cmetcalf,
	sparclinux, rientjes, liuj97, len.brown, benh, paulus, cl,
	minchan.kim, akpm

On Thu, Sep 27, 2012 at 11:50 PM, Yasuaki Ishimatsu
<isimatu.yasuaki@jp.fujitsu.com> wrote:
> Hi Chen,
>
>
> 2012/09/28 11:22, Ni zhan Chen wrote:
>>
>> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>>>
>>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>>
>>> remove_memory() only try to offline pages. It is called in two cases:
>>> 1. hot remove a memory device
>>> 2. echo offline >/sys/devices/system/memory/memoryXX/state
>>>
>>> In the 1st case, we should also change memory block's state, and notify
>>> the userspace that the memory block's state is changed after offlining
>>> pages.
>>>
>>> So rename remove_memory() to offline_memory()/offline_pages(). And in
>>> the 1st case, offline_memory() will be used. The function
>>> offline_memory()
>>> is not implemented. In the 2nd case, offline_pages() will be used.
>>
>>
>> But this time there is not a function associated with add_memory.
>
>
> To associate with add_memory() later, we renamed it.

Then, you introduced bisect breakage. It is definitely unacceptable.

NAK.

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

* Re: [RFC v9 PATCH 13/21] memory-hotplug: check page type in get_page_bootmem
  2012-09-05  9:25 ` [RFC v9 PATCH 13/21] memory-hotplug: check page type in get_page_bootmem wency
@ 2012-09-29  2:15   ` Ni zhan Chen
  2012-10-01  3:03     ` Yasuaki Ishimatsu
  0 siblings, 1 reply; 62+ messages in thread
From: Ni zhan Chen @ 2012-09-29  2:15 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, Wen Congyang

On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>
> The function get_page_bootmem() may be called more than one time to the same
> page. There is no need to set page's type, private if the function is not
> the first time called to the page.
>
> Note: the patch is just optimization and does not fix any problem.

Hi Yasuaki,

this patch is reasonable to me. I have another question associated to 
get_page_bootmem(), the question is from another fujitsu guy's patch 
changelog [commit : 04753278769f3], the changelog said  that:

  1) When the memmap of removing section is allocated on other
      section by bootmem, it should/can be free.
  2) When the memmap of removing section is allocated on the
      same section, it shouldn't be freed. Because the section has to be
      logical memory offlined already and all pages must be isolated against
      page allocater. If it is freed, page allocator may use it which will
      be removed physically soon.

but I don't see his patch guarantee 2), it means that his patch doesn't 
guarantee the memmap of removing section which is allocated on other 
section by bootmem doesn't be freed. Hopefully get your explaination in 
details, thanks in advance. :-)

>
> CC: David Rientjes <rientjes@google.com>
> CC: Jiang Liu <liuj97@gmail.com>
> CC: Len Brown <len.brown@intel.com>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Christoph Lameter <cl@linux.com>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Wen Congyang <wency@cn.fujitsu.com>
> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> ---
>   mm/memory_hotplug.c |   15 +++++++++++----
>   1 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index d736df3..26a5012 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -95,10 +95,17 @@ static void release_memory_resource(struct resource *res)
>   static void get_page_bootmem(unsigned long info,  struct page *page,
>   			     unsigned long type)
>   {
> -	page->lru.next = (struct list_head *) type;
> -	SetPagePrivate(page);
> -	set_page_private(page, info);
> -	atomic_inc(&page->_count);
> +	unsigned long page_type;
> +
> +	page_type = (unsigned long)page->lru.next;
> +	if (page_type < MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE ||
> +	    page_type > MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE){
> +		page->lru.next = (struct list_head *)type;
> +		SetPagePrivate(page);
> +		set_page_private(page, info);
> +		atomic_inc(&page->_count);
> +	} else
> +		atomic_inc(&page->_count);
>   }
>   
>   /* reference to __meminit __free_pages_bootmem is valid


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (22 preceding siblings ...)
  2012-09-26 16:58 ` Vasilis Liaskovitis
@ 2012-09-29  3:45 ` Ni zhan Chen
  2012-09-29  8:19 ` Ni zhan Chen
  24 siblings, 0 replies; 62+ messages in thread
From: Ni zhan Chen @ 2012-09-29  3:45 UTC (permalink / raw)
  To: wency
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
> From: Wen Congyang <wency@cn.fujitsu.com>
>
> This patch series aims to support physical memory hot-remove.
>
> The patches can free/remove the following things:
>
>    - acpi_memory_info                          : [RFC PATCH 4/19]
>    - /sys/firmware/memmap/X/{end, start, type} : [RFC PATCH 8/19]
>    - iomem_resource                            : [RFC PATCH 9/19]
>    - mem_section and related sysfs files       : [RFC PATCH 10-11, 13-16/19]
>    - page table of removed memory              : [RFC PATCH 12/19]
>    - node and related sysfs files              : [RFC PATCH 18-19/19]
>
> If you find lack of function for physical memory hot-remove, please let me
> know.

Since patchset is too big, could you add more patchset changelog to 
describe how this patchset works? in order that it is easier to review.

>
> How to test this patchset?
> 1. apply this patchset and build the kernel. MEMORY_HOTPLUG, MEMORY_HOTREMOVE,
>     ACPI_HOTPLUG_MEMORY must be selected.
> 2. load the module acpi_memhotplug
> 3. hotplug the memory device(it depends on your hardware)
>     You will see the memory device under the directory /sys/bus/acpi/devices/.
>     Its name is PNP0C80:XX.
> 4. online/offline pages provided by this memory device
>     You can write online/offline to /sys/devices/system/memory/memoryX/state to
>     online/offline pages provided by this memory device
> 5. hotremove the memory device
>     You can hotremove the memory device by the hardware, or writing 1 to
>     /sys/bus/acpi/devices/PNP0C80:XX/eject.
>
> Note: if the memory provided by the memory device is used by the kernel, it
> can't be offlined. It is not a bug.
>
> Known problems:
> 1. memory can't be offlined when CONFIG_MEMCG is selected.
>     For example: there is a memory device on node 1. The address range
>     is [1G, 1.5G). You will find 4 new directories memory8, memory9, memory10,
>     and memory11 under the directory /sys/devices/system/memory/.
>     If CONFIG_MEMCG is selected, we will allocate memory to store page cgroup
>     when we online pages. When we online memory8, the memory stored page cgroup
>     is not provided by this memory device. But when we online memory9, the memory
>     stored page cgroup may be provided by memory8. So we can't offline memory8
>     now. We should offline the memory in the reversed order.
>     When the memory device is hotremoved, we will auto offline memory provided
>     by this memory device. But we don't know which memory is onlined first, so
>     offlining memory may fail. In such case, you should offline the memory by
>     hand before hotremoving the memory device.
> 2. hotremoving memory device may cause kernel panicked
>     This bug will be fixed by Liu Jiang's patch:
>     https://lkml.org/lkml/2012/7/3/1
>
> change log of v9:
>   [RFC PATCH v9 8/21]
>     * add a lock to protect the list map_entries
>     * add an indicator to firmware_map_entry to remember whether the memory
>       is allocated from bootmem
>   [RFC PATCH v9 10/21]
>     * change the macro to inline function
>   [RFC PATCH v9 19/21]
>     * don't offline the node if the cpu on the node is onlined
>   [RFC PATCH v9 21/21]
>     * create new patch: auto offline page_cgroup when onlining memory block
>       failed
>
> change log of v8:
>   [RFC PATCH v8 17/20]
>     * Fix problems when one node's range include the other nodes
>   [RFC PATCH v8 18/20]
>     * fix building error when CONFIG_MEMORY_HOTPLUG_SPARSE or CONFIG_HUGETLBFS
>       is not defined.
>   [RFC PATCH v8 19/20]
>     * don't offline node when some memory sections are not removed
>   [RFC PATCH v8 20/20]
>     * create new patch: clear hwpoisoned flag when onlining pages
>
> change log of v7:
>   [RFC PATCH v7 4/19]
>     * do not continue if acpi_memory_device_remove_memory() fails.
>   [RFC PATCH v7 15/19]
>     * handle usemap in register_page_bootmem_info_section() too.
>
> change log of v6:
>   [RFC PATCH v6 12/19]
>     * fix building error on other archtitectures than x86
>
>   [RFC PATCH v6 15-16/19]
>     * fix building error on other archtitectures than x86
>
> change log of v5:
>   * merge the patchset to clear page table and the patchset to hot remove
>     memory(from ishimatsu) to one big patchset.
>
>   [RFC PATCH v5 1/19]
>     * rename remove_memory() to offline_memory()/offline_pages()
>
>   [RFC PATCH v5 2/19]
>     * new patch: implement offline_memory(). This function offlines pages,
>       update memory block's state, and notify the userspace that the memory
>       block's state is changed.
>
>   [RFC PATCH v5 4/19]
>     * offline and remove memory in acpi_memory_disable_device() too.
>
>   [RFC PATCH v5 17/19]
>     * new patch: add a new function __remove_zone() to revert the things done
>       in the function __add_zone().
>
>   [RFC PATCH v5 18/19]
>     * flush work befor reseting node device.
>
> change log of v4:
>   * remove "memory-hotplug : unify argument of firmware_map_add_early/hotplug"
>     from the patch series, since the patch is a bugfix. It is being disccussed
>     on other thread. But for testing the patch series, the patch is needed.
>     So I added the patch as [PATCH 0/13].
>
>   [RFC PATCH v4 2/13]
>     * check memory is online or not at remove_memory()
>     * add memory_add_physaddr_to_nid() to acpi_memory_device_remove() for
>       getting node id
>   
>   [RFC PATCH v4 3/13]
>     * create new patch : check memory is online or not at online_pages()
>
>   [RFC PATCH v4 4/13]
>     * add __ref section to remove_memory()
>     * call firmware_map_remove_entry() before remove_sysfs_fw_map_entry()
>
>   [RFC PATCH v4 11/13]
>     * rewrite register_page_bootmem_memmap() for removing page used as PT/PMD
>
> change log of v3:
>   * rebase to 3.5.0-rc6
>
>   [RFC PATCH v2 2/13]
>     * remove extra kobject_put()
>
>     * The patch was commented by Wen. Wen's comment is
>       "acpi_memory_device_remove() should ignore a return value of
>       remove_memory() since caller does not care the return value".
>       But I did not change it since I think caller should care the
>       return value. And I am trying to fix it as follow:
>
>       https://lkml.org/lkml/2012/7/5/624
>
>   [RFC PATCH v2 4/13]
>     * remove a firmware_memmap_entry allocated by kzmalloc()
>
> change log of v2:
>   [RFC PATCH v2 2/13]
>     * check whether memory block is offline or not before calling offline_memory()
>     * check whether section is valid or not in is_memblk_offline()
>     * call kobject_put() for each memory_block in is_memblk_offline()
>
>   [RFC PATCH v2 3/13]
>     * unify the end argument of firmware_map_add_early/hotplug
>
>   [RFC PATCH v2 4/13]
>     * add release_firmware_map_entry() for freeing firmware_map_entry
>
>   [RFC PATCH v2 6/13]
>    * add release_memory_block() for freeing memory_block
>
>   [RFC PATCH v2 11/13]
>    * fix wrong arguments of free_pages()
>
>
> Wen Congyang (8):
>    memory-hotplug: implement offline_memory()
>    memory-hotplug: store the node id in acpi_memory_device
>    memory-hotplug: export the function acpi_bus_remove()
>    memory-hotplug: call acpi_bus_remove() to remove memory device
>    memory-hotplug: introduce new function arch_remove_memory()
>    memory-hotplug: remove sysfs file of node
>    memory-hotplug: clear hwpoisoned flag when onlining pages
>    memory-hotplug: auto offline page_cgroup when onlining memory block
>      failed
>
> Yasuaki Ishimatsu (13):
>    memory-hotplug: rename remove_memory() to
>      offline_memory()/offline_pages()
>    memory-hotplug: offline and remove memory when removing the memory
>      device
>    memory-hotplug: check whether memory is present or not
>    memory-hotplug: remove /sys/firmware/memmap/X sysfs
>    memory-hotplug: does not release memory region in PAGES_PER_SECTION
>      chunks
>    memory-hotplug: add memory_block_release
>    memory-hotplug: remove_memory calls __remove_pages
>    memory-hotplug: check page type in get_page_bootmem
>    memory-hotplug: move register_page_bootmem_info_node and
>      put_page_bootmem for sparse-vmemmap
>    memory-hotplug: implement register_page_bootmem_info_section of
>      sparse-vmemmap
>    memory-hotplug: free memmap of sparse-vmemmap
>    memory_hotplug: clear zone when the memory is removed
>    memory-hotplug: add node_device_release
>
>   arch/ia64/mm/discontig.c                        |   14 +
>   arch/ia64/mm/init.c                             |   16 +
>   arch/powerpc/mm/init_64.c                       |   14 +
>   arch/powerpc/mm/mem.c                           |   14 +
>   arch/powerpc/platforms/pseries/hotplug-memory.c |   16 +-
>   arch/s390/mm/init.c                             |   12 +
>   arch/s390/mm/vmem.c                             |   14 +
>   arch/sh/mm/init.c                               |   15 +
>   arch/sparc/mm/init_64.c                         |   14 +
>   arch/tile/mm/init.c                             |    8 +
>   arch/x86/include/asm/pgtable_types.h            |    1 +
>   arch/x86/mm/init_32.c                           |   10 +
>   arch/x86/mm/init_64.c                           |  331 ++++++++++++++++++
>   arch/x86/mm/pageattr.c                          |   47 ++--
>   drivers/acpi/acpi_memhotplug.c                  |   54 +++-
>   drivers/acpi/scan.c                             |    3 +-
>   drivers/base/memory.c                           |   88 ++++-
>   drivers/base/node.c                             |   11 +
>   drivers/firmware/memmap.c                       |   98 +++++-
>   include/acpi/acpi_bus.h                         |    1 +
>   include/linux/firmware-map.h                    |    6 +
>   include/linux/memory.h                          |    5 +
>   include/linux/memory_hotplug.h                  |   25 +-
>   include/linux/mm.h                              |    5 +-
>   include/linux/mmzone.h                          |   19 +
>   mm/memory_hotplug.c                             |  424 +++++++++++++++++++++--
>   mm/page_cgroup.c                                |    3 +
>   mm/sparse.c                                     |    5 +-
>   28 files changed, 1181 insertions(+), 92 deletions(-)
>
> --
> 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>
>


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
                   ` (23 preceding siblings ...)
  2012-09-29  3:45 ` Ni zhan Chen
@ 2012-09-29  8:19 ` Ni zhan Chen
  2012-10-01  4:44   ` Yasuaki Ishimatsu
  24 siblings, 1 reply; 62+ messages in thread
From: Ni zhan Chen @ 2012-09-29  8:19 UTC (permalink / raw)
  To: wency
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
> From: Wen Congyang <wency@cn.fujitsu.com>
>
> This patch series aims to support physical memory hot-remove.
>
> The patches can free/remove the following things:
>
>    - acpi_memory_info                          : [RFC PATCH 4/19]
>    - /sys/firmware/memmap/X/{end, start, type} : [RFC PATCH 8/19]
>    - iomem_resource                            : [RFC PATCH 9/19]
>    - mem_section and related sysfs files       : [RFC PATCH 10-11, 13-16/19]
>    - page table of removed memory              : [RFC PATCH 12/19]
>    - node and related sysfs files              : [RFC PATCH 18-19/19]
>
> If you find lack of function for physical memory hot-remove, please let me
> know.
>
> How to test this patchset?
> 1. apply this patchset and build the kernel. MEMORY_HOTPLUG, MEMORY_HOTREMOVE,
>     ACPI_HOTPLUG_MEMORY must be selected.
> 2. load the module acpi_memhotplug

Hi Yasuaki,

where is the acpi_memhotplug module?

> 3. hotplug the memory device(it depends on your hardware)
>     You will see the memory device under the directory /sys/bus/acpi/devices/.
>     Its name is PNP0C80:XX.
> 4. online/offline pages provided by this memory device
>     You can write online/offline to /sys/devices/system/memory/memoryX/state to
>     online/offline pages provided by this memory device
> 5. hotremove the memory device
>     You can hotremove the memory device by the hardware, or writing 1 to
>     /sys/bus/acpi/devices/PNP0C80:XX/eject.
>
> Note: if the memory provided by the memory device is used by the kernel, it
> can't be offlined. It is not a bug.
>
> Known problems:
> 1. memory can't be offlined when CONFIG_MEMCG is selected.
>     For example: there is a memory device on node 1. The address range
>     is [1G, 1.5G). You will find 4 new directories memory8, memory9, memory10,
>     and memory11 under the directory /sys/devices/system/memory/.
>     If CONFIG_MEMCG is selected, we will allocate memory to store page cgroup
>     when we online pages. When we online memory8, the memory stored page cgroup
>     is not provided by this memory device. But when we online memory9, the memory
>     stored page cgroup may be provided by memory8. So we can't offline memory8
>     now. We should offline the memory in the reversed order.
>     When the memory device is hotremoved, we will auto offline memory provided
>     by this memory device. But we don't know which memory is onlined first, so
>     offlining memory may fail. In such case, you should offline the memory by
>     hand before hotremoving the memory device.
> 2. hotremoving memory device may cause kernel panicked
>     This bug will be fixed by Liu Jiang's patch:
>     https://lkml.org/lkml/2012/7/3/1
>
> change log of v9:
>   [RFC PATCH v9 8/21]
>     * add a lock to protect the list map_entries
>     * add an indicator to firmware_map_entry to remember whether the memory
>       is allocated from bootmem
>   [RFC PATCH v9 10/21]
>     * change the macro to inline function
>   [RFC PATCH v9 19/21]
>     * don't offline the node if the cpu on the node is onlined
>   [RFC PATCH v9 21/21]
>     * create new patch: auto offline page_cgroup when onlining memory block
>       failed
>
> change log of v8:
>   [RFC PATCH v8 17/20]
>     * Fix problems when one node's range include the other nodes
>   [RFC PATCH v8 18/20]
>     * fix building error when CONFIG_MEMORY_HOTPLUG_SPARSE or CONFIG_HUGETLBFS
>       is not defined.
>   [RFC PATCH v8 19/20]
>     * don't offline node when some memory sections are not removed
>   [RFC PATCH v8 20/20]
>     * create new patch: clear hwpoisoned flag when onlining pages
>
> change log of v7:
>   [RFC PATCH v7 4/19]
>     * do not continue if acpi_memory_device_remove_memory() fails.
>   [RFC PATCH v7 15/19]
>     * handle usemap in register_page_bootmem_info_section() too.
>
> change log of v6:
>   [RFC PATCH v6 12/19]
>     * fix building error on other archtitectures than x86
>
>   [RFC PATCH v6 15-16/19]
>     * fix building error on other archtitectures than x86
>
> change log of v5:
>   * merge the patchset to clear page table and the patchset to hot remove
>     memory(from ishimatsu) to one big patchset.
>
>   [RFC PATCH v5 1/19]
>     * rename remove_memory() to offline_memory()/offline_pages()
>
>   [RFC PATCH v5 2/19]
>     * new patch: implement offline_memory(). This function offlines pages,
>       update memory block's state, and notify the userspace that the memory
>       block's state is changed.
>
>   [RFC PATCH v5 4/19]
>     * offline and remove memory in acpi_memory_disable_device() too.
>
>   [RFC PATCH v5 17/19]
>     * new patch: add a new function __remove_zone() to revert the things done
>       in the function __add_zone().
>
>   [RFC PATCH v5 18/19]
>     * flush work befor reseting node device.
>
> change log of v4:
>   * remove "memory-hotplug : unify argument of firmware_map_add_early/hotplug"
>     from the patch series, since the patch is a bugfix. It is being disccussed
>     on other thread. But for testing the patch series, the patch is needed.
>     So I added the patch as [PATCH 0/13].
>
>   [RFC PATCH v4 2/13]
>     * check memory is online or not at remove_memory()
>     * add memory_add_physaddr_to_nid() to acpi_memory_device_remove() for
>       getting node id
>   
>   [RFC PATCH v4 3/13]
>     * create new patch : check memory is online or not at online_pages()
>
>   [RFC PATCH v4 4/13]
>     * add __ref section to remove_memory()
>     * call firmware_map_remove_entry() before remove_sysfs_fw_map_entry()
>
>   [RFC PATCH v4 11/13]
>     * rewrite register_page_bootmem_memmap() for removing page used as PT/PMD
>
> change log of v3:
>   * rebase to 3.5.0-rc6
>
>   [RFC PATCH v2 2/13]
>     * remove extra kobject_put()
>
>     * The patch was commented by Wen. Wen's comment is
>       "acpi_memory_device_remove() should ignore a return value of
>       remove_memory() since caller does not care the return value".
>       But I did not change it since I think caller should care the
>       return value. And I am trying to fix it as follow:
>
>       https://lkml.org/lkml/2012/7/5/624
>
>   [RFC PATCH v2 4/13]
>     * remove a firmware_memmap_entry allocated by kzmalloc()
>
> change log of v2:
>   [RFC PATCH v2 2/13]
>     * check whether memory block is offline or not before calling offline_memory()
>     * check whether section is valid or not in is_memblk_offline()
>     * call kobject_put() for each memory_block in is_memblk_offline()
>
>   [RFC PATCH v2 3/13]
>     * unify the end argument of firmware_map_add_early/hotplug
>
>   [RFC PATCH v2 4/13]
>     * add release_firmware_map_entry() for freeing firmware_map_entry
>
>   [RFC PATCH v2 6/13]
>    * add release_memory_block() for freeing memory_block
>
>   [RFC PATCH v2 11/13]
>    * fix wrong arguments of free_pages()
>
>
> Wen Congyang (8):
>    memory-hotplug: implement offline_memory()
>    memory-hotplug: store the node id in acpi_memory_device
>    memory-hotplug: export the function acpi_bus_remove()
>    memory-hotplug: call acpi_bus_remove() to remove memory device
>    memory-hotplug: introduce new function arch_remove_memory()
>    memory-hotplug: remove sysfs file of node
>    memory-hotplug: clear hwpoisoned flag when onlining pages
>    memory-hotplug: auto offline page_cgroup when onlining memory block
>      failed
>
> Yasuaki Ishimatsu (13):
>    memory-hotplug: rename remove_memory() to
>      offline_memory()/offline_pages()
>    memory-hotplug: offline and remove memory when removing the memory
>      device
>    memory-hotplug: check whether memory is present or not
>    memory-hotplug: remove /sys/firmware/memmap/X sysfs
>    memory-hotplug: does not release memory region in PAGES_PER_SECTION
>      chunks
>    memory-hotplug: add memory_block_release
>    memory-hotplug: remove_memory calls __remove_pages
>    memory-hotplug: check page type in get_page_bootmem
>    memory-hotplug: move register_page_bootmem_info_node and
>      put_page_bootmem for sparse-vmemmap
>    memory-hotplug: implement register_page_bootmem_info_section of
>      sparse-vmemmap
>    memory-hotplug: free memmap of sparse-vmemmap
>    memory_hotplug: clear zone when the memory is removed
>    memory-hotplug: add node_device_release
>
>   arch/ia64/mm/discontig.c                        |   14 +
>   arch/ia64/mm/init.c                             |   16 +
>   arch/powerpc/mm/init_64.c                       |   14 +
>   arch/powerpc/mm/mem.c                           |   14 +
>   arch/powerpc/platforms/pseries/hotplug-memory.c |   16 +-
>   arch/s390/mm/init.c                             |   12 +
>   arch/s390/mm/vmem.c                             |   14 +
>   arch/sh/mm/init.c                               |   15 +
>   arch/sparc/mm/init_64.c                         |   14 +
>   arch/tile/mm/init.c                             |    8 +
>   arch/x86/include/asm/pgtable_types.h            |    1 +
>   arch/x86/mm/init_32.c                           |   10 +
>   arch/x86/mm/init_64.c                           |  331 ++++++++++++++++++
>   arch/x86/mm/pageattr.c                          |   47 ++--
>   drivers/acpi/acpi_memhotplug.c                  |   54 +++-
>   drivers/acpi/scan.c                             |    3 +-
>   drivers/base/memory.c                           |   88 ++++-
>   drivers/base/node.c                             |   11 +
>   drivers/firmware/memmap.c                       |   98 +++++-
>   include/acpi/acpi_bus.h                         |    1 +
>   include/linux/firmware-map.h                    |    6 +
>   include/linux/memory.h                          |    5 +
>   include/linux/memory_hotplug.h                  |   25 +-
>   include/linux/mm.h                              |    5 +-
>   include/linux/mmzone.h                          |   19 +
>   mm/memory_hotplug.c                             |  424 +++++++++++++++++++++--
>   mm/page_cgroup.c                                |    3 +
>   mm/sparse.c                                     |    5 +-
>   28 files changed, 1181 insertions(+), 92 deletions(-)
>
> --
> 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>
>


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

* Re: [RFC v9 PATCH 13/21] memory-hotplug: check page type in get_page_bootmem
  2012-09-29  2:15   ` Ni zhan Chen
@ 2012-10-01  3:03     ` Yasuaki Ishimatsu
  2012-10-02 12:24       ` Ni zhan Chen
  0 siblings, 1 reply; 62+ messages in thread
From: Yasuaki Ishimatsu @ 2012-10-01  3:03 UTC (permalink / raw)
  To: Ni zhan Chen
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, Wen Congyang

Hi Chen,

2012/09/29 11:15, Ni zhan Chen wrote:
> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>
>> The function get_page_bootmem() may be called more than one time to the same
>> page. There is no need to set page's type, private if the function is not
>> the first time called to the page.
>>
>> Note: the patch is just optimization and does not fix any problem.
>
> Hi Yasuaki,
>
> this patch is reasonable to me. I have another question associated to get_page_bootmem(), the question is from another fujitsu guy's patch changelog [commit : 04753278769f3], the changelog said  that:
>
>   1) When the memmap of removing section is allocated on other
>       section by bootmem, it should/can be free.
>   2) When the memmap of removing section is allocated on the
>       same section, it shouldn't be freed. Because the section has to be
>       logical memory offlined already and all pages must be isolated against
>       page allocater. If it is freed, page allocator may use it which will
>       be removed physically soon.
>
> but I don't see his patch guarantee 2), it means that his patch doesn't guarantee the memmap of removing section which is allocated on other section by bootmem doesn't be freed. Hopefully get your explaination in details, thanks in advance. :-)

In my understanding, the patch does not guarantee it.
Please see [commit : 0c0a4a517a31e]. free_map_bootmem() in the commit
guarantees it.

Thanks,
Yasuaki Ishimatsu

>
>>
>> CC: David Rientjes <rientjes@google.com>
>> CC: Jiang Liu <liuj97@gmail.com>
>> CC: Len Brown <len.brown@intel.com>
>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> CC: Paul Mackerras <paulus@samba.org>
>> CC: Christoph Lameter <cl@linux.com>
>> Cc: Minchan Kim <minchan.kim@gmail.com>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>> CC: Wen Congyang <wency@cn.fujitsu.com>
>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> ---
>>   mm/memory_hotplug.c |   15 +++++++++++----
>>   1 files changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index d736df3..26a5012 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -95,10 +95,17 @@ static void release_memory_resource(struct resource *res)
>>   static void get_page_bootmem(unsigned long info,  struct page *page,
>>                    unsigned long type)
>>   {
>> -    page->lru.next = (struct list_head *) type;
>> -    SetPagePrivate(page);
>> -    set_page_private(page, info);
>> -    atomic_inc(&page->_count);
>> +    unsigned long page_type;
>> +
>> +    page_type = (unsigned long)page->lru.next;
>> +    if (page_type < MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE ||
>> +        page_type > MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE){
>> +        page->lru.next = (struct list_head *)type;
>> +        SetPagePrivate(page);
>> +        set_page_private(page, info);
>> +        atomic_inc(&page->_count);
>> +    } else
>> +        atomic_inc(&page->_count);
>>   }
>>   /* reference to __meminit __free_pages_bootmem is valid
>



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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-29  8:19 ` Ni zhan Chen
@ 2012-10-01  4:44   ` Yasuaki Ishimatsu
  2012-10-01 23:45     ` Ni zhan Chen
  0 siblings, 1 reply; 62+ messages in thread
From: Yasuaki Ishimatsu @ 2012-10-01  4:44 UTC (permalink / raw)
  To: Ni zhan Chen
  Cc: wency, x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro

Hi Chen,

2012/09/29 17:19, Ni zhan Chen wrote:
> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>> From: Wen Congyang <wency@cn.fujitsu.com>
>>
>> This patch series aims to support physical memory hot-remove.
>>
>> The patches can free/remove the following things:
>>
>>    - acpi_memory_info                          : [RFC PATCH 4/19]
>>    - /sys/firmware/memmap/X/{end, start, type} : [RFC PATCH 8/19]
>>    - iomem_resource                            : [RFC PATCH 9/19]
>>    - mem_section and related sysfs files       : [RFC PATCH 10-11, 13-16/19]
>>    - page table of removed memory              : [RFC PATCH 12/19]
>>    - node and related sysfs files              : [RFC PATCH 18-19/19]
>>
>> If you find lack of function for physical memory hot-remove, please let me
>> know.
>>
>> How to test this patchset?
>> 1. apply this patchset and build the kernel. MEMORY_HOTPLUG, MEMORY_HOTREMOVE,
>>     ACPI_HOTPLUG_MEMORY must be selected.
>> 2. load the module acpi_memhotplug
>
> Hi Yasuaki,
>
> where is the acpi_memhotplug module?

If you build acpi_memhotplug as module, it is created under
/lib/modules/<kernel-version>/driver/acpi/ directory. It depends
on config ACPI_HOTPLUG_MEMORY. The confing is [*], it becomes built-in
function. So you don't need to care about it.  

Thanks,
Yasuaki Ishimatsu

>
>> 3. hotplug the memory device(it depends on your hardware)
>>     You will see the memory device under the directory /sys/bus/acpi/devices/.
>>     Its name is PNP0C80:XX.
>> 4. online/offline pages provided by this memory device
>>     You can write online/offline to /sys/devices/system/memory/memoryX/state to
>>     online/offline pages provided by this memory device
>> 5. hotremove the memory device
>>     You can hotremove the memory device by the hardware, or writing 1 to
>>     /sys/bus/acpi/devices/PNP0C80:XX/eject.
>>
>> Note: if the memory provided by the memory device is used by the kernel, it
>> can't be offlined. It is not a bug.
>>
>> Known problems:
>> 1. memory can't be offlined when CONFIG_MEMCG is selected.
>>     For example: there is a memory device on node 1. The address range
>>     is [1G, 1.5G). You will find 4 new directories memory8, memory9, memory10,
>>     and memory11 under the directory /sys/devices/system/memory/.
>>     If CONFIG_MEMCG is selected, we will allocate memory to store page cgroup
>>     when we online pages. When we online memory8, the memory stored page cgroup
>>     is not provided by this memory device. But when we online memory9, the memory
>>     stored page cgroup may be provided by memory8. So we can't offline memory8
>>     now. We should offline the memory in the reversed order.
>>     When the memory device is hotremoved, we will auto offline memory provided
>>     by this memory device. But we don't know which memory is onlined first, so
>>     offlining memory may fail. In such case, you should offline the memory by
>>     hand before hotremoving the memory device.
>> 2. hotremoving memory device may cause kernel panicked
>>     This bug will be fixed by Liu Jiang's patch:
>>     https://lkml.org/lkml/2012/7/3/1
>>
>> change log of v9:
>>   [RFC PATCH v9 8/21]
>>     * add a lock to protect the list map_entries
>>     * add an indicator to firmware_map_entry to remember whether the memory
>>       is allocated from bootmem
>>   [RFC PATCH v9 10/21]
>>     * change the macro to inline function
>>   [RFC PATCH v9 19/21]
>>     * don't offline the node if the cpu on the node is onlined
>>   [RFC PATCH v9 21/21]
>>     * create new patch: auto offline page_cgroup when onlining memory block
>>       failed
>>
>> change log of v8:
>>   [RFC PATCH v8 17/20]
>>     * Fix problems when one node's range include the other nodes
>>   [RFC PATCH v8 18/20]
>>     * fix building error when CONFIG_MEMORY_HOTPLUG_SPARSE or CONFIG_HUGETLBFS
>>       is not defined.
>>   [RFC PATCH v8 19/20]
>>     * don't offline node when some memory sections are not removed
>>   [RFC PATCH v8 20/20]
>>     * create new patch: clear hwpoisoned flag when onlining pages
>>
>> change log of v7:
>>   [RFC PATCH v7 4/19]
>>     * do not continue if acpi_memory_device_remove_memory() fails.
>>   [RFC PATCH v7 15/19]
>>     * handle usemap in register_page_bootmem_info_section() too.
>>
>> change log of v6:
>>   [RFC PATCH v6 12/19]
>>     * fix building error on other archtitectures than x86
>>
>>   [RFC PATCH v6 15-16/19]
>>     * fix building error on other archtitectures than x86
>>
>> change log of v5:
>>   * merge the patchset to clear page table and the patchset to hot remove
>>     memory(from ishimatsu) to one big patchset.
>>
>>   [RFC PATCH v5 1/19]
>>     * rename remove_memory() to offline_memory()/offline_pages()
>>
>>   [RFC PATCH v5 2/19]
>>     * new patch: implement offline_memory(). This function offlines pages,
>>       update memory block's state, and notify the userspace that the memory
>>       block's state is changed.
>>
>>   [RFC PATCH v5 4/19]
>>     * offline and remove memory in acpi_memory_disable_device() too.
>>
>>   [RFC PATCH v5 17/19]
>>     * new patch: add a new function __remove_zone() to revert the things done
>>       in the function __add_zone().
>>
>>   [RFC PATCH v5 18/19]
>>     * flush work befor reseting node device.
>>
>> change log of v4:
>>   * remove "memory-hotplug : unify argument of firmware_map_add_early/hotplug"
>>     from the patch series, since the patch is a bugfix. It is being disccussed
>>     on other thread. But for testing the patch series, the patch is needed.
>>     So I added the patch as [PATCH 0/13].
>>
>>   [RFC PATCH v4 2/13]
>>     * check memory is online or not at remove_memory()
>>     * add memory_add_physaddr_to_nid() to acpi_memory_device_remove() for
>>       getting node id
>>   [RFC PATCH v4 3/13]
>>     * create new patch : check memory is online or not at online_pages()
>>
>>   [RFC PATCH v4 4/13]
>>     * add __ref section to remove_memory()
>>     * call firmware_map_remove_entry() before remove_sysfs_fw_map_entry()
>>
>>   [RFC PATCH v4 11/13]
>>     * rewrite register_page_bootmem_memmap() for removing page used as PT/PMD
>>
>> change log of v3:
>>   * rebase to 3.5.0-rc6
>>
>>   [RFC PATCH v2 2/13]
>>     * remove extra kobject_put()
>>
>>     * The patch was commented by Wen. Wen's comment is
>>       "acpi_memory_device_remove() should ignore a return value of
>>       remove_memory() since caller does not care the return value".
>>       But I did not change it since I think caller should care the
>>       return value. And I am trying to fix it as follow:
>>
>>       https://lkml.org/lkml/2012/7/5/624
>>
>>   [RFC PATCH v2 4/13]
>>     * remove a firmware_memmap_entry allocated by kzmalloc()
>>
>> change log of v2:
>>   [RFC PATCH v2 2/13]
>>     * check whether memory block is offline or not before calling offline_memory()
>>     * check whether section is valid or not in is_memblk_offline()
>>     * call kobject_put() for each memory_block in is_memblk_offline()
>>
>>   [RFC PATCH v2 3/13]
>>     * unify the end argument of firmware_map_add_early/hotplug
>>
>>   [RFC PATCH v2 4/13]
>>     * add release_firmware_map_entry() for freeing firmware_map_entry
>>
>>   [RFC PATCH v2 6/13]
>>    * add release_memory_block() for freeing memory_block
>>
>>   [RFC PATCH v2 11/13]
>>    * fix wrong arguments of free_pages()
>>
>>
>> Wen Congyang (8):
>>    memory-hotplug: implement offline_memory()
>>    memory-hotplug: store the node id in acpi_memory_device
>>    memory-hotplug: export the function acpi_bus_remove()
>>    memory-hotplug: call acpi_bus_remove() to remove memory device
>>    memory-hotplug: introduce new function arch_remove_memory()
>>    memory-hotplug: remove sysfs file of node
>>    memory-hotplug: clear hwpoisoned flag when onlining pages
>>    memory-hotplug: auto offline page_cgroup when onlining memory block
>>      failed
>>
>> Yasuaki Ishimatsu (13):
>>    memory-hotplug: rename remove_memory() to
>>      offline_memory()/offline_pages()
>>    memory-hotplug: offline and remove memory when removing the memory
>>      device
>>    memory-hotplug: check whether memory is present or not
>>    memory-hotplug: remove /sys/firmware/memmap/X sysfs
>>    memory-hotplug: does not release memory region in PAGES_PER_SECTION
>>      chunks
>>    memory-hotplug: add memory_block_release
>>    memory-hotplug: remove_memory calls __remove_pages
>>    memory-hotplug: check page type in get_page_bootmem
>>    memory-hotplug: move register_page_bootmem_info_node and
>>      put_page_bootmem for sparse-vmemmap
>>    memory-hotplug: implement register_page_bootmem_info_section of
>>      sparse-vmemmap
>>    memory-hotplug: free memmap of sparse-vmemmap
>>    memory_hotplug: clear zone when the memory is removed
>>    memory-hotplug: add node_device_release
>>
>>   arch/ia64/mm/discontig.c                        |   14 +
>>   arch/ia64/mm/init.c                             |   16 +
>>   arch/powerpc/mm/init_64.c                       |   14 +
>>   arch/powerpc/mm/mem.c                           |   14 +
>>   arch/powerpc/platforms/pseries/hotplug-memory.c |   16 +-
>>   arch/s390/mm/init.c                             |   12 +
>>   arch/s390/mm/vmem.c                             |   14 +
>>   arch/sh/mm/init.c                               |   15 +
>>   arch/sparc/mm/init_64.c                         |   14 +
>>   arch/tile/mm/init.c                             |    8 +
>>   arch/x86/include/asm/pgtable_types.h            |    1 +
>>   arch/x86/mm/init_32.c                           |   10 +
>>   arch/x86/mm/init_64.c                           |  331 ++++++++++++++++++
>>   arch/x86/mm/pageattr.c                          |   47 ++--
>>   drivers/acpi/acpi_memhotplug.c                  |   54 +++-
>>   drivers/acpi/scan.c                             |    3 +-
>>   drivers/base/memory.c                           |   88 ++++-
>>   drivers/base/node.c                             |   11 +
>>   drivers/firmware/memmap.c                       |   98 +++++-
>>   include/acpi/acpi_bus.h                         |    1 +
>>   include/linux/firmware-map.h                    |    6 +
>>   include/linux/memory.h                          |    5 +
>>   include/linux/memory_hotplug.h                  |   25 +-
>>   include/linux/mm.h                              |    5 +-
>>   include/linux/mmzone.h                          |   19 +
>>   mm/memory_hotplug.c                             |  424 +++++++++++++++++++++--
>>   mm/page_cgroup.c                                |    3 +
>>   mm/sparse.c                                     |    5 +-
>>   28 files changed, 1181 insertions(+), 92 deletions(-)
>>
>> --
>> 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>
>>
>



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

* Re: [RFC v9 PATCH 03/21] memory-hotplug: store the node id in acpi_memory_device
  2012-09-28  3:21   ` Ni zhan Chen
@ 2012-10-01  7:38     ` Yasuaki Ishimatsu
  0 siblings, 0 replies; 62+ messages in thread
From: Yasuaki Ishimatsu @ 2012-10-01  7:38 UTC (permalink / raw)
  To: Ni zhan Chen
  Cc: wency, x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro

Hi Chen,

2012/09/28 12:21, Ni zhan Chen wrote:
> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>> From: Wen Congyang <wency@cn.fujitsu.com>
>>
>> The memory device has only one node id. Store the node id when
>> enable the memory device, and we can reuse it when removing the
>> memory device.
>
> one question:
> if use numa emulation, memory device will associated to one node or ...?

Memory device has only one node, even if you use numa emulation.

Thanks,
Yasuaki Ishimatsu

>
>>
>> CC: David Rientjes <rientjes@google.com>
>> CC: Jiang Liu <liuj97@gmail.com>
>> CC: Len Brown <len.brown@intel.com>
>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> CC: Paul Mackerras <paulus@samba.org>
>> CC: Christoph Lameter <cl@linux.com>
>> Cc: Minchan Kim <minchan.kim@gmail.com>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>> CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>> Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> ---
>>   drivers/acpi/acpi_memhotplug.c |    4 ++++
>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
>> index 2a7beac..7873832 100644
>> --- a/drivers/acpi/acpi_memhotplug.c
>> +++ b/drivers/acpi/acpi_memhotplug.c
>> @@ -83,6 +83,7 @@ struct acpi_memory_info {
>>   struct acpi_memory_device {
>>       struct acpi_device * device;
>>       unsigned int state;    /* State of the memory device */
>> +    int nid;
>>       struct list_head res_list;
>>   };
>> @@ -256,6 +257,9 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
>>           info->enabled = 1;
>>           num_enabled++;
>>       }
>> +
>> +    mem_device->nid = node;
>> +
>>       if (!num_enabled) {
>>           printk(KERN_ERR PREFIX "add_memory failed\n");
>>           mem_device->state = MEMORY_INVALID_STATE;
>



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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-10-01  4:44   ` Yasuaki Ishimatsu
@ 2012-10-01 23:45     ` Ni zhan Chen
  2012-10-02  0:02       ` Yasuaki Ishimatsu
  0 siblings, 1 reply; 62+ messages in thread
From: Ni zhan Chen @ 2012-10-01 23:45 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: wency, x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro

On 10/01/2012 12:44 PM, Yasuaki Ishimatsu wrote:
> Hi Chen,
>
> 2012/09/29 17:19, Ni zhan Chen wrote:
>> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>>> From: Wen Congyang <wency@cn.fujitsu.com>
>>>
>>> This patch series aims to support physical memory hot-remove.
>>>
>>> The patches can free/remove the following things:
>>>
>>>    - acpi_memory_info                          : [RFC PATCH 4/19]
>>>    - /sys/firmware/memmap/X/{end, start, type} : [RFC PATCH 8/19]
>>>    - iomem_resource                            : [RFC PATCH 9/19]
>>>    - mem_section and related sysfs files       : [RFC PATCH 10-11, 
>>> 13-16/19]
>>>    - page table of removed memory              : [RFC PATCH 12/19]
>>>    - node and related sysfs files              : [RFC PATCH 18-19/19]
>>>
>>> If you find lack of function for physical memory hot-remove, please 
>>> let me
>>> know.
>>>
>>> How to test this patchset?
>>> 1. apply this patchset and build the kernel. MEMORY_HOTPLUG, 
>>> MEMORY_HOTREMOVE,
>>>     ACPI_HOTPLUG_MEMORY must be selected.
>>> 2. load the module acpi_memhotplug
>>
>> Hi Yasuaki,
>>
>> where is the acpi_memhotplug module?
>
> If you build acpi_memhotplug as module, it is created under
> /lib/modules/<kernel-version>/driver/acpi/ directory. It depends
> on config ACPI_HOTPLUG_MEMORY. The confing is [*], it becomes built-in
> function. So you don't need to care about it.
> Thanks,
> Yasuaki Ishimatsu

Hi Yasuaki,

I build the kernel, MEMORY_HOTPLUG, MEMORY_HOTREMOVE, 
ACPI_HOTPLUG_MEMORY are seleted as [*], but I can't find PNP0C80:XX 
under the directory /sys/bus/acpi/devices/.

[root@localhost ~]# ls /sys/bus/acpi/devices/
device:00  device:07  device:0e  device:15  device:1c  device:23 
device:2a   LNXCPU:00  LNXCPU:07    PNP0501:00  PNP0C02:00 PNP0C0F:02  
PNP0C14:01
device:01  device:08  device:0f  device:16  device:1d  device:24 
device:2b   LNXCPU:01  LNXPWRBN:00  PNP0800:00  PNP0C02:01 PNP0C0F:03  
PNP0C31:00
device:02  device:09  device:10  device:17  device:1e  device:25 
device:2c   LNXCPU:02  LNXSYSTM:00  PNP0A08:00  PNP0C02:02 PNP0C0F:04
device:03  device:0a  device:11  device:18  device:1f  device:26 
device:2d   LNXCPU:03  PNP0000:00   PNP0B00:00  PNP0C04:00 PNP0C0F:05
device:04  device:0b  device:12  device:19  device:20  device:27 
device:2e   LNXCPU:04  PNP0100:00   PNP0C01:00  PNP0C0C:00 PNP0C0F:06
device:05  device:0c  device:13  device:1a  device:21  device:28 
device:2f   LNXCPU:05  PNP0103:00   PNP0C01:01  PNP0C0F:00 PNP0C0F:07
device:06  device:0d  device:14  device:1b  device:22  device:29 
INT3F0D:00  LNXCPU:06  PNP0200:00   PNP0C01:02  PNP0C0F:01 PNP0C14:00

then what I miss ? thanks.

>
>>
>>> 3. hotplug the memory device(it depends on your hardware)
>>>     You will see the memory device under the directory 
>>> /sys/bus/acpi/devices/.
>>>     Its name is PNP0C80:XX.
>>> 4. online/offline pages provided by this memory device
>>>     You can write online/offline to 
>>> /sys/devices/system/memory/memoryX/state to
>>>     online/offline pages provided by this memory device
>>> 5. hotremove the memory device
>>>     You can hotremove the memory device by the hardware, or writing 
>>> 1 to
>>>     /sys/bus/acpi/devices/PNP0C80:XX/eject.
>>>
>>> Note: if the memory provided by the memory device is used by the 
>>> kernel, it
>>> can't be offlined. It is not a bug.
>>>
>>> Known problems:
>>> 1. memory can't be offlined when CONFIG_MEMCG is selected.
>>>     For example: there is a memory device on node 1. The address range
>>>     is [1G, 1.5G). You will find 4 new directories memory8, memory9, 
>>> memory10,
>>>     and memory11 under the directory /sys/devices/system/memory/.
>>>     If CONFIG_MEMCG is selected, we will allocate memory to store 
>>> page cgroup
>>>     when we online pages. When we online memory8, the memory stored 
>>> page cgroup
>>>     is not provided by this memory device. But when we online 
>>> memory9, the memory
>>>     stored page cgroup may be provided by memory8. So we can't 
>>> offline memory8
>>>     now. We should offline the memory in the reversed order.
>>>     When the memory device is hotremoved, we will auto offline 
>>> memory provided
>>>     by this memory device. But we don't know which memory is onlined 
>>> first, so
>>>     offlining memory may fail. In such case, you should offline the 
>>> memory by
>>>     hand before hotremoving the memory device.
>>> 2. hotremoving memory device may cause kernel panicked
>>>     This bug will be fixed by Liu Jiang's patch:
>>>     https://lkml.org/lkml/2012/7/3/1
>>>
>>> change log of v9:
>>>   [RFC PATCH v9 8/21]
>>>     * add a lock to protect the list map_entries
>>>     * add an indicator to firmware_map_entry to remember whether the 
>>> memory
>>>       is allocated from bootmem
>>>   [RFC PATCH v9 10/21]
>>>     * change the macro to inline function
>>>   [RFC PATCH v9 19/21]
>>>     * don't offline the node if the cpu on the node is onlined
>>>   [RFC PATCH v9 21/21]
>>>     * create new patch: auto offline page_cgroup when onlining 
>>> memory block
>>>       failed
>>>
>>> change log of v8:
>>>   [RFC PATCH v8 17/20]
>>>     * Fix problems when one node's range include the other nodes
>>>   [RFC PATCH v8 18/20]
>>>     * fix building error when CONFIG_MEMORY_HOTPLUG_SPARSE or 
>>> CONFIG_HUGETLBFS
>>>       is not defined.
>>>   [RFC PATCH v8 19/20]
>>>     * don't offline node when some memory sections are not removed
>>>   [RFC PATCH v8 20/20]
>>>     * create new patch: clear hwpoisoned flag when onlining pages
>>>
>>> change log of v7:
>>>   [RFC PATCH v7 4/19]
>>>     * do not continue if acpi_memory_device_remove_memory() fails.
>>>   [RFC PATCH v7 15/19]
>>>     * handle usemap in register_page_bootmem_info_section() too.
>>>
>>> change log of v6:
>>>   [RFC PATCH v6 12/19]
>>>     * fix building error on other archtitectures than x86
>>>
>>>   [RFC PATCH v6 15-16/19]
>>>     * fix building error on other archtitectures than x86
>>>
>>> change log of v5:
>>>   * merge the patchset to clear page table and the patchset to hot 
>>> remove
>>>     memory(from ishimatsu) to one big patchset.
>>>
>>>   [RFC PATCH v5 1/19]
>>>     * rename remove_memory() to offline_memory()/offline_pages()
>>>
>>>   [RFC PATCH v5 2/19]
>>>     * new patch: implement offline_memory(). This function offlines 
>>> pages,
>>>       update memory block's state, and notify the userspace that the 
>>> memory
>>>       block's state is changed.
>>>
>>>   [RFC PATCH v5 4/19]
>>>     * offline and remove memory in acpi_memory_disable_device() too.
>>>
>>>   [RFC PATCH v5 17/19]
>>>     * new patch: add a new function __remove_zone() to revert the 
>>> things done
>>>       in the function __add_zone().
>>>
>>>   [RFC PATCH v5 18/19]
>>>     * flush work befor reseting node device.
>>>
>>> change log of v4:
>>>   * remove "memory-hotplug : unify argument of 
>>> firmware_map_add_early/hotplug"
>>>     from the patch series, since the patch is a bugfix. It is being 
>>> disccussed
>>>     on other thread. But for testing the patch series, the patch is 
>>> needed.
>>>     So I added the patch as [PATCH 0/13].
>>>
>>>   [RFC PATCH v4 2/13]
>>>     * check memory is online or not at remove_memory()
>>>     * add memory_add_physaddr_to_nid() to 
>>> acpi_memory_device_remove() for
>>>       getting node id
>>>   [RFC PATCH v4 3/13]
>>>     * create new patch : check memory is online or not at 
>>> online_pages()
>>>
>>>   [RFC PATCH v4 4/13]
>>>     * add __ref section to remove_memory()
>>>     * call firmware_map_remove_entry() before 
>>> remove_sysfs_fw_map_entry()
>>>
>>>   [RFC PATCH v4 11/13]
>>>     * rewrite register_page_bootmem_memmap() for removing page used 
>>> as PT/PMD
>>>
>>> change log of v3:
>>>   * rebase to 3.5.0-rc6
>>>
>>>   [RFC PATCH v2 2/13]
>>>     * remove extra kobject_put()
>>>
>>>     * The patch was commented by Wen. Wen's comment is
>>>       "acpi_memory_device_remove() should ignore a return value of
>>>       remove_memory() since caller does not care the return value".
>>>       But I did not change it since I think caller should care the
>>>       return value. And I am trying to fix it as follow:
>>>
>>>       https://lkml.org/lkml/2012/7/5/624
>>>
>>>   [RFC PATCH v2 4/13]
>>>     * remove a firmware_memmap_entry allocated by kzmalloc()
>>>
>>> change log of v2:
>>>   [RFC PATCH v2 2/13]
>>>     * check whether memory block is offline or not before calling 
>>> offline_memory()
>>>     * check whether section is valid or not in is_memblk_offline()
>>>     * call kobject_put() for each memory_block in is_memblk_offline()
>>>
>>>   [RFC PATCH v2 3/13]
>>>     * unify the end argument of firmware_map_add_early/hotplug
>>>
>>>   [RFC PATCH v2 4/13]
>>>     * add release_firmware_map_entry() for freeing firmware_map_entry
>>>
>>>   [RFC PATCH v2 6/13]
>>>    * add release_memory_block() for freeing memory_block
>>>
>>>   [RFC PATCH v2 11/13]
>>>    * fix wrong arguments of free_pages()
>>>
>>>
>>> Wen Congyang (8):
>>>    memory-hotplug: implement offline_memory()
>>>    memory-hotplug: store the node id in acpi_memory_device
>>>    memory-hotplug: export the function acpi_bus_remove()
>>>    memory-hotplug: call acpi_bus_remove() to remove memory device
>>>    memory-hotplug: introduce new function arch_remove_memory()
>>>    memory-hotplug: remove sysfs file of node
>>>    memory-hotplug: clear hwpoisoned flag when onlining pages
>>>    memory-hotplug: auto offline page_cgroup when onlining memory block
>>>      failed
>>>
>>> Yasuaki Ishimatsu (13):
>>>    memory-hotplug: rename remove_memory() to
>>>      offline_memory()/offline_pages()
>>>    memory-hotplug: offline and remove memory when removing the memory
>>>      device
>>>    memory-hotplug: check whether memory is present or not
>>>    memory-hotplug: remove /sys/firmware/memmap/X sysfs
>>>    memory-hotplug: does not release memory region in PAGES_PER_SECTION
>>>      chunks
>>>    memory-hotplug: add memory_block_release
>>>    memory-hotplug: remove_memory calls __remove_pages
>>>    memory-hotplug: check page type in get_page_bootmem
>>>    memory-hotplug: move register_page_bootmem_info_node and
>>>      put_page_bootmem for sparse-vmemmap
>>>    memory-hotplug: implement register_page_bootmem_info_section of
>>>      sparse-vmemmap
>>>    memory-hotplug: free memmap of sparse-vmemmap
>>>    memory_hotplug: clear zone when the memory is removed
>>>    memory-hotplug: add node_device_release
>>>
>>>   arch/ia64/mm/discontig.c                        |   14 +
>>>   arch/ia64/mm/init.c                             |   16 +
>>>   arch/powerpc/mm/init_64.c                       |   14 +
>>>   arch/powerpc/mm/mem.c                           |   14 +
>>>   arch/powerpc/platforms/pseries/hotplug-memory.c |   16 +-
>>>   arch/s390/mm/init.c                             |   12 +
>>>   arch/s390/mm/vmem.c                             |   14 +
>>>   arch/sh/mm/init.c                               |   15 +
>>>   arch/sparc/mm/init_64.c                         |   14 +
>>>   arch/tile/mm/init.c                             |    8 +
>>>   arch/x86/include/asm/pgtable_types.h            |    1 +
>>>   arch/x86/mm/init_32.c                           |   10 +
>>>   arch/x86/mm/init_64.c                           |  331 
>>> ++++++++++++++++++
>>>   arch/x86/mm/pageattr.c                          |   47 ++--
>>>   drivers/acpi/acpi_memhotplug.c                  |   54 +++-
>>>   drivers/acpi/scan.c                             |    3 +-
>>>   drivers/base/memory.c                           |   88 ++++-
>>>   drivers/base/node.c                             |   11 +
>>>   drivers/firmware/memmap.c                       |   98 +++++-
>>>   include/acpi/acpi_bus.h                         |    1 +
>>>   include/linux/firmware-map.h                    |    6 +
>>>   include/linux/memory.h                          |    5 +
>>>   include/linux/memory_hotplug.h                  |   25 +-
>>>   include/linux/mm.h                              |    5 +-
>>>   include/linux/mmzone.h                          |   19 +
>>>   mm/memory_hotplug.c                             |  424 
>>> +++++++++++++++++++++--
>>>   mm/page_cgroup.c                                |    3 +
>>>   mm/sparse.c                                     |    5 +-
>>>   28 files changed, 1181 insertions(+), 92 deletions(-)
>>>
>>> -- 
>>> 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>
>>>
>>
>
>
>


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-10-01 23:45     ` Ni zhan Chen
@ 2012-10-02  0:02       ` Yasuaki Ishimatsu
  0 siblings, 0 replies; 62+ messages in thread
From: Yasuaki Ishimatsu @ 2012-10-02  0:02 UTC (permalink / raw)
  To: Ni zhan Chen
  Cc: wency, x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro

Hi Chen,

2012/10/02 8:45, Ni zhan Chen wrote:
> On 10/01/2012 12:44 PM, Yasuaki Ishimatsu wrote:
>> Hi Chen,
>>
>> 2012/09/29 17:19, Ni zhan Chen wrote:
>>> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>>>> From: Wen Congyang <wency@cn.fujitsu.com>
>>>>
>>>> This patch series aims to support physical memory hot-remove.
>>>>
>>>> The patches can free/remove the following things:
>>>>
>>>>    - acpi_memory_info                          : [RFC PATCH 4/19]
>>>>    - /sys/firmware/memmap/X/{end, start, type} : [RFC PATCH 8/19]
>>>>    - iomem_resource                            : [RFC PATCH 9/19]
>>>>    - mem_section and related sysfs files       : [RFC PATCH 10-11, 13-16/19]
>>>>    - page table of removed memory              : [RFC PATCH 12/19]
>>>>    - node and related sysfs files              : [RFC PATCH 18-19/19]
>>>>
>>>> If you find lack of function for physical memory hot-remove, please let me
>>>> know.
>>>>
>>>> How to test this patchset?
>>>> 1. apply this patchset and build the kernel. MEMORY_HOTPLUG, MEMORY_HOTREMOVE,
>>>>     ACPI_HOTPLUG_MEMORY must be selected.
>>>> 2. load the module acpi_memhotplug
>>>
>>> Hi Yasuaki,
>>>
>>> where is the acpi_memhotplug module?
>>
>> If you build acpi_memhotplug as module, it is created under
>> /lib/modules/<kernel-version>/driver/acpi/ directory. It depends
>> on config ACPI_HOTPLUG_MEMORY. The confing is [*], it becomes built-in
>> function. So you don't need to care about it.
>> Thanks,
>> Yasuaki Ishimatsu
>
> Hi Yasuaki,
>
> I build the kernel, MEMORY_HOTPLUG, MEMORY_HOTREMOVE, ACPI_HOTPLUG_MEMORY are seleted as [*], but I can't find PNP0C80:XX under the directory /sys/bus/acpi/devices/.
>
> [root@localhost ~]# ls /sys/bus/acpi/devices/
> device:00  device:07  device:0e  device:15  device:1c  device:23 device:2a   LNXCPU:00  LNXCPU:07    PNP0501:00  PNP0C02:00 PNP0C0F:02 PNP0C14:01
> device:01  device:08  device:0f  device:16  device:1d  device:24 device:2b   LNXCPU:01  LNXPWRBN:00  PNP0800:00  PNP0C02:01 PNP0C0F:03 PNP0C31:00
> device:02  device:09  device:10  device:17  device:1e  device:25 device:2c   LNXCPU:02  LNXSYSTM:00  PNP0A08:00  PNP0C02:02 PNP0C0F:04
> device:03  device:0a  device:11  device:18  device:1f  device:26 device:2d   LNXCPU:03  PNP0000:00   PNP0B00:00  PNP0C04:00 PNP0C0F:05
> device:04  device:0b  device:12  device:19  device:20  device:27 device:2e   LNXCPU:04  PNP0100:00   PNP0C01:00  PNP0C0C:00 PNP0C0F:06
> device:05  device:0c  device:13  device:1a  device:21  device:28 device:2f   LNXCPU:05  PNP0103:00   PNP0C01:01  PNP0C0F:00 PNP0C0F:07
> device:06  device:0d  device:14  device:1b  device:22  device:29 INT3F0D:00  LNXCPU:06  PNP0200:00   PNP0C01:02  PNP0C0F:01 PNP0C14:00
>
> then what I miss ? thanks.

It depend on hardware. It seems that your system does not support
memory hotplug. If you use KVM, you can try memory hotplug on KVM
guest by applying Vasilis' patch-set.

http://lists.gnu.org/archive/html/qemu-devel/2012-07/msg01389.html

Thanks,
Yasuaki Ishimatsu

>
>>
>>>
>>>> 3. hotplug the memory device(it depends on your hardware)
>>>>     You will see the memory device under the directory /sys/bus/acpi/devices/.
>>>>     Its name is PNP0C80:XX.
>>>> 4. online/offline pages provided by this memory device
>>>>     You can write online/offline to /sys/devices/system/memory/memoryX/state to
>>>>     online/offline pages provided by this memory device
>>>> 5. hotremove the memory device
>>>>     You can hotremove the memory device by the hardware, or writing 1 to
>>>>     /sys/bus/acpi/devices/PNP0C80:XX/eject.
>>>>
>>>> Note: if the memory provided by the memory device is used by the kernel, it
>>>> can't be offlined. It is not a bug.
>>>>
>>>> Known problems:
>>>> 1. memory can't be offlined when CONFIG_MEMCG is selected.
>>>>     For example: there is a memory device on node 1. The address range
>>>>     is [1G, 1.5G). You will find 4 new directories memory8, memory9, memory10,
>>>>     and memory11 under the directory /sys/devices/system/memory/.
>>>>     If CONFIG_MEMCG is selected, we will allocate memory to store page cgroup
>>>>     when we online pages. When we online memory8, the memory stored page cgroup
>>>>     is not provided by this memory device. But when we online memory9, the memory
>>>>     stored page cgroup may be provided by memory8. So we can't offline memory8
>>>>     now. We should offline the memory in the reversed order.
>>>>     When the memory device is hotremoved, we will auto offline memory provided
>>>>     by this memory device. But we don't know which memory is onlined first, so
>>>>     offlining memory may fail. In such case, you should offline the memory by
>>>>     hand before hotremoving the memory device.
>>>> 2. hotremoving memory device may cause kernel panicked
>>>>     This bug will be fixed by Liu Jiang's patch:
>>>>     https://lkml.org/lkml/2012/7/3/1
>>>>
>>>> change log of v9:
>>>>   [RFC PATCH v9 8/21]
>>>>     * add a lock to protect the list map_entries
>>>>     * add an indicator to firmware_map_entry to remember whether the memory
>>>>       is allocated from bootmem
>>>>   [RFC PATCH v9 10/21]
>>>>     * change the macro to inline function
>>>>   [RFC PATCH v9 19/21]
>>>>     * don't offline the node if the cpu on the node is onlined
>>>>   [RFC PATCH v9 21/21]
>>>>     * create new patch: auto offline page_cgroup when onlining memory block
>>>>       failed
>>>>
>>>> change log of v8:
>>>>   [RFC PATCH v8 17/20]
>>>>     * Fix problems when one node's range include the other nodes
>>>>   [RFC PATCH v8 18/20]
>>>>     * fix building error when CONFIG_MEMORY_HOTPLUG_SPARSE or CONFIG_HUGETLBFS
>>>>       is not defined.
>>>>   [RFC PATCH v8 19/20]
>>>>     * don't offline node when some memory sections are not removed
>>>>   [RFC PATCH v8 20/20]
>>>>     * create new patch: clear hwpoisoned flag when onlining pages
>>>>
>>>> change log of v7:
>>>>   [RFC PATCH v7 4/19]
>>>>     * do not continue if acpi_memory_device_remove_memory() fails.
>>>>   [RFC PATCH v7 15/19]
>>>>     * handle usemap in register_page_bootmem_info_section() too.
>>>>
>>>> change log of v6:
>>>>   [RFC PATCH v6 12/19]
>>>>     * fix building error on other archtitectures than x86
>>>>
>>>>   [RFC PATCH v6 15-16/19]
>>>>     * fix building error on other archtitectures than x86
>>>>
>>>> change log of v5:
>>>>   * merge the patchset to clear page table and the patchset to hot remove
>>>>     memory(from ishimatsu) to one big patchset.
>>>>
>>>>   [RFC PATCH v5 1/19]
>>>>     * rename remove_memory() to offline_memory()/offline_pages()
>>>>
>>>>   [RFC PATCH v5 2/19]
>>>>     * new patch: implement offline_memory(). This function offlines pages,
>>>>       update memory block's state, and notify the userspace that the memory
>>>>       block's state is changed.
>>>>
>>>>   [RFC PATCH v5 4/19]
>>>>     * offline and remove memory in acpi_memory_disable_device() too.
>>>>
>>>>   [RFC PATCH v5 17/19]
>>>>     * new patch: add a new function __remove_zone() to revert the things done
>>>>       in the function __add_zone().
>>>>
>>>>   [RFC PATCH v5 18/19]
>>>>     * flush work befor reseting node device.
>>>>
>>>> change log of v4:
>>>>   * remove "memory-hotplug : unify argument of firmware_map_add_early/hotplug"
>>>>     from the patch series, since the patch is a bugfix. It is being disccussed
>>>>     on other thread. But for testing the patch series, the patch is needed.
>>>>     So I added the patch as [PATCH 0/13].
>>>>
>>>>   [RFC PATCH v4 2/13]
>>>>     * check memory is online or not at remove_memory()
>>>>     * add memory_add_physaddr_to_nid() to acpi_memory_device_remove() for
>>>>       getting node id
>>>>   [RFC PATCH v4 3/13]
>>>>     * create new patch : check memory is online or not at online_pages()
>>>>
>>>>   [RFC PATCH v4 4/13]
>>>>     * add __ref section to remove_memory()
>>>>     * call firmware_map_remove_entry() before remove_sysfs_fw_map_entry()
>>>>
>>>>   [RFC PATCH v4 11/13]
>>>>     * rewrite register_page_bootmem_memmap() for removing page used as PT/PMD
>>>>
>>>> change log of v3:
>>>>   * rebase to 3.5.0-rc6
>>>>
>>>>   [RFC PATCH v2 2/13]
>>>>     * remove extra kobject_put()
>>>>
>>>>     * The patch was commented by Wen. Wen's comment is
>>>>       "acpi_memory_device_remove() should ignore a return value of
>>>>       remove_memory() since caller does not care the return value".
>>>>       But I did not change it since I think caller should care the
>>>>       return value. And I am trying to fix it as follow:
>>>>
>>>>       https://lkml.org/lkml/2012/7/5/624
>>>>
>>>>   [RFC PATCH v2 4/13]
>>>>     * remove a firmware_memmap_entry allocated by kzmalloc()
>>>>
>>>> change log of v2:
>>>>   [RFC PATCH v2 2/13]
>>>>     * check whether memory block is offline or not before calling offline_memory()
>>>>     * check whether section is valid or not in is_memblk_offline()
>>>>     * call kobject_put() for each memory_block in is_memblk_offline()
>>>>
>>>>   [RFC PATCH v2 3/13]
>>>>     * unify the end argument of firmware_map_add_early/hotplug
>>>>
>>>>   [RFC PATCH v2 4/13]
>>>>     * add release_firmware_map_entry() for freeing firmware_map_entry
>>>>
>>>>   [RFC PATCH v2 6/13]
>>>>    * add release_memory_block() for freeing memory_block
>>>>
>>>>   [RFC PATCH v2 11/13]
>>>>    * fix wrong arguments of free_pages()
>>>>
>>>>
>>>> Wen Congyang (8):
>>>>    memory-hotplug: implement offline_memory()
>>>>    memory-hotplug: store the node id in acpi_memory_device
>>>>    memory-hotplug: export the function acpi_bus_remove()
>>>>    memory-hotplug: call acpi_bus_remove() to remove memory device
>>>>    memory-hotplug: introduce new function arch_remove_memory()
>>>>    memory-hotplug: remove sysfs file of node
>>>>    memory-hotplug: clear hwpoisoned flag when onlining pages
>>>>    memory-hotplug: auto offline page_cgroup when onlining memory block
>>>>      failed
>>>>
>>>> Yasuaki Ishimatsu (13):
>>>>    memory-hotplug: rename remove_memory() to
>>>>      offline_memory()/offline_pages()
>>>>    memory-hotplug: offline and remove memory when removing the memory
>>>>      device
>>>>    memory-hotplug: check whether memory is present or not
>>>>    memory-hotplug: remove /sys/firmware/memmap/X sysfs
>>>>    memory-hotplug: does not release memory region in PAGES_PER_SECTION
>>>>      chunks
>>>>    memory-hotplug: add memory_block_release
>>>>    memory-hotplug: remove_memory calls __remove_pages
>>>>    memory-hotplug: check page type in get_page_bootmem
>>>>    memory-hotplug: move register_page_bootmem_info_node and
>>>>      put_page_bootmem for sparse-vmemmap
>>>>    memory-hotplug: implement register_page_bootmem_info_section of
>>>>      sparse-vmemmap
>>>>    memory-hotplug: free memmap of sparse-vmemmap
>>>>    memory_hotplug: clear zone when the memory is removed
>>>>    memory-hotplug: add node_device_release
>>>>
>>>>   arch/ia64/mm/discontig.c                        |   14 +
>>>>   arch/ia64/mm/init.c                             |   16 +
>>>>   arch/powerpc/mm/init_64.c                       |   14 +
>>>>   arch/powerpc/mm/mem.c                           |   14 +
>>>>   arch/powerpc/platforms/pseries/hotplug-memory.c |   16 +-
>>>>   arch/s390/mm/init.c                             |   12 +
>>>>   arch/s390/mm/vmem.c                             |   14 +
>>>>   arch/sh/mm/init.c                               |   15 +
>>>>   arch/sparc/mm/init_64.c                         |   14 +
>>>>   arch/tile/mm/init.c                             |    8 +
>>>>   arch/x86/include/asm/pgtable_types.h            |    1 +
>>>>   arch/x86/mm/init_32.c                           |   10 +
>>>>   arch/x86/mm/init_64.c                           |  331 ++++++++++++++++++
>>>>   arch/x86/mm/pageattr.c                          |   47 ++--
>>>>   drivers/acpi/acpi_memhotplug.c                  |   54 +++-
>>>>   drivers/acpi/scan.c                             |    3 +-
>>>>   drivers/base/memory.c                           |   88 ++++-
>>>>   drivers/base/node.c                             |   11 +
>>>>   drivers/firmware/memmap.c                       |   98 +++++-
>>>>   include/acpi/acpi_bus.h                         |    1 +
>>>>   include/linux/firmware-map.h                    |    6 +
>>>>   include/linux/memory.h                          |    5 +
>>>>   include/linux/memory_hotplug.h                  |   25 +-
>>>>   include/linux/mm.h                              |    5 +-
>>>>   include/linux/mmzone.h                          |   19 +
>>>>   mm/memory_hotplug.c                             |  424 +++++++++++++++++++++--
>>>>   mm/page_cgroup.c                                |    3 +
>>>>   mm/sparse.c                                     |    5 +-
>>>>   28 files changed, 1181 insertions(+), 92 deletions(-)
>>>>
>>>> --
>>>> 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>
>>>>
>>>
>>
>>
>>
>



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

* Re: [RFC v9 PATCH 06/21] memory-hotplug: export the function acpi_bus_remove()
  2012-09-05  9:25 ` [RFC v9 PATCH 06/21] memory-hotplug: export the function acpi_bus_remove() wency
@ 2012-10-02  0:34   ` Ni zhan Chen
  2012-10-02 17:28     ` KOSAKI Motohiro
  0 siblings, 1 reply; 62+ messages in thread
From: Ni zhan Chen @ 2012-10-02  0:34 UTC (permalink / raw)
  To: wency
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
> From: Wen Congyang <wency@cn.fujitsu.com>
>
> The function acpi_bus_remove() can remove a acpi device from acpi device.

IIUC, s/acpi device/acpi bus

>   
> When a acpi device is removed, we need to call this function to remove
> the acpi device from acpi bus. So export this function.
>
> CC: David Rientjes <rientjes@google.com>
> CC: Jiang Liu <liuj97@gmail.com>
> CC: Len Brown <len.brown@intel.com>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Christoph Lameter <cl@linux.com>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
>   drivers/acpi/scan.c     |    3 ++-
>   include/acpi/acpi_bus.h |    1 +
>   2 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index d1ecca2..1cefc34 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -1224,7 +1224,7 @@ static int acpi_device_set_context(struct acpi_device *device)
>   	return -ENODEV;
>   }
>   
> -static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
> +int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
>   {
>   	if (!dev)
>   		return -EINVAL;
> @@ -1246,6 +1246,7 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
>   
>   	return 0;
>   }
> +EXPORT_SYMBOL(acpi_bus_remove);
>   
>   static int acpi_add_single_object(struct acpi_device **child,
>   				  acpi_handle handle, int type,
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index bde976e..2ccf109 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -360,6 +360,7 @@ bool acpi_bus_power_manageable(acpi_handle handle);
>   bool acpi_bus_can_wakeup(acpi_handle handle);
>   int acpi_power_resource_register_device(struct device *dev, acpi_handle handle);
>   void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handle);
> +int acpi_bus_remove(struct acpi_device *dev, int rmdevice);
>   #ifdef CONFIG_ACPI_PROC_EVENT
>   int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
>   int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data);


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

* Re: [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages()
  2012-09-28 22:15       ` KOSAKI Motohiro
@ 2012-10-02  1:18         ` Yasuaki Ishimatsu
  2012-10-02 17:29           ` KOSAKI Motohiro
  0 siblings, 1 reply; 62+ messages in thread
From: Yasuaki Ishimatsu @ 2012-10-02  1:18 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Ni zhan Chen, wency, x86, linux-mm, linux-kernel, linuxppc-dev,
	linux-acpi, linux-s390, linux-sh, linux-ia64, cmetcalf,
	sparclinux, rientjes, liuj97, len.brown, benh, paulus, cl,
	minchan.kim, akpm

Hi Kosaki-san,

2012/09/29 7:15, KOSAKI Motohiro wrote:
> On Thu, Sep 27, 2012 at 11:50 PM, Yasuaki Ishimatsu
> <isimatu.yasuaki@jp.fujitsu.com> wrote:
>> Hi Chen,
>>
>>
>> 2012/09/28 11:22, Ni zhan Chen wrote:
>>>
>>> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>>>>
>>>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>>>
>>>> remove_memory() only try to offline pages. It is called in two cases:
>>>> 1. hot remove a memory device
>>>> 2. echo offline >/sys/devices/system/memory/memoryXX/state
>>>>
>>>> In the 1st case, we should also change memory block's state, and notify
>>>> the userspace that the memory block's state is changed after offlining
>>>> pages.
>>>>
>>>> So rename remove_memory() to offline_memory()/offline_pages(). And in
>>>> the 1st case, offline_memory() will be used. The function
>>>> offline_memory()
>>>> is not implemented. In the 2nd case, offline_pages() will be used.
>>>
>>>
>>> But this time there is not a function associated with add_memory.
>>
>>
>> To associate with add_memory() later, we renamed it.
>
> Then, you introduced bisect breakage. It is definitely unacceptable.

What is "bisect breakage" meaning?

Thanks,
Yasuaki Ishimatsu

>
> NAK.
>



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

* Re: [RFC v9 PATCH 16/21] memory-hotplug: free memmap of sparse-vmemmap
  2012-09-05  9:25 ` [RFC v9 PATCH 16/21] memory-hotplug: free memmap " wency
@ 2012-10-02  4:21   ` Ni zhan Chen
  2012-10-04  6:26     ` Yasuaki Ishimatsu
  0 siblings, 1 reply; 62+ messages in thread
From: Ni zhan Chen @ 2012-10-02  4:21 UTC (permalink / raw)
  To: isimatu.yasuaki
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, Wen Congyang

On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>
> All pages of virtual mapping in removed memory cannot be freed, since some pages
> used as PGD/PUD includes not only removed memory but also other memory. So the
> patch checks whether page can be freed or not.
>
> How to check whether page can be freed or not?
>   1. When removing memory, the page structs of the revmoved memory are filled
>      with 0FD.
>   2. All page structs are filled with 0xFD on PT/PMD, PT/PMD can be cleared.
>      In this case, the page used as PT/PMD can be freed.
>
> Applying patch, __remove_section() of CONFIG_SPARSEMEM_VMEMMAP is integrated
> into one. So __remove_section() of CONFIG_SPARSEMEM_VMEMMAP is deleted.
>
> Note:  vmemmap_kfree() and vmemmap_free_bootmem() are not implemented for ia64,
> ppc, s390, and sparc.
>
> CC: David Rientjes <rientjes@google.com>
> CC: Jiang Liu <liuj97@gmail.com>
> CC: Len Brown <len.brown@intel.com>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Christoph Lameter <cl@linux.com>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Wen Congyang <wency@cn.fujitsu.com>
> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
> ---
>   arch/ia64/mm/discontig.c  |    8 +++
>   arch/powerpc/mm/init_64.c |    8 +++
>   arch/s390/mm/vmem.c       |    8 +++
>   arch/sparc/mm/init_64.c   |    8 +++
>   arch/x86/mm/init_64.c     |  119 +++++++++++++++++++++++++++++++++++++++++++++
>   include/linux/mm.h        |    2 +
>   mm/memory_hotplug.c       |   17 +------
>   mm/sparse.c               |    5 +-
>   8 files changed, 158 insertions(+), 17 deletions(-)
>
> diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
> index 33943db..0d23b69 100644
> --- a/arch/ia64/mm/discontig.c
> +++ b/arch/ia64/mm/discontig.c
> @@ -823,6 +823,14 @@ int __meminit vmemmap_populate(struct page *start_page,
>   	return vmemmap_populate_basepages(start_page, size, node);
>   }
>   
> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
> +{
> +}
> +
> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
> +{
> +}
> +
>   void register_page_bootmem_memmap(unsigned long section_nr,
>   				  struct page *start_page, unsigned long size)
>   {
> diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
> index 3690c44..835a2b3 100644
> --- a/arch/powerpc/mm/init_64.c
> +++ b/arch/powerpc/mm/init_64.c
> @@ -299,6 +299,14 @@ int __meminit vmemmap_populate(struct page *start_page,
>   	return 0;
>   }
>   
> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
> +{
> +}
> +
> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
> +{
> +}
> +
>   void register_page_bootmem_memmap(unsigned long section_nr,
>   				  struct page *start_page, unsigned long size)
>   {
> diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
> index eda55cd..4b42b0b 100644
> --- a/arch/s390/mm/vmem.c
> +++ b/arch/s390/mm/vmem.c
> @@ -227,6 +227,14 @@ out:
>   	return ret;
>   }
>   
> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
> +{
> +}
> +
> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
> +{
> +}
> +
>   void register_page_bootmem_memmap(unsigned long section_nr,
>   				  struct page *start_page, unsigned long size)
>   {
> diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
> index add1cc7..1384826 100644
> --- a/arch/sparc/mm/init_64.c
> +++ b/arch/sparc/mm/init_64.c
> @@ -2078,6 +2078,14 @@ void __meminit vmemmap_populate_print_last(void)
>   	}
>   }
>   
> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
> +{
> +}
> +
> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
> +{
> +}
> +
>   void register_page_bootmem_memmap(unsigned long section_nr,
>   				  struct page *start_page, unsigned long size)
>   {
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 0075592..4e8f8a4 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -1138,6 +1138,125 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node)
>   	return 0;
>   }
>   
> +#define PAGE_INUSE 0xFD
> +
> +unsigned long find_and_clear_pte_page(unsigned long addr, unsigned long end,
> +			    struct page **pp, int *page_size)
> +{
> +	pgd_t *pgd;
> +	pud_t *pud;
> +	pmd_t *pmd;
> +	pte_t *pte;
> +	void *page_addr;
> +	unsigned long next;
> +
> +	*pp = NULL;
> +
> +	pgd = pgd_offset_k(addr);
> +	if (pgd_none(*pgd))
> +		return pgd_addr_end(addr, end);
> +
> +	pud = pud_offset(pgd, addr);
> +	if (pud_none(*pud))
> +		return pud_addr_end(addr, end);
> +
> +	if (!cpu_has_pse) {
> +		next = (addr + PAGE_SIZE) & PAGE_MASK;
> +		pmd = pmd_offset(pud, addr);
> +		if (pmd_none(*pmd))
> +			return next;
> +
> +		pte = pte_offset_kernel(pmd, addr);
> +		if (pte_none(*pte))
> +			return next;
> +
> +		*page_size = PAGE_SIZE;
> +		*pp = pte_page(*pte);
> +	} else {
> +		next = pmd_addr_end(addr, end);
> +
> +		pmd = pmd_offset(pud, addr);
> +		if (pmd_none(*pmd))
> +			return next;
> +
> +		*page_size = PMD_SIZE;
> +		*pp = pmd_page(*pmd);
> +	}
> +
> +	/*
> +	 * Removed page structs are filled with 0xFD.
> +	 */
> +	memset((void *)addr, PAGE_INUSE, next - addr);
> +
> +	page_addr = page_address(*pp);
> +
> +	/*
> +	 * Check the page is filled with 0xFD or not.
> +	 * memchr_inv() returns the address. In this case, we cannot
> +	 * clear PTE/PUD entry, since the page is used by other.
> +	 * So we cannot also free the page.
> +	 *
> +	 * memchr_inv() returns NULL. In this case, we can clear
> +	 * PTE/PUD entry, since the page is not used by other.
> +	 * So we can also free the page.
> +	 */
> +	if (memchr_inv(page_addr, PAGE_INUSE, *page_size)) {
> +		*pp = NULL;
> +		return next;
> +	}
> +

Hi Yasuaki,

why call memchr_inv check after memset, this time the page can always be 
filled with 0xFD.

> +	if (!cpu_has_pse)
> +		pte_clear(&init_mm, addr, pte);
> +	else
> +		pmd_clear(pmd);
> +
> +	return next;
> +}
> +
> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
> +{
> +	unsigned long addr = (unsigned long)memmap;
> +	unsigned long end = (unsigned long)(memmap + nr_pages);
> +	unsigned long next;
> +	struct page *page;
> +	int page_size;
> +
> +	for (; addr < end; addr = next) {
> +		page = NULL;
> +		page_size = 0;
> +		next = find_and_clear_pte_page(addr, end, &page, &page_size);
> +		if (!page)
> +			continue;
> +
> +		free_pages((unsigned long)page_address(page),
> +			    get_order(page_size));
> +		__flush_tlb_one(addr);
> +	}
> +}
> +
> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
> +{
> +	unsigned long addr = (unsigned long)memmap;
> +	unsigned long end = (unsigned long)(memmap + nr_pages);
> +	unsigned long next;
> +	struct page *page;
> +	int page_size;
> +	unsigned long magic;
> +
> +	for (; addr < end; addr = next) {
> +		page = NULL;
> +		page_size = 0;
> +		next = find_and_clear_pte_page(addr, end, &page, &page_size);
> +		if (!page)
> +			continue;
> +
> +		magic = (unsigned long) page->lru.next;
> +		if (magic == SECTION_INFO)
> +			put_page_bootmem(page);
> +		flush_tlb_kernel_range(addr, end);
> +	}
> +}
> +
>   void register_page_bootmem_memmap(unsigned long section_nr,
>   				  struct page *start_page, unsigned long size)
>   {
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index c607913..fb0d1fc 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1620,6 +1620,8 @@ int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
>   void vmemmap_populate_print_last(void);
>   void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
>   				  unsigned long size);
> +void vmemmap_kfree(struct page *memmpa, unsigned long nr_pages);
> +void vmemmap_free_bootmem(struct page *memmpa, unsigned long nr_pages);
>   
>   enum mf_flags {
>   	MF_COUNT_INCREASED = 1 << 0,
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 647a7f2..c54922c 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -308,19 +308,6 @@ static int __meminit __add_section(int nid, struct zone *zone,
>   	return register_new_memory(nid, __pfn_to_section(phys_start_pfn));
>   }
>   
> -#ifdef CONFIG_SPARSEMEM_VMEMMAP
> -static int __remove_section(struct zone *zone, struct mem_section *ms)
> -{
> -	int ret = -EINVAL;
> -
> -	if (!valid_section(ms))
> -		return ret;
> -
> -	ret = unregister_memory_section(ms);
> -
> -	return ret;
> -}
> -#else
>   static int __remove_section(struct zone *zone, struct mem_section *ms)
>   {
>   	unsigned long flags;
> @@ -337,9 +324,9 @@ static int __remove_section(struct zone *zone, struct mem_section *ms)
>   	pgdat_resize_lock(pgdat, &flags);
>   	sparse_remove_one_section(zone, ms);
>   	pgdat_resize_unlock(pgdat, &flags);
> -	return 0;
> +
> +	return ret;
>   }
> -#endif
>   
>   /*
>    * Reasonably generic function for adding memory.  It is
> diff --git a/mm/sparse.c b/mm/sparse.c
> index fac95f2..ab9d755 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -613,12 +613,13 @@ static inline struct page *kmalloc_section_memmap(unsigned long pnum, int nid,
>   	/* This will make the necessary allocations eventually. */
>   	return sparse_mem_map_populate(pnum, nid);
>   }
> -static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages)
> +static void __kfree_section_memmap(struct page *page, unsigned long nr_pages)
>   {
> -	return; /* XXX: Not implemented yet */
> +	vmemmap_kfree(page, nr_pages);
>   }
>   static void free_map_bootmem(struct page *page, unsigned long nr_pages)
>   {
> +	vmemmap_free_bootmem(page, nr_pages);
>   }
>   #else
>   static struct page *__kmalloc_section_memmap(unsigned long nr_pages)


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

* Re: [RFC v9 PATCH 13/21] memory-hotplug: check page type in get_page_bootmem
  2012-10-01  3:03     ` Yasuaki Ishimatsu
@ 2012-10-02 12:24       ` Ni zhan Chen
  0 siblings, 0 replies; 62+ messages in thread
From: Ni zhan Chen @ 2012-10-02 12:24 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, Wen Congyang

On 10/01/2012 11:03 AM, Yasuaki Ishimatsu wrote:
> Hi Chen,
>
> 2012/09/29 11:15, Ni zhan Chen wrote:
>> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>>
>>> The function get_page_bootmem() may be called more than one time to 
>>> the same
>>> page. There is no need to set page's type, private if the function 
>>> is not
>>> the first time called to the page.
>>>
>>> Note: the patch is just optimization and does not fix any problem.
>>
>> Hi Yasuaki,
>>
>> this patch is reasonable to me. I have another question associated to 
>> get_page_bootmem(), the question is from another fujitsu guy's patch 
>> changelog [commit : 04753278769f3], the changelog said  that:
>>
>>   1) When the memmap of removing section is allocated on other
>>       section by bootmem, it should/can be free.
>>   2) When the memmap of removing section is allocated on the
>>       same section, it shouldn't be freed. Because the section has to be
>>       logical memory offlined already and all pages must be isolated 
>> against
>>       page allocater. If it is freed, page allocator may use it which 
>> will
>>       be removed physically soon.
>>
>> but I don't see his patch guarantee 2), it means that his patch 
>> doesn't guarantee the memmap of removing section which is allocated 
>> on other section by bootmem doesn't be freed. Hopefully get your 
>> explaination in details, thanks in advance. :-)
>
> In my understanding, the patch does not guarantee it.
> Please see [commit : 0c0a4a517a31e]. free_map_bootmem() in the commit
> guarantees it.

Thanks Yasuaki, I have already seen the commit you mentioned. But the 
changelog of the commit I point out 2), why it said that "If it is 
freed, page allocator may use it which will be removed physically soon", 
does it mean that use-after-free ? AFAK, the isolated pages will be free 
if no users use it, so why not free the associated memmap?

>
> Thanks,
> Yasuaki Ishimatsu
>
>>
>>>
>>> CC: David Rientjes <rientjes@google.com>
>>> CC: Jiang Liu <liuj97@gmail.com>
>>> CC: Len Brown <len.brown@intel.com>
>>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> CC: Paul Mackerras <paulus@samba.org>
>>> CC: Christoph Lameter <cl@linux.com>
>>> Cc: Minchan Kim <minchan.kim@gmail.com>
>>> CC: Andrew Morton <akpm@linux-foundation.org>
>>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>> CC: Wen Congyang <wency@cn.fujitsu.com>
>>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>> ---
>>>   mm/memory_hotplug.c |   15 +++++++++++----
>>>   1 files changed, 11 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>>> index d736df3..26a5012 100644
>>> --- a/mm/memory_hotplug.c
>>> +++ b/mm/memory_hotplug.c
>>> @@ -95,10 +95,17 @@ static void release_memory_resource(struct 
>>> resource *res)
>>>   static void get_page_bootmem(unsigned long info,  struct page *page,
>>>                    unsigned long type)
>>>   {
>>> -    page->lru.next = (struct list_head *) type;
>>> -    SetPagePrivate(page);
>>> -    set_page_private(page, info);
>>> -    atomic_inc(&page->_count);
>>> +    unsigned long page_type;
>>> +
>>> +    page_type = (unsigned long)page->lru.next;
>>> +    if (page_type < MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE ||
>>> +        page_type > MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE){
>>> +        page->lru.next = (struct list_head *)type;
>>> +        SetPagePrivate(page);
>>> +        set_page_private(page, info);
>>> +        atomic_inc(&page->_count);
>>> +    } else
>>> +        atomic_inc(&page->_count);
>>>   }
>>>   /* reference to __meminit __free_pages_bootmem is valid
>>
>
>
>


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

* Re: [RFC v9 PATCH 06/21] memory-hotplug: export the function acpi_bus_remove()
  2012-10-02  0:34   ` Ni zhan Chen
@ 2012-10-02 17:28     ` KOSAKI Motohiro
  0 siblings, 0 replies; 62+ messages in thread
From: KOSAKI Motohiro @ 2012-10-02 17:28 UTC (permalink / raw)
  To: Ni zhan Chen
  Cc: wency, x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	isimatu.yasuaki

On Mon, Oct 1, 2012 at 8:34 PM, Ni zhan Chen <nizhan.chen@gmail.com> wrote:
> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>>
>> From: Wen Congyang <wency@cn.fujitsu.com>
>>
>> The function acpi_bus_remove() can remove a acpi device from acpi device.
>
> IIUC, s/acpi device/acpi bus

IIUC, acpi_bus_remove() mean "remove the device from a bus".

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

* Re: [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages()
  2012-10-02  1:18         ` Yasuaki Ishimatsu
@ 2012-10-02 17:29           ` KOSAKI Motohiro
  0 siblings, 0 replies; 62+ messages in thread
From: KOSAKI Motohiro @ 2012-10-02 17:29 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: Ni zhan Chen, wency, x86, linux-mm, linux-kernel, linuxppc-dev,
	linux-acpi, linux-s390, linux-sh, linux-ia64, cmetcalf,
	sparclinux, rientjes, liuj97, len.brown, benh, paulus, cl,
	minchan.kim, akpm

>> Then, you introduced bisect breakage. It is definitely unacceptable.
>
> What is "bisect breakage" meaning?

Think what's happen when only applying path [1/21].

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

* Re: [RFC v9 PATCH 16/21] memory-hotplug: free memmap of sparse-vmemmap
  2012-10-02  4:21   ` Ni zhan Chen
@ 2012-10-04  6:26     ` Yasuaki Ishimatsu
  2012-10-06 14:18       ` Ni zhan Chen
  0 siblings, 1 reply; 62+ messages in thread
From: Yasuaki Ishimatsu @ 2012-10-04  6:26 UTC (permalink / raw)
  To: Ni zhan Chen
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, Wen Congyang

Hi Chen,

Sorry for late reply.

2012/10/02 13:21, Ni zhan Chen wrote:
> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>
>> All pages of virtual mapping in removed memory cannot be freed, since some pages
>> used as PGD/PUD includes not only removed memory but also other memory. So the
>> patch checks whether page can be freed or not.
>>
>> How to check whether page can be freed or not?
>>   1. When removing memory, the page structs of the revmoved memory are filled
>>      with 0FD.
>>   2. All page structs are filled with 0xFD on PT/PMD, PT/PMD can be cleared.
>>      In this case, the page used as PT/PMD can be freed.
>>
>> Applying patch, __remove_section() of CONFIG_SPARSEMEM_VMEMMAP is integrated
>> into one. So __remove_section() of CONFIG_SPARSEMEM_VMEMMAP is deleted.
>>
>> Note:  vmemmap_kfree() and vmemmap_free_bootmem() are not implemented for ia64,
>> ppc, s390, and sparc.
>>
>> CC: David Rientjes <rientjes@google.com>
>> CC: Jiang Liu <liuj97@gmail.com>
>> CC: Len Brown <len.brown@intel.com>
>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> CC: Paul Mackerras <paulus@samba.org>
>> CC: Christoph Lameter <cl@linux.com>
>> Cc: Minchan Kim <minchan.kim@gmail.com>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>> CC: Wen Congyang <wency@cn.fujitsu.com>
>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> ---
>>   arch/ia64/mm/discontig.c  |    8 +++
>>   arch/powerpc/mm/init_64.c |    8 +++
>>   arch/s390/mm/vmem.c       |    8 +++
>>   arch/sparc/mm/init_64.c   |    8 +++
>>   arch/x86/mm/init_64.c     |  119 +++++++++++++++++++++++++++++++++++++++++++++
>>   include/linux/mm.h        |    2 +
>>   mm/memory_hotplug.c       |   17 +------
>>   mm/sparse.c               |    5 +-
>>   8 files changed, 158 insertions(+), 17 deletions(-)
>>
>> diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
>> index 33943db..0d23b69 100644
>> --- a/arch/ia64/mm/discontig.c
>> +++ b/arch/ia64/mm/discontig.c
>> @@ -823,6 +823,14 @@ int __meminit vmemmap_populate(struct page *start_page,
>>       return vmemmap_populate_basepages(start_page, size, node);
>>   }
>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>> +{
>> +}
>> +
>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>> +{
>> +}
>> +
>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>                     struct page *start_page, unsigned long size)
>>   {
>> diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
>> index 3690c44..835a2b3 100644
>> --- a/arch/powerpc/mm/init_64.c
>> +++ b/arch/powerpc/mm/init_64.c
>> @@ -299,6 +299,14 @@ int __meminit vmemmap_populate(struct page *start_page,
>>       return 0;
>>   }
>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>> +{
>> +}
>> +
>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>> +{
>> +}
>> +
>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>                     struct page *start_page, unsigned long size)
>>   {
>> diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
>> index eda55cd..4b42b0b 100644
>> --- a/arch/s390/mm/vmem.c
>> +++ b/arch/s390/mm/vmem.c
>> @@ -227,6 +227,14 @@ out:
>>       return ret;
>>   }
>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>> +{
>> +}
>> +
>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>> +{
>> +}
>> +
>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>                     struct page *start_page, unsigned long size)
>>   {
>> diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
>> index add1cc7..1384826 100644
>> --- a/arch/sparc/mm/init_64.c
>> +++ b/arch/sparc/mm/init_64.c
>> @@ -2078,6 +2078,14 @@ void __meminit vmemmap_populate_print_last(void)
>>       }
>>   }
>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>> +{
>> +}
>> +
>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>> +{
>> +}
>> +
>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>                     struct page *start_page, unsigned long size)
>>   {
>> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
>> index 0075592..4e8f8a4 100644
>> --- a/arch/x86/mm/init_64.c
>> +++ b/arch/x86/mm/init_64.c
>> @@ -1138,6 +1138,125 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node)
>>       return 0;
>>   }
>> +#define PAGE_INUSE 0xFD
>> +
>> +unsigned long find_and_clear_pte_page(unsigned long addr, unsigned long end,
>> +                struct page **pp, int *page_size)
>> +{
>> +    pgd_t *pgd;
>> +    pud_t *pud;
>> +    pmd_t *pmd;
>> +    pte_t *pte;
>> +    void *page_addr;
>> +    unsigned long next;
>> +
>> +    *pp = NULL;
>> +
>> +    pgd = pgd_offset_k(addr);
>> +    if (pgd_none(*pgd))
>> +        return pgd_addr_end(addr, end);
>> +
>> +    pud = pud_offset(pgd, addr);
>> +    if (pud_none(*pud))
>> +        return pud_addr_end(addr, end);
>> +
>> +    if (!cpu_has_pse) {
>> +        next = (addr + PAGE_SIZE) & PAGE_MASK;
>> +        pmd = pmd_offset(pud, addr);
>> +        if (pmd_none(*pmd))
>> +            return next;
>> +
>> +        pte = pte_offset_kernel(pmd, addr);
>> +        if (pte_none(*pte))
>> +            return next;
>> +
>> +        *page_size = PAGE_SIZE;
>> +        *pp = pte_page(*pte);
>> +    } else {
>> +        next = pmd_addr_end(addr, end);
>> +
>> +        pmd = pmd_offset(pud, addr);
>> +        if (pmd_none(*pmd))
>> +            return next;
>> +
>> +        *page_size = PMD_SIZE;
>> +        *pp = pmd_page(*pmd);
>> +    }
>> +
>> +    /*
>> +     * Removed page structs are filled with 0xFD.
>> +     */
>> +    memset((void *)addr, PAGE_INUSE, next - addr);
>> +
>> +    page_addr = page_address(*pp);
>> +
>> +    /*
>> +     * Check the page is filled with 0xFD or not.
>> +     * memchr_inv() returns the address. In this case, we cannot
>> +     * clear PTE/PUD entry, since the page is used by other.
>> +     * So we cannot also free the page.
>> +     *
>> +     * memchr_inv() returns NULL. In this case, we can clear
>> +     * PTE/PUD entry, since the page is not used by other.
>> +     * So we can also free the page.
>> +     */
>> +    if (memchr_inv(page_addr, PAGE_INUSE, *page_size)) {
>> +        *pp = NULL;
>> +        return next;
>> +    }
>> +
>
> Hi Yasuaki,
>
> why call memchr_inv check after memset, this time the page can always be filled with 0xFD.

The page is not always filled with 0xFD. find_and_clear_pte_page()
is calld in each section. So the function fills the page
section size/sizeof(page) byte with 0xFD one time. Thus if section size is
small, the page is filled with 0xFD.

Thanks,
Yasuaki Ishimatsu

  
>> +    if (!cpu_has_pse)
>> +        pte_clear(&init_mm, addr, pte);
>> +    else
>> +        pmd_clear(pmd);
>> +
>> +    return next;
>> +}
>> +
>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>> +{
>> +    unsigned long addr = (unsigned long)memmap;
>> +    unsigned long end = (unsigned long)(memmap + nr_pages);
>> +    unsigned long next;
>> +    struct page *page;
>> +    int page_size;
>> +
>> +    for (; addr < end; addr = next) {
>> +        page = NULL;
>> +        page_size = 0;
>> +        next = find_and_clear_pte_page(addr, end, &page, &page_size);
>> +        if (!page)
>> +            continue;
>> +
>> +        free_pages((unsigned long)page_address(page),
>> +                get_order(page_size));
>> +        __flush_tlb_one(addr);
>> +    }
>> +}
>> +
>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>> +{
>> +    unsigned long addr = (unsigned long)memmap;
>> +    unsigned long end = (unsigned long)(memmap + nr_pages);
>> +    unsigned long next;
>> +    struct page *page;
>> +    int page_size;
>> +    unsigned long magic;
>> +
>> +    for (; addr < end; addr = next) {
>> +        page = NULL;
>> +        page_size = 0;
>> +        next = find_and_clear_pte_page(addr, end, &page, &page_size);
>> +        if (!page)
>> +            continue;
>> +
>> +        magic = (unsigned long) page->lru.next;
>> +        if (magic == SECTION_INFO)
>> +            put_page_bootmem(page);
>> +        flush_tlb_kernel_range(addr, end);
>> +    }
>> +}
>> +
>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>                     struct page *start_page, unsigned long size)
>>   {
>> diff --git a/include/linux/mm.h b/include/linux/mm.h
>> index c607913..fb0d1fc 100644
>> --- a/include/linux/mm.h
>> +++ b/include/linux/mm.h
>> @@ -1620,6 +1620,8 @@ int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
>>   void vmemmap_populate_print_last(void);
>>   void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
>>                     unsigned long size);
>> +void vmemmap_kfree(struct page *memmpa, unsigned long nr_pages);
>> +void vmemmap_free_bootmem(struct page *memmpa, unsigned long nr_pages);
>>   enum mf_flags {
>>       MF_COUNT_INCREASED = 1 << 0,
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index 647a7f2..c54922c 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -308,19 +308,6 @@ static int __meminit __add_section(int nid, struct zone *zone,
>>       return register_new_memory(nid, __pfn_to_section(phys_start_pfn));
>>   }
>> -#ifdef CONFIG_SPARSEMEM_VMEMMAP
>> -static int __remove_section(struct zone *zone, struct mem_section *ms)
>> -{
>> -    int ret = -EINVAL;
>> -
>> -    if (!valid_section(ms))
>> -        return ret;
>> -
>> -    ret = unregister_memory_section(ms);
>> -
>> -    return ret;
>> -}
>> -#else
>>   static int __remove_section(struct zone *zone, struct mem_section *ms)
>>   {
>>       unsigned long flags;
>> @@ -337,9 +324,9 @@ static int __remove_section(struct zone *zone, struct mem_section *ms)
>>       pgdat_resize_lock(pgdat, &flags);
>>       sparse_remove_one_section(zone, ms);
>>       pgdat_resize_unlock(pgdat, &flags);
>> -    return 0;
>> +
>> +    return ret;
>>   }
>> -#endif
>>   /*
>>    * Reasonably generic function for adding memory.  It is
>> diff --git a/mm/sparse.c b/mm/sparse.c
>> index fac95f2..ab9d755 100644
>> --- a/mm/sparse.c
>> +++ b/mm/sparse.c
>> @@ -613,12 +613,13 @@ static inline struct page *kmalloc_section_memmap(unsigned long pnum, int nid,
>>       /* This will make the necessary allocations eventually. */
>>       return sparse_mem_map_populate(pnum, nid);
>>   }
>> -static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages)
>> +static void __kfree_section_memmap(struct page *page, unsigned long nr_pages)
>>   {
>> -    return; /* XXX: Not implemented yet */
>> +    vmemmap_kfree(page, nr_pages);
>>   }
>>   static void free_map_bootmem(struct page *page, unsigned long nr_pages)
>>   {
>> +    vmemmap_free_bootmem(page, nr_pages);
>>   }
>>   #else
>>   static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
>



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

* Re: [RFC v9 PATCH 16/21] memory-hotplug: free memmap of sparse-vmemmap
  2012-10-04  6:26     ` Yasuaki Ishimatsu
@ 2012-10-06 14:18       ` Ni zhan Chen
  0 siblings, 0 replies; 62+ messages in thread
From: Ni zhan Chen @ 2012-10-06 14:18 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, Wen Congyang

On 10/04/2012 02:26 PM, Yasuaki Ishimatsu wrote:
> Hi Chen,
>
> Sorry for late reply.
>
> 2012/10/02 13:21, Ni zhan Chen wrote:
>> On 09/05/2012 05:25 PM, wency@cn.fujitsu.com wrote:
>>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>>
>>> All pages of virtual mapping in removed memory cannot be freed, 
>>> since some pages
>>> used as PGD/PUD includes not only removed memory but also other 
>>> memory. So the
>>> patch checks whether page can be freed or not.
>>>
>>> How to check whether page can be freed or not?
>>>   1. When removing memory, the page structs of the revmoved memory 
>>> are filled
>>>      with 0FD.
>>>   2. All page structs are filled with 0xFD on PT/PMD, PT/PMD can be 
>>> cleared.
>>>      In this case, the page used as PT/PMD can be freed.
>>>
>>> Applying patch, __remove_section() of CONFIG_SPARSEMEM_VMEMMAP is 
>>> integrated
>>> into one. So __remove_section() of CONFIG_SPARSEMEM_VMEMMAP is deleted.
>>>
>>> Note:  vmemmap_kfree() and vmemmap_free_bootmem() are not 
>>> implemented for ia64,
>>> ppc, s390, and sparc.
>>>
>>> CC: David Rientjes <rientjes@google.com>
>>> CC: Jiang Liu <liuj97@gmail.com>
>>> CC: Len Brown <len.brown@intel.com>
>>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> CC: Paul Mackerras <paulus@samba.org>
>>> CC: Christoph Lameter <cl@linux.com>
>>> Cc: Minchan Kim <minchan.kim@gmail.com>
>>> CC: Andrew Morton <akpm@linux-foundation.org>
>>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>> CC: Wen Congyang <wency@cn.fujitsu.com>
>>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>> ---
>>>   arch/ia64/mm/discontig.c  |    8 +++
>>>   arch/powerpc/mm/init_64.c |    8 +++
>>>   arch/s390/mm/vmem.c       |    8 +++
>>>   arch/sparc/mm/init_64.c   |    8 +++
>>>   arch/x86/mm/init_64.c     |  119 
>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>   include/linux/mm.h        |    2 +
>>>   mm/memory_hotplug.c       |   17 +------
>>>   mm/sparse.c               |    5 +-
>>>   8 files changed, 158 insertions(+), 17 deletions(-)
>>>
>>> diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
>>> index 33943db..0d23b69 100644
>>> --- a/arch/ia64/mm/discontig.c
>>> +++ b/arch/ia64/mm/discontig.c
>>> @@ -823,6 +823,14 @@ int __meminit vmemmap_populate(struct page 
>>> *start_page,
>>>       return vmemmap_populate_basepages(start_page, size, node);
>>>   }
>>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +}
>>> +
>>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +}
>>> +
>>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>>                     struct page *start_page, unsigned long size)
>>>   {
>>> diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
>>> index 3690c44..835a2b3 100644
>>> --- a/arch/powerpc/mm/init_64.c
>>> +++ b/arch/powerpc/mm/init_64.c
>>> @@ -299,6 +299,14 @@ int __meminit vmemmap_populate(struct page 
>>> *start_page,
>>>       return 0;
>>>   }
>>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +}
>>> +
>>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +}
>>> +
>>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>>                     struct page *start_page, unsigned long size)
>>>   {
>>> diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
>>> index eda55cd..4b42b0b 100644
>>> --- a/arch/s390/mm/vmem.c
>>> +++ b/arch/s390/mm/vmem.c
>>> @@ -227,6 +227,14 @@ out:
>>>       return ret;
>>>   }
>>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +}
>>> +
>>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +}
>>> +
>>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>>                     struct page *start_page, unsigned long size)
>>>   {
>>> diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
>>> index add1cc7..1384826 100644
>>> --- a/arch/sparc/mm/init_64.c
>>> +++ b/arch/sparc/mm/init_64.c
>>> @@ -2078,6 +2078,14 @@ void __meminit vmemmap_populate_print_last(void)
>>>       }
>>>   }
>>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +}
>>> +
>>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +}
>>> +
>>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>>                     struct page *start_page, unsigned long size)
>>>   {
>>> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
>>> index 0075592..4e8f8a4 100644
>>> --- a/arch/x86/mm/init_64.c
>>> +++ b/arch/x86/mm/init_64.c
>>> @@ -1138,6 +1138,125 @@ vmemmap_populate(struct page *start_page, 
>>> unsigned long size, int node)
>>>       return 0;
>>>   }
>>> +#define PAGE_INUSE 0xFD
>>> +
>>> +unsigned long find_and_clear_pte_page(unsigned long addr, unsigned 
>>> long end,
>>> +                struct page **pp, int *page_size)
>>> +{
>>> +    pgd_t *pgd;
>>> +    pud_t *pud;
>>> +    pmd_t *pmd;
>>> +    pte_t *pte;
>>> +    void *page_addr;
>>> +    unsigned long next;
>>> +
>>> +    *pp = NULL;
>>> +
>>> +    pgd = pgd_offset_k(addr);
>>> +    if (pgd_none(*pgd))
>>> +        return pgd_addr_end(addr, end);
>>> +
>>> +    pud = pud_offset(pgd, addr);
>>> +    if (pud_none(*pud))
>>> +        return pud_addr_end(addr, end);
>>> +
>>> +    if (!cpu_has_pse) {
>>> +        next = (addr + PAGE_SIZE) & PAGE_MASK;
>>> +        pmd = pmd_offset(pud, addr);
>>> +        if (pmd_none(*pmd))
>>> +            return next;
>>> +
>>> +        pte = pte_offset_kernel(pmd, addr);
>>> +        if (pte_none(*pte))
>>> +            return next;
>>> +
>>> +        *page_size = PAGE_SIZE;
>>> +        *pp = pte_page(*pte);
>>> +    } else {
>>> +        next = pmd_addr_end(addr, end);
>>> +
>>> +        pmd = pmd_offset(pud, addr);
>>> +        if (pmd_none(*pmd))
>>> +            return next;
>>> +
>>> +        *page_size = PMD_SIZE;
>>> +        *pp = pmd_page(*pmd);
>>> +    }
>>> +
>>> +    /*
>>> +     * Removed page structs are filled with 0xFD.
>>> +     */
>>> +    memset((void *)addr, PAGE_INUSE, next - addr);
>>> +
>>> +    page_addr = page_address(*pp);
>>> +
>>> +    /*
>>> +     * Check the page is filled with 0xFD or not.
>>> +     * memchr_inv() returns the address. In this case, we cannot
>>> +     * clear PTE/PUD entry, since the page is used by other.
>>> +     * So we cannot also free the page.
>>> +     *
>>> +     * memchr_inv() returns NULL. In this case, we can clear
>>> +     * PTE/PUD entry, since the page is not used by other.
>>> +     * So we can also free the page.
>>> +     */
>>> +    if (memchr_inv(page_addr, PAGE_INUSE, *page_size)) {
>>> +        *pp = NULL;
>>> +        return next;
>>> +    }
>>> +
>>
>> Hi Yasuaki,
>>
>> why call memchr_inv check after memset, this time the page can always 
>> be filled with 0xFD.
>
> The page is not always filled with 0xFD. find_and_clear_pte_page()
> is calld in each section. So the function fills the page
> section size/sizeof(page) byte with 0xFD one time. Thus if section 
> size is
> small, the page is filled with 0xFD.

Hi Yasuaki,

But when section size will be small?

Regards,
Chen

>
> Thanks,
> Yasuaki Ishimatsu
>
>
>>> +    if (!cpu_has_pse)
>>> +        pte_clear(&init_mm, addr, pte);
>>> +    else
>>> +        pmd_clear(pmd);
>>> +
>>> +    return next;
>>> +}
>>> +
>>> +void vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +    unsigned long addr = (unsigned long)memmap;
>>> +    unsigned long end = (unsigned long)(memmap + nr_pages);
>>> +    unsigned long next;
>>> +    struct page *page;
>>> +    int page_size;
>>> +
>>> +    for (; addr < end; addr = next) {
>>> +        page = NULL;
>>> +        page_size = 0;
>>> +        next = find_and_clear_pte_page(addr, end, &page, &page_size);
>>> +        if (!page)
>>> +            continue;
>>> +
>>> +        free_pages((unsigned long)page_address(page),
>>> +                get_order(page_size));
>>> +        __flush_tlb_one(addr);
>>> +    }
>>> +}
>>> +
>>> +void vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +    unsigned long addr = (unsigned long)memmap;
>>> +    unsigned long end = (unsigned long)(memmap + nr_pages);
>>> +    unsigned long next;
>>> +    struct page *page;
>>> +    int page_size;
>>> +    unsigned long magic;
>>> +
>>> +    for (; addr < end; addr = next) {
>>> +        page = NULL;
>>> +        page_size = 0;
>>> +        next = find_and_clear_pte_page(addr, end, &page, &page_size);
>>> +        if (!page)
>>> +            continue;
>>> +
>>> +        magic = (unsigned long) page->lru.next;
>>> +        if (magic == SECTION_INFO)
>>> +            put_page_bootmem(page);
>>> +        flush_tlb_kernel_range(addr, end);
>>> +    }
>>> +}
>>> +
>>>   void register_page_bootmem_memmap(unsigned long section_nr,
>>>                     struct page *start_page, unsigned long size)
>>>   {
>>> diff --git a/include/linux/mm.h b/include/linux/mm.h
>>> index c607913..fb0d1fc 100644
>>> --- a/include/linux/mm.h
>>> +++ b/include/linux/mm.h
>>> @@ -1620,6 +1620,8 @@ int vmemmap_populate(struct page *start_page, 
>>> unsigned long pages, int node);
>>>   void vmemmap_populate_print_last(void);
>>>   void register_page_bootmem_memmap(unsigned long section_nr, struct 
>>> page *map,
>>>                     unsigned long size);
>>> +void vmemmap_kfree(struct page *memmpa, unsigned long nr_pages);
>>> +void vmemmap_free_bootmem(struct page *memmpa, unsigned long 
>>> nr_pages);
>>>   enum mf_flags {
>>>       MF_COUNT_INCREASED = 1 << 0,
>>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>>> index 647a7f2..c54922c 100644
>>> --- a/mm/memory_hotplug.c
>>> +++ b/mm/memory_hotplug.c
>>> @@ -308,19 +308,6 @@ static int __meminit __add_section(int nid, 
>>> struct zone *zone,
>>>       return register_new_memory(nid, 
>>> __pfn_to_section(phys_start_pfn));
>>>   }
>>> -#ifdef CONFIG_SPARSEMEM_VMEMMAP
>>> -static int __remove_section(struct zone *zone, struct mem_section *ms)
>>> -{
>>> -    int ret = -EINVAL;
>>> -
>>> -    if (!valid_section(ms))
>>> -        return ret;
>>> -
>>> -    ret = unregister_memory_section(ms);
>>> -
>>> -    return ret;
>>> -}
>>> -#else
>>>   static int __remove_section(struct zone *zone, struct mem_section 
>>> *ms)
>>>   {
>>>       unsigned long flags;
>>> @@ -337,9 +324,9 @@ static int __remove_section(struct zone *zone, 
>>> struct mem_section *ms)
>>>       pgdat_resize_lock(pgdat, &flags);
>>>       sparse_remove_one_section(zone, ms);
>>>       pgdat_resize_unlock(pgdat, &flags);
>>> -    return 0;
>>> +
>>> +    return ret;
>>>   }
>>> -#endif
>>>   /*
>>>    * Reasonably generic function for adding memory.  It is
>>> diff --git a/mm/sparse.c b/mm/sparse.c
>>> index fac95f2..ab9d755 100644
>>> --- a/mm/sparse.c
>>> +++ b/mm/sparse.c
>>> @@ -613,12 +613,13 @@ static inline struct page 
>>> *kmalloc_section_memmap(unsigned long pnum, int nid,
>>>       /* This will make the necessary allocations eventually. */
>>>       return sparse_mem_map_populate(pnum, nid);
>>>   }
>>> -static void __kfree_section_memmap(struct page *memmap, unsigned 
>>> long nr_pages)
>>> +static void __kfree_section_memmap(struct page *page, unsigned long 
>>> nr_pages)
>>>   {
>>> -    return; /* XXX: Not implemented yet */
>>> +    vmemmap_kfree(page, nr_pages);
>>>   }
>>>   static void free_map_bootmem(struct page *page, unsigned long 
>>> nr_pages)
>>>   {
>>> +    vmemmap_free_bootmem(page, nr_pages);
>>>   }
>>>   #else
>>>   static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
>>
>
>
>


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-26 16:46 ` [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory Vasilis Liaskovitis
  2012-09-27  0:59   ` Wen Congyang
  2012-09-27  6:37   ` Wen Congyang
@ 2012-10-08 10:19   ` Wen Congyang
  2012-10-09  6:16   ` Wen Congyang
  2012-10-09  8:11   ` Wen Congyang
  4 siblings, 0 replies; 62+ messages in thread
From: Wen Congyang @ 2012-10-08 10:19 UTC (permalink / raw)
  To: Vasilis Liaskovitis
  Cc: x86, linux-mm, lkml, linux-acpi, minchan.kim, akpm, isimatu.yasuaki

At 09/27/2012 12:46 AM, Vasilis Liaskovitis Wrote:
> Hi,
> 
> I am testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
> Running in a guest (qemu+seabios from [4]). 
> CONFIG_SLAB=y
> CONFIG_DEBUG_SLAB=y
> 
> After succesfull hot-add and online, I am doing a hot-remove with "echo 1 > /sys/bus/acpi/devices/PNP/eject"
> When I do the OSPM-eject, I often get slab corruption in "acpi-state" cache, or in other caches

I can reproduce this problem without my patchset.

Thanks
Wen Congyang

> 
> [  170.566995] Slab corruption (Not tainted): Acpi-State start=ffff88009fc1e548, len=80
> [  170.567265] Redzone: 0x0/0x0.
> [  170.567399] Last user: [<          (null)>](0x0)
> [  170.567667] 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568078] 010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568487] 020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568894] 030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569302] 040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569712] Prev obj: start=000000009fc1e4d0, len=80
> [  170.569869] BUG: unable to handle kernel paging request at 000000009fc1e520
> [  170.570171] IP: [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.570397] PGD 7cf37067 PUD 0 
> [  170.570619] Oops: 0000 [#1] SMP 
> [  170.570843] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis microcode tpm tpm_bios psmouse parport_pc serio_raw evdev parport i2c_piix4 processor thermal_sys i2c_core button ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net virtio_blk ata_piix libata scsi_mod virtio_pci virtio_ring virtio
> [  170.573474] CPU 0 
> [  170.573568] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [  170.573830] RIP: 0010:[<ffffffff8112803c>]  [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.574106] RSP: 0018:ffff88003eaf3a70  EFLAGS: 00010202
> [  170.574268] RAX: 000000009fc1e4c8 RBX: 0000000000000002 RCX: 00000000000024b8
> [  170.574468] RDX: 000000009fc1e4c8 RSI: 000000009fc1e4c8 RDI: ffff88003e9bb980
> [  170.574668] RBP: ffff88003e9bb980 R08: ffff880037964078 R09: 0000000000000000
> [  170.574870] R10: 000000000000021e R11: 0000000000000002 R12: 000000009fc1e4c8
> [  170.575070] R13: 000000009fc1e520 R14: 000000000000004f R15: 00000000ffffffa5
> [  170.575274] FS:  00007fc6b7530700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [  170.575494] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [  170.575665] CR2: 000000009fc1e520 CR3: 000000007c9c1000 CR4: 00000000000006f0
> [  170.575870] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  170.576075] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  170.576276] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [  170.576507] Stack:
> [  170.576599]  0000000000000010 0000000001893fbe ffff88009fc1e000 0000000000000050
> [  170.576938]  000000009fc1e4c8 000000000000004f 00000000ffffffa5 ffffffff8112899f
> [  170.576938]  ffff88003eb309d8 ffffffff81712d6d ffff88003e9bb980 ffff88009fc1e540
> [  170.576938] Call Trace:
> [  170.576938]  [<ffffffff8112899f>] ? check_poison_obj+0x1df/0x1f0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff81128a9d>] ? cache_alloc_debugcheck_after.isra.52+0xed/0x220
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff8112beb5>] ? kmem_cache_alloc+0xb5/0x1e0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff812edf2d>] ? acpi_ds_result_push+0x5d/0x12e
> [  170.576938]  [<ffffffff812ed127>] ? acpi_ds_exec_end_op+0x28e/0x3d3
> [  170.576938]  [<ffffffff812fd86a>] ? acpi_ps_parse_loop+0x79f/0x931
> [  170.576938]  [<ffffffff812fdd6c>] ? acpi_ps_parse_aml+0x89/0x261
> [  170.576938]  [<ffffffff812fe50c>] ? acpi_ps_execute_method+0x1be/0x266
> [  170.576938]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [  170.576938]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [  170.576938]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [  170.576938]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [  170.576938]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [  170.576938]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [  170.576938]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [  170.576938]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [  170.576938]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [  170.576938]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [  170.576938]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [  170.576938]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [  170.576938] Code: cb 75 dc 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 8b 7f 0c 4c 89 e2 e8 02 fd ff ff 4c 89 e6 49 89 c5 48 89 ef e8 d4 fc ff ff <49> 8b 55 00 48 8b 30 48 c7 c7 8c 39 6f 81 31 c0 e8 3e 34 3b 00 
> 
> Other times, the problem happens on a slab object free:
> 
> [   52.313366] Offlined Pages 32768
> [   52.800232] slab error in verify_redzone_free(): cache `Acpi-ParseExt': memory outside object was overwritten
> [   52.801298] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12
> [   52.802039] Call Trace:
> [   52.802443]  [<ffffffff811280cb>] ? __slab_error.isra.46+0x1b/0x30
> [   52.803199]  [<ffffffff811287b6>] ? cache_free_debugcheck+0x256/0x260
> [   52.803940]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.804645]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.805321]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.806023]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.806762]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.807499]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.808183]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.808897]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.809659]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] ffff88008f809670: redzone 1:0x0, redzone 2:0x0.
> [   52.810032] ------------[ cut here ]------------
> [   52.810032] kernel BUG at mm/slab.c:3125!
> [   52.810032] invalid opcode: 0000 [#1] SMP 
> [   52.810032] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis tpm tpm_bios microcode parport_pc parport evdev processor thermal_sys psmouse i2c_piix4 serio_raw i2c_core button ext3 jbd mbcache sg sr_mod cdrom virtio_net ata_generic virtio_blk virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [   52.810032] CPU 0 
> [   52.810032] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [   52.810032] RIP: 0010:[<ffffffff81128733>]  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032] RSP: 0018:ffff88003eaf3bc0  EFLAGS: 00010093
> [   52.810032] RAX: 00000000017eac3c RBX: ffff88003e9bb700 RCX: 0000000002aaaaab
> [   52.810032] RDX: 0000000000000000 RSI: 0000000000010000 RDI: 0000000000000060
> [   52.810032] RBP: ffff88008f809670 R08: 09f911029d74e35b R09: 0000000000000000
> [   52.810032] R10: 00000000000001d3 R11: 0000000000000002 R12: ffff88008f809000
> [   52.810032] R13: ffffffff812e1b0e R14: 0000000000000000 R15: 0000000000010c00
> [   52.810032] FS:  00007f63fc263700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [   52.810032] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [   52.810032] CR2: 00007fff8d895b78 CR3: 000000007c866000 CR4: 00000000000006f0
> [   52.810032] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   52.810032] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [   52.810032] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [   52.810032] Stack:
> [   52.810032]  ffff88003e9bb980 ffff88008f809670 ffff880037ba8e18 ffff88008f809678
> [   52.810032]  ffff88003e9bb700 0000000000000282 ffff88003e9bf270 ffffffff812e1b0e
> [   52.810032]  0000000000000001 ffffffff81128fe3 ffff88003e80f5e8 ffff88003eb31748
> [   52.810032] Call Trace:
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.810032]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.810032]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.810032]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.810032]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.810032]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] Code: 89 ea 49 89 38 8b 73 14 8b 7b 0c e8 18 f6 ff ff 49 b8 5b e3 74 9d 02 11 f9 09 4c 89 00 44 8b 7b 14 44 89 f8 e9 fa fe ff ff 0f 0b <0f> 0b 48 8b 40 30 e9 d9 fe ff ff e8 c6 43 3b 00 0f 0b 48 8b 40 
> [   52.810032] RIP  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032]  RSP <ffff88003eaf3bc0>
> [   52.810032] ---[ end trace c699c8cecd5870a3 ]---
> 
> 
> And other times, I see a filesystem related slab corruption when doing the eject.
> Here I have also seen a bad rss-counter state message. 
> 
> [  232.114232] BUG: Bad rss-counter state mm:ffff88007d9c1f80 idx:0 val:1
> [  232.115214] BUG: unable to handle kernel NULL pointer dereference at           (null)
> [  232.115807] IP: [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.116186] PGD 7cdec067 PUD 7c946067 PMD 0 
> [  232.116627] Oops: 0000 [#3] SMP 
> [  232.116990] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor thermal_sys button ext3 jbd mbcache virtio_net sg sr_mod cdrom virtio_blk ata_generic virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [  232.120013] CPU 2 
> [  232.120013] Pid: 880, comm: dhclient Tainted: G      D      3.6.0-rc7-guest #1 Bochs Bochs
> [  232.120013] RIP: 0010:[<ffffffffa00cfce3>]  [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.120013] RSP: 0018:ffff88007cd6fab8  EFLAGS: 00010246
> [  232.120013] RAX: ffff88003e513f50 RBX: ffff88003e513f50 RCX: 0000000000000000
> [  232.120013] RDX: 0000000000000000 RSI: ffff88003e513f50 RDI: ffff880097800000
> [  232.120013] RBP: ffff88003e513f50 R08: 000000003e513f01 R09: 0000000180240024
> [  232.120013] R10: ffff88003e513f50 R11: 00000000000198e0 R12: 0000000000000000
> [  232.120013] R13: ffffffffa00eb437 R14: ffff880097800000 R15: 000000000000027a
> [  232.120013] FS:  00007f082638d700(0000) GS:ffff88003ec80000(0000) knlGS:0000000000000000
> [  232.120013] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [  232.120013] CR2: 0000000000000000 CR3: 000000007c94c000 CR4: 00000000000006e0
> [  232.120013] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  232.120013] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  232.120013] Process dhclient (pid: 880, threadinfo ffff88007cd6e000, task ffff88007ca46800)
> [  232.120013] Stack:
> [  232.120013]  ffff88007dc205b0 ffffffff8116645f ffff88007dc205b0 ffff88007dc205b0
> [  232.120013]  ffff88007cf58800 0000000000000000 000000000000000e 0000000000000000
> [  232.120013]  000000000000027a ffffffff8112b934 0000005000000003 0000000000000fff
> [  232.120013] Call Trace:
> [  232.120013]  [<ffffffff8116645f>] ? __find_get_block+0x7f/0x200
> [  232.120013]  [<ffffffff8112b934>] ? kmem_cache_alloc+0xe4/0x140
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffffa00d0279>] ? journal_get_write_access+0x29/0x50 [jbd]
> [  232.120013]  [<ffffffffa00eaeef>] ? __ext3_get_inode_loc+0xcf/0x360 [ext3]
> [  232.120013]  [<ffffffffa0101317>] ? __ext3_journal_get_write_access+0x27/0x60 [ext3]
> [  232.120013]  [<ffffffffa00eb213>] ? ext3_reserve_inode_write+0x73/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb27b>] ? ext3_mark_inode_dirty+0x3b/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffff8115ded6>] ? __mark_inode_dirty+0x36/0x230
> [  232.120013]  [<ffffffff811504a1>] ? update_time+0x71/0xb0
> [  232.120013]  [<ffffffff811536c9>] ? mnt_clone_write+0x9/0x20
> [  232.120013]  [<ffffffff81150581>] ? file_update_time+0xa1/0xf0
> [  232.120013]  [<ffffffff8103385c>] ? ptep_set_access_flags+0x6c/0x70
> [  232.120013]  [<ffffffff810e3f30>] ? __generic_file_aio_write+0x1a0/0x3c0
> [  232.120013]  [<ffffffff811396fb>] ? __sb_start_write+0x6b/0x130
> [  232.120013]  [<ffffffff810e41ce>] ? generic_file_aio_write+0x7e/0x100
> [  232.120013]  [<ffffffff81137484>] ? do_sync_write+0x94/0xd0
> [  232.120013]  [<ffffffff81137caa>] ? vfs_write+0xaa/0x160
> [  232.120013]  [<ffffffff81137f87>] ? sys_write+0x47/0x90
> [  232.120013]  [<ffffffff814e5765>] ? async_page_fault+0x25/0x30
> [  232.120013]  [<ffffffff814eca79>] ? system_call_fastpath+0x16/0x1b
> [  232.120013] Code: 54 24 2c f6 47 14 04 74 1f 41 bc e2 ff ff ff 48 81 c4 98 00 00 00 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 1f 40 00 4c 8b 27 <4d> 8b 3c 24 41 f6 07 02 75 d4 65 48 8b 04 25 80 b9 00 00 48 89 
> 
> Is this a known issue? If yes, can you point me to any relevant patches?
> 
> When I do an SCI(hardware) eject, I have not seen corruptions. The acpi driver is
> evaluating fewer objects in this path I think, but I don't see why corruption can't
> happen here as well.
> 
> I have seen similar problems with CONFIG_SLUB (I did not have debug_options
> there but I can also provide those if helpful)
> 
> [1] https://lkml.org/lkml/2012/9/6/635
> [2] https://lkml.org/lkml/2012/9/11/542
> [3] https://lkml.org/lkml/2012/9/20/37
> [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> 
> thanks,
> 
> - Vasilis
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-26 16:46 ` [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory Vasilis Liaskovitis
                     ` (2 preceding siblings ...)
  2012-10-08 10:19   ` Wen Congyang
@ 2012-10-09  6:16   ` Wen Congyang
  2012-10-09  8:11   ` Wen Congyang
  4 siblings, 0 replies; 62+ messages in thread
From: Wen Congyang @ 2012-10-09  6:16 UTC (permalink / raw)
  To: Vasilis Liaskovitis
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

At 09/27/2012 12:46 AM, Vasilis Liaskovitis Wrote:
> Hi,
> 
> I am testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
> Running in a guest (qemu+seabios from [4]). 
> CONFIG_SLAB=y
> CONFIG_DEBUG_SLAB=y
> 
> After succesfull hot-add and online, I am doing a hot-remove with "echo 1 > /sys/bus/acpi/devices/PNP/eject"
> When I do the OSPM-eject, I often get slab corruption in "acpi-state" cache, or in other caches

I found the reason: when you do OSPM-eject, the kernel will auto offline and remove the memory.
But, offlining memory fails, and the memory is still used by the kernel. But device_release_driver()
doesn't tell this error to the caller acpi_bus_remove(). The kernel will poweroff and eject
the device by emulate _PS3 and _EJ0. The kernel uses some memory which doesn't exist. It's
very dangerous.

Thanks
Wen Conyang

> 
> [  170.566995] Slab corruption (Not tainted): Acpi-State start=ffff88009fc1e548, len=80
> [  170.567265] Redzone: 0x0/0x0.
> [  170.567399] Last user: [<          (null)>](0x0)
> [  170.567667] 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568078] 010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568487] 020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568894] 030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569302] 040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569712] Prev obj: start=000000009fc1e4d0, len=80
> [  170.569869] BUG: unable to handle kernel paging request at 000000009fc1e520
> [  170.570171] IP: [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.570397] PGD 7cf37067 PUD 0 
> [  170.570619] Oops: 0000 [#1] SMP 
> [  170.570843] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis microcode tpm tpm_bios psmouse parport_pc serio_raw evdev parport i2c_piix4 processor thermal_sys i2c_core button ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net virtio_blk ata_piix libata scsi_mod virtio_pci virtio_ring virtio
> [  170.573474] CPU 0 
> [  170.573568] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [  170.573830] RIP: 0010:[<ffffffff8112803c>]  [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.574106] RSP: 0018:ffff88003eaf3a70  EFLAGS: 00010202
> [  170.574268] RAX: 000000009fc1e4c8 RBX: 0000000000000002 RCX: 00000000000024b8
> [  170.574468] RDX: 000000009fc1e4c8 RSI: 000000009fc1e4c8 RDI: ffff88003e9bb980
> [  170.574668] RBP: ffff88003e9bb980 R08: ffff880037964078 R09: 0000000000000000
> [  170.574870] R10: 000000000000021e R11: 0000000000000002 R12: 000000009fc1e4c8
> [  170.575070] R13: 000000009fc1e520 R14: 000000000000004f R15: 00000000ffffffa5
> [  170.575274] FS:  00007fc6b7530700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [  170.575494] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [  170.575665] CR2: 000000009fc1e520 CR3: 000000007c9c1000 CR4: 00000000000006f0
> [  170.575870] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  170.576075] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  170.576276] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [  170.576507] Stack:
> [  170.576599]  0000000000000010 0000000001893fbe ffff88009fc1e000 0000000000000050
> [  170.576938]  000000009fc1e4c8 000000000000004f 00000000ffffffa5 ffffffff8112899f
> [  170.576938]  ffff88003eb309d8 ffffffff81712d6d ffff88003e9bb980 ffff88009fc1e540
> [  170.576938] Call Trace:
> [  170.576938]  [<ffffffff8112899f>] ? check_poison_obj+0x1df/0x1f0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff81128a9d>] ? cache_alloc_debugcheck_after.isra.52+0xed/0x220
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff8112beb5>] ? kmem_cache_alloc+0xb5/0x1e0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff812edf2d>] ? acpi_ds_result_push+0x5d/0x12e
> [  170.576938]  [<ffffffff812ed127>] ? acpi_ds_exec_end_op+0x28e/0x3d3
> [  170.576938]  [<ffffffff812fd86a>] ? acpi_ps_parse_loop+0x79f/0x931
> [  170.576938]  [<ffffffff812fdd6c>] ? acpi_ps_parse_aml+0x89/0x261
> [  170.576938]  [<ffffffff812fe50c>] ? acpi_ps_execute_method+0x1be/0x266
> [  170.576938]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [  170.576938]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [  170.576938]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [  170.576938]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [  170.576938]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [  170.576938]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [  170.576938]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [  170.576938]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [  170.576938]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [  170.576938]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [  170.576938]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [  170.576938]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [  170.576938] Code: cb 75 dc 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 8b 7f 0c 4c 89 e2 e8 02 fd ff ff 4c 89 e6 49 89 c5 48 89 ef e8 d4 fc ff ff <49> 8b 55 00 48 8b 30 48 c7 c7 8c 39 6f 81 31 c0 e8 3e 34 3b 00 
> 
> Other times, the problem happens on a slab object free:
> 
> [   52.313366] Offlined Pages 32768
> [   52.800232] slab error in verify_redzone_free(): cache `Acpi-ParseExt': memory outside object was overwritten
> [   52.801298] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12
> [   52.802039] Call Trace:
> [   52.802443]  [<ffffffff811280cb>] ? __slab_error.isra.46+0x1b/0x30
> [   52.803199]  [<ffffffff811287b6>] ? cache_free_debugcheck+0x256/0x260
> [   52.803940]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.804645]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.805321]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.806023]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.806762]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.807499]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.808183]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.808897]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.809659]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] ffff88008f809670: redzone 1:0x0, redzone 2:0x0.
> [   52.810032] ------------[ cut here ]------------
> [   52.810032] kernel BUG at mm/slab.c:3125!
> [   52.810032] invalid opcode: 0000 [#1] SMP 
> [   52.810032] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis tpm tpm_bios microcode parport_pc parport evdev processor thermal_sys psmouse i2c_piix4 serio_raw i2c_core button ext3 jbd mbcache sg sr_mod cdrom virtio_net ata_generic virtio_blk virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [   52.810032] CPU 0 
> [   52.810032] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [   52.810032] RIP: 0010:[<ffffffff81128733>]  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032] RSP: 0018:ffff88003eaf3bc0  EFLAGS: 00010093
> [   52.810032] RAX: 00000000017eac3c RBX: ffff88003e9bb700 RCX: 0000000002aaaaab
> [   52.810032] RDX: 0000000000000000 RSI: 0000000000010000 RDI: 0000000000000060
> [   52.810032] RBP: ffff88008f809670 R08: 09f911029d74e35b R09: 0000000000000000
> [   52.810032] R10: 00000000000001d3 R11: 0000000000000002 R12: ffff88008f809000
> [   52.810032] R13: ffffffff812e1b0e R14: 0000000000000000 R15: 0000000000010c00
> [   52.810032] FS:  00007f63fc263700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [   52.810032] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [   52.810032] CR2: 00007fff8d895b78 CR3: 000000007c866000 CR4: 00000000000006f0
> [   52.810032] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   52.810032] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [   52.810032] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [   52.810032] Stack:
> [   52.810032]  ffff88003e9bb980 ffff88008f809670 ffff880037ba8e18 ffff88008f809678
> [   52.810032]  ffff88003e9bb700 0000000000000282 ffff88003e9bf270 ffffffff812e1b0e
> [   52.810032]  0000000000000001 ffffffff81128fe3 ffff88003e80f5e8 ffff88003eb31748
> [   52.810032] Call Trace:
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.810032]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.810032]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.810032]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.810032]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.810032]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] Code: 89 ea 49 89 38 8b 73 14 8b 7b 0c e8 18 f6 ff ff 49 b8 5b e3 74 9d 02 11 f9 09 4c 89 00 44 8b 7b 14 44 89 f8 e9 fa fe ff ff 0f 0b <0f> 0b 48 8b 40 30 e9 d9 fe ff ff e8 c6 43 3b 00 0f 0b 48 8b 40 
> [   52.810032] RIP  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032]  RSP <ffff88003eaf3bc0>
> [   52.810032] ---[ end trace c699c8cecd5870a3 ]---
> 
> 
> And other times, I see a filesystem related slab corruption when doing the eject.
> Here I have also seen a bad rss-counter state message. 
> 
> [  232.114232] BUG: Bad rss-counter state mm:ffff88007d9c1f80 idx:0 val:1
> [  232.115214] BUG: unable to handle kernel NULL pointer dereference at           (null)
> [  232.115807] IP: [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.116186] PGD 7cdec067 PUD 7c946067 PMD 0 
> [  232.116627] Oops: 0000 [#3] SMP 
> [  232.116990] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor thermal_sys button ext3 jbd mbcache virtio_net sg sr_mod cdrom virtio_blk ata_generic virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [  232.120013] CPU 2 
> [  232.120013] Pid: 880, comm: dhclient Tainted: G      D      3.6.0-rc7-guest #1 Bochs Bochs
> [  232.120013] RIP: 0010:[<ffffffffa00cfce3>]  [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.120013] RSP: 0018:ffff88007cd6fab8  EFLAGS: 00010246
> [  232.120013] RAX: ffff88003e513f50 RBX: ffff88003e513f50 RCX: 0000000000000000
> [  232.120013] RDX: 0000000000000000 RSI: ffff88003e513f50 RDI: ffff880097800000
> [  232.120013] RBP: ffff88003e513f50 R08: 000000003e513f01 R09: 0000000180240024
> [  232.120013] R10: ffff88003e513f50 R11: 00000000000198e0 R12: 0000000000000000
> [  232.120013] R13: ffffffffa00eb437 R14: ffff880097800000 R15: 000000000000027a
> [  232.120013] FS:  00007f082638d700(0000) GS:ffff88003ec80000(0000) knlGS:0000000000000000
> [  232.120013] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [  232.120013] CR2: 0000000000000000 CR3: 000000007c94c000 CR4: 00000000000006e0
> [  232.120013] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  232.120013] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  232.120013] Process dhclient (pid: 880, threadinfo ffff88007cd6e000, task ffff88007ca46800)
> [  232.120013] Stack:
> [  232.120013]  ffff88007dc205b0 ffffffff8116645f ffff88007dc205b0 ffff88007dc205b0
> [  232.120013]  ffff88007cf58800 0000000000000000 000000000000000e 0000000000000000
> [  232.120013]  000000000000027a ffffffff8112b934 0000005000000003 0000000000000fff
> [  232.120013] Call Trace:
> [  232.120013]  [<ffffffff8116645f>] ? __find_get_block+0x7f/0x200
> [  232.120013]  [<ffffffff8112b934>] ? kmem_cache_alloc+0xe4/0x140
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffffa00d0279>] ? journal_get_write_access+0x29/0x50 [jbd]
> [  232.120013]  [<ffffffffa00eaeef>] ? __ext3_get_inode_loc+0xcf/0x360 [ext3]
> [  232.120013]  [<ffffffffa0101317>] ? __ext3_journal_get_write_access+0x27/0x60 [ext3]
> [  232.120013]  [<ffffffffa00eb213>] ? ext3_reserve_inode_write+0x73/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb27b>] ? ext3_mark_inode_dirty+0x3b/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffff8115ded6>] ? __mark_inode_dirty+0x36/0x230
> [  232.120013]  [<ffffffff811504a1>] ? update_time+0x71/0xb0
> [  232.120013]  [<ffffffff811536c9>] ? mnt_clone_write+0x9/0x20
> [  232.120013]  [<ffffffff81150581>] ? file_update_time+0xa1/0xf0
> [  232.120013]  [<ffffffff8103385c>] ? ptep_set_access_flags+0x6c/0x70
> [  232.120013]  [<ffffffff810e3f30>] ? __generic_file_aio_write+0x1a0/0x3c0
> [  232.120013]  [<ffffffff811396fb>] ? __sb_start_write+0x6b/0x130
> [  232.120013]  [<ffffffff810e41ce>] ? generic_file_aio_write+0x7e/0x100
> [  232.120013]  [<ffffffff81137484>] ? do_sync_write+0x94/0xd0
> [  232.120013]  [<ffffffff81137caa>] ? vfs_write+0xaa/0x160
> [  232.120013]  [<ffffffff81137f87>] ? sys_write+0x47/0x90
> [  232.120013]  [<ffffffff814e5765>] ? async_page_fault+0x25/0x30
> [  232.120013]  [<ffffffff814eca79>] ? system_call_fastpath+0x16/0x1b
> [  232.120013] Code: 54 24 2c f6 47 14 04 74 1f 41 bc e2 ff ff ff 48 81 c4 98 00 00 00 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 1f 40 00 4c 8b 27 <4d> 8b 3c 24 41 f6 07 02 75 d4 65 48 8b 04 25 80 b9 00 00 48 89 
> 
> Is this a known issue? If yes, can you point me to any relevant patches?
> 
> When I do an SCI(hardware) eject, I have not seen corruptions. The acpi driver is
> evaluating fewer objects in this path I think, but I don't see why corruption can't
> happen here as well.
> 
> I have seen similar problems with CONFIG_SLUB (I did not have debug_options
> there but I can also provide those if helpful)
> 
> [1] https://lkml.org/lkml/2012/9/6/635
> [2] https://lkml.org/lkml/2012/9/11/542
> [3] https://lkml.org/lkml/2012/9/20/37
> [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> 
> thanks,
> 
> - Vasilis
> 


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

* Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory
  2012-09-26 16:46 ` [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory Vasilis Liaskovitis
                     ` (3 preceding siblings ...)
  2012-10-09  6:16   ` Wen Congyang
@ 2012-10-09  8:11   ` Wen Congyang
  4 siblings, 0 replies; 62+ messages in thread
From: Wen Congyang @ 2012-10-09  8:11 UTC (permalink / raw)
  To: Vasilis Liaskovitis
  Cc: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux, rientjes,
	liuj97, len.brown, benh, paulus, cl, minchan.kim, akpm,
	kosaki.motohiro, isimatu.yasuaki

At 09/27/2012 12:46 AM, Vasilis Liaskovitis Wrote:
> Hi,
> 
> I am testing 3.6.0-rc7 with this v9 patchset plus more recent fixes [1],[2],[3]
> Running in a guest (qemu+seabios from [4]). 
> CONFIG_SLAB=y
> CONFIG_DEBUG_SLAB=y
> 
> After succesfull hot-add and online, I am doing a hot-remove with "echo 1 > /sys/bus/acpi/devices/PNP/eject"
> When I do the OSPM-eject, I often get slab corruption in "acpi-state" cache, or in other caches

The following patch can fix this problem:
https://lkml.org/lkml/2012/7/12/186

Thanks
Wen Congyang

> 
> [  170.566995] Slab corruption (Not tainted): Acpi-State start=ffff88009fc1e548, len=80
> [  170.567265] Redzone: 0x0/0x0.
> [  170.567399] Last user: [<          (null)>](0x0)
> [  170.567667] 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568078] 010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568487] 020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.568894] 030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569302] 040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> [  170.569712] Prev obj: start=000000009fc1e4d0, len=80
> [  170.569869] BUG: unable to handle kernel paging request at 000000009fc1e520
> [  170.570171] IP: [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.570397] PGD 7cf37067 PUD 0 
> [  170.570619] Oops: 0000 [#1] SMP 
> [  170.570843] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis microcode tpm tpm_bios psmouse parport_pc serio_raw evdev parport i2c_piix4 processor thermal_sys i2c_core button ext3 jbd mbcache sg sr_mod cdrom ata_generic virtio_net virtio_blk ata_piix libata scsi_mod virtio_pci virtio_ring virtio
> [  170.573474] CPU 0 
> [  170.573568] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [  170.573830] RIP: 0010:[<ffffffff8112803c>]  [<ffffffff8112803c>] print_objinfo+0x9c/0x110
> [  170.574106] RSP: 0018:ffff88003eaf3a70  EFLAGS: 00010202
> [  170.574268] RAX: 000000009fc1e4c8 RBX: 0000000000000002 RCX: 00000000000024b8
> [  170.574468] RDX: 000000009fc1e4c8 RSI: 000000009fc1e4c8 RDI: ffff88003e9bb980
> [  170.574668] RBP: ffff88003e9bb980 R08: ffff880037964078 R09: 0000000000000000
> [  170.574870] R10: 000000000000021e R11: 0000000000000002 R12: 000000009fc1e4c8
> [  170.575070] R13: 000000009fc1e520 R14: 000000000000004f R15: 00000000ffffffa5
> [  170.575274] FS:  00007fc6b7530700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [  170.575494] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [  170.575665] CR2: 000000009fc1e520 CR3: 000000007c9c1000 CR4: 00000000000006f0
> [  170.575870] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  170.576075] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  170.576276] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [  170.576507] Stack:
> [  170.576599]  0000000000000010 0000000001893fbe ffff88009fc1e000 0000000000000050
> [  170.576938]  000000009fc1e4c8 000000000000004f 00000000ffffffa5 ffffffff8112899f
> [  170.576938]  ffff88003eb309d8 ffffffff81712d6d ffff88003e9bb980 ffff88009fc1e540
> [  170.576938] Call Trace:
> [  170.576938]  [<ffffffff8112899f>] ? check_poison_obj+0x1df/0x1f0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff81128a9d>] ? cache_alloc_debugcheck_after.isra.52+0xed/0x220
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff8112beb5>] ? kmem_cache_alloc+0xb5/0x1e0
> [  170.576938]  [<ffffffff813047d0>] ? acpi_ut_create_generic_state+0x2f/0x4c
> [  170.576938]  [<ffffffff812edf2d>] ? acpi_ds_result_push+0x5d/0x12e
> [  170.576938]  [<ffffffff812ed127>] ? acpi_ds_exec_end_op+0x28e/0x3d3
> [  170.576938]  [<ffffffff812fd86a>] ? acpi_ps_parse_loop+0x79f/0x931
> [  170.576938]  [<ffffffff812fdd6c>] ? acpi_ps_parse_aml+0x89/0x261
> [  170.576938]  [<ffffffff812fe50c>] ? acpi_ps_execute_method+0x1be/0x266
> [  170.576938]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [  170.576938]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [  170.576938]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [  170.576938]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [  170.576938]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [  170.576938]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [  170.576938]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [  170.576938]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [  170.576938]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [  170.576938]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [  170.576938]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [  170.576938]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [  170.576938] Code: cb 75 dc 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 8b 7f 0c 4c 89 e2 e8 02 fd ff ff 4c 89 e6 49 89 c5 48 89 ef e8 d4 fc ff ff <49> 8b 55 00 48 8b 30 48 c7 c7 8c 39 6f 81 31 c0 e8 3e 34 3b 00 
> 
> Other times, the problem happens on a slab object free:
> 
> [   52.313366] Offlined Pages 32768
> [   52.800232] slab error in verify_redzone_free(): cache `Acpi-ParseExt': memory outside object was overwritten
> [   52.801298] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12
> [   52.802039] Call Trace:
> [   52.802443]  [<ffffffff811280cb>] ? __slab_error.isra.46+0x1b/0x30
> [   52.803199]  [<ffffffff811287b6>] ? cache_free_debugcheck+0x256/0x260
> [   52.803940]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.804645]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.805321]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.806023]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.806762]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.807499]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.808183]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.808897]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.809659]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] ffff88008f809670: redzone 1:0x0, redzone 2:0x0.
> [   52.810032] ------------[ cut here ]------------
> [   52.810032] kernel BUG at mm/slab.c:3125!
> [   52.810032] invalid opcode: 0000 [#1] SMP 
> [   52.810032] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm tpm_tis tpm tpm_bios microcode parport_pc parport evdev processor thermal_sys psmouse i2c_piix4 serio_raw i2c_core button ext3 jbd mbcache sg sr_mod cdrom virtio_net ata_generic virtio_blk virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [   52.810032] CPU 0 
> [   52.810032] Pid: 29, comm: kworker/0:1 Not tainted 3.6.0-rc7-guest #12 Bochs Bochs
> [   52.810032] RIP: 0010:[<ffffffff81128733>]  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032] RSP: 0018:ffff88003eaf3bc0  EFLAGS: 00010093
> [   52.810032] RAX: 00000000017eac3c RBX: ffff88003e9bb700 RCX: 0000000002aaaaab
> [   52.810032] RDX: 0000000000000000 RSI: 0000000000010000 RDI: 0000000000000060
> [   52.810032] RBP: ffff88008f809670 R08: 09f911029d74e35b R09: 0000000000000000
> [   52.810032] R10: 00000000000001d3 R11: 0000000000000002 R12: ffff88008f809000
> [   52.810032] R13: ffffffff812e1b0e R14: 0000000000000000 R15: 0000000000010c00
> [   52.810032] FS:  00007f63fc263700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
> [   52.810032] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [   52.810032] CR2: 00007fff8d895b78 CR3: 000000007c866000 CR4: 00000000000006f0
> [   52.810032] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   52.810032] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [   52.810032] Process kworker/0:1 (pid: 29, threadinfo ffff88003eaf2000, task ffff88003ea941c0)
> [   52.810032] Stack:
> [   52.810032]  ffff88003e9bb980 ffff88008f809670 ffff880037ba8e18 ffff88008f809678
> [   52.810032]  ffff88003e9bb700 0000000000000282 ffff88003e9bf270 ffffffff812e1b0e
> [   52.810032]  0000000000000001 ffffffff81128fe3 ffff88003e80f5e8 ffff88003eb31748
> [   52.810032] Call Trace:
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff81128fe3>] ? kmem_cache_free+0x63/0x260
> [   52.810032]  [<ffffffff812e1b0e>] ? acpi_os_release_object+0x7/0xc
> [   52.810032]  [<ffffffff812fe298>] ? acpi_ps_delete_parse_tree+0x34/0x58
> [   52.810032]  [<ffffffff812fe517>] ? acpi_ps_execute_method+0x1c9/0x266
> [   52.810032]  [<ffffffff812f91f7>] ? acpi_ns_evaluate+0xd3/0x19a
> [   52.810032]  [<ffffffff812fb93e>] ? acpi_evaluate_object+0xf3/0x1f4
> [   52.810032]  [<ffffffff812e1104>] ? acpi_os_wait_events_complete+0x1b/0x1b
> [   52.810032]  [<ffffffff812e4782>] ? acpi_bus_hot_remove_device+0xeb/0x123
> [   52.810032]  [<ffffffff812e1121>] ? acpi_os_execute_deferred+0x1d/0x29
> [   52.810032]  [<ffffffff81058ec5>] ? process_one_work+0x125/0x560
> [   52.810032]  [<ffffffff81059e7a>] ? worker_thread+0x16a/0x4e0
> [   52.810032]  [<ffffffff81059d10>] ? manage_workers+0x310/0x310
> [   52.810032]  [<ffffffff8105e6c5>] ? kthread+0x85/0x90
> [   52.810032]  [<ffffffff814eb2c4>] ? kernel_thread_helper+0x4/0x10
> [   52.810032]  [<ffffffff8105e640>] ? flush_kthread_worker+0xa0/0xa0
> [   52.810032]  [<ffffffff814eb2c0>] ? gs_change+0x13/0x13
> [   52.810032] Code: 89 ea 49 89 38 8b 73 14 8b 7b 0c e8 18 f6 ff ff 49 b8 5b e3 74 9d 02 11 f9 09 4c 89 00 44 8b 7b 14 44 89 f8 e9 fa fe ff ff 0f 0b <0f> 0b 48 8b 40 30 e9 d9 fe ff ff e8 c6 43 3b 00 0f 0b 48 8b 40 
> [   52.810032] RIP  [<ffffffff81128733>] cache_free_debugcheck+0x1d3/0x260
> [   52.810032]  RSP <ffff88003eaf3bc0>
> [   52.810032] ---[ end trace c699c8cecd5870a3 ]---
> 
> 
> And other times, I see a filesystem related slab corruption when doing the eject.
> Here I have also seen a bad rss-counter state message. 
> 
> [  232.114232] BUG: Bad rss-counter state mm:ffff88007d9c1f80 idx:0 val:1
> [  232.115214] BUG: unable to handle kernel NULL pointer dereference at           (null)
> [  232.115807] IP: [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.116186] PGD 7cdec067 PUD 7c946067 PMD 0 
> [  232.116627] Oops: 0000 [#3] SMP 
> [  232.116990] Modules linked in: netconsole acpiphp pci_hotplug acpi_memhotplug loop kvm_amd kvm microcode tpm_tis tpm tpm_bios evdev psmouse serio_raw i2c_piix4 i2c_core parport_pc parport processor thermal_sys button ext3 jbd mbcache virtio_net sg sr_mod cdrom virtio_blk ata_generic virtio_pci virtio_ring virtio ata_piix libata scsi_mod
> [  232.120013] CPU 2 
> [  232.120013] Pid: 880, comm: dhclient Tainted: G      D      3.6.0-rc7-guest #1 Bochs Bochs
> [  232.120013] RIP: 0010:[<ffffffffa00cfce3>]  [<ffffffffa00cfce3>] do_get_write_access+0x43/0x480 [jbd]
> [  232.120013] RSP: 0018:ffff88007cd6fab8  EFLAGS: 00010246
> [  232.120013] RAX: ffff88003e513f50 RBX: ffff88003e513f50 RCX: 0000000000000000
> [  232.120013] RDX: 0000000000000000 RSI: ffff88003e513f50 RDI: ffff880097800000
> [  232.120013] RBP: ffff88003e513f50 R08: 000000003e513f01 R09: 0000000180240024
> [  232.120013] R10: ffff88003e513f50 R11: 00000000000198e0 R12: 0000000000000000
> [  232.120013] R13: ffffffffa00eb437 R14: ffff880097800000 R15: 000000000000027a
> [  232.120013] FS:  00007f082638d700(0000) GS:ffff88003ec80000(0000) knlGS:0000000000000000
> [  232.120013] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [  232.120013] CR2: 0000000000000000 CR3: 000000007c94c000 CR4: 00000000000006e0
> [  232.120013] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  232.120013] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [  232.120013] Process dhclient (pid: 880, threadinfo ffff88007cd6e000, task ffff88007ca46800)
> [  232.120013] Stack:
> [  232.120013]  ffff88007dc205b0 ffffffff8116645f ffff88007dc205b0 ffff88007dc205b0
> [  232.120013]  ffff88007cf58800 0000000000000000 000000000000000e 0000000000000000
> [  232.120013]  000000000000027a ffffffff8112b934 0000005000000003 0000000000000fff
> [  232.120013] Call Trace:
> [  232.120013]  [<ffffffff8116645f>] ? __find_get_block+0x7f/0x200
> [  232.120013]  [<ffffffff8112b934>] ? kmem_cache_alloc+0xe4/0x140
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffffa00d0279>] ? journal_get_write_access+0x29/0x50 [jbd]
> [  232.120013]  [<ffffffffa00eaeef>] ? __ext3_get_inode_loc+0xcf/0x360 [ext3]
> [  232.120013]  [<ffffffffa0101317>] ? __ext3_journal_get_write_access+0x27/0x60 [ext3]
> [  232.120013]  [<ffffffffa00eb213>] ? ext3_reserve_inode_write+0x73/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb27b>] ? ext3_mark_inode_dirty+0x3b/0xa0 [ext3]
> [  232.120013]  [<ffffffffa00eb437>] ? ext3_dirty_inode+0x57/0xb0 [ext3]
> [  232.120013]  [<ffffffff8115ded6>] ? __mark_inode_dirty+0x36/0x230
> [  232.120013]  [<ffffffff811504a1>] ? update_time+0x71/0xb0
> [  232.120013]  [<ffffffff811536c9>] ? mnt_clone_write+0x9/0x20
> [  232.120013]  [<ffffffff81150581>] ? file_update_time+0xa1/0xf0
> [  232.120013]  [<ffffffff8103385c>] ? ptep_set_access_flags+0x6c/0x70
> [  232.120013]  [<ffffffff810e3f30>] ? __generic_file_aio_write+0x1a0/0x3c0
> [  232.120013]  [<ffffffff811396fb>] ? __sb_start_write+0x6b/0x130
> [  232.120013]  [<ffffffff810e41ce>] ? generic_file_aio_write+0x7e/0x100
> [  232.120013]  [<ffffffff81137484>] ? do_sync_write+0x94/0xd0
> [  232.120013]  [<ffffffff81137caa>] ? vfs_write+0xaa/0x160
> [  232.120013]  [<ffffffff81137f87>] ? sys_write+0x47/0x90
> [  232.120013]  [<ffffffff814e5765>] ? async_page_fault+0x25/0x30
> [  232.120013]  [<ffffffff814eca79>] ? system_call_fastpath+0x16/0x1b
> [  232.120013] Code: 54 24 2c f6 47 14 04 74 1f 41 bc e2 ff ff ff 48 81 c4 98 00 00 00 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 1f 40 00 4c 8b 27 <4d> 8b 3c 24 41 f6 07 02 75 d4 65 48 8b 04 25 80 b9 00 00 48 89 
> 
> Is this a known issue? If yes, can you point me to any relevant patches?
> 
> When I do an SCI(hardware) eject, I have not seen corruptions. The acpi driver is
> evaluating fewer objects in this path I think, but I don't see why corruption can't
> happen here as well.
> 
> I have seen similar problems with CONFIG_SLUB (I did not have debug_options
> there but I can also provide those if helpful)
> 
> [1] https://lkml.org/lkml/2012/9/6/635
> [2] https://lkml.org/lkml/2012/9/11/542
> [3] https://lkml.org/lkml/2012/9/20/37
> [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> 
> thanks,
> 
> - Vasilis
> 


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

end of thread, other threads:[~2012-10-09  8:06 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05  9:25 [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory wency
2012-09-05  9:25 ` [RFC v9 PATCH 01/21] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages() wency
2012-09-28  2:22   ` Ni zhan Chen
2012-09-28  3:50     ` Yasuaki Ishimatsu
2012-09-28 22:15       ` KOSAKI Motohiro
2012-10-02  1:18         ` Yasuaki Ishimatsu
2012-10-02 17:29           ` KOSAKI Motohiro
2012-09-05  9:25 ` [RFC v9 PATCH 02/21] memory-hotplug: implement offline_memory() wency
2012-09-05  9:25 ` [RFC v9 PATCH 03/21] memory-hotplug: store the node id in acpi_memory_device wency
2012-09-28  3:21   ` Ni zhan Chen
2012-10-01  7:38     ` Yasuaki Ishimatsu
2012-09-05  9:25 ` [RFC v9 PATCH 04/21] memory-hotplug: offline and remove memory when removing the memory device wency
2012-09-28  4:48   ` Ni zhan Chen
2012-09-05  9:25 ` [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not wency
2012-09-11  2:15   ` Wen Congyang
2012-09-11  2:24     ` Yasuaki Ishimatsu
2012-09-11  2:46       ` Wen Congyang
2012-09-28  3:37       ` Ni zhan Chen
2012-09-05  9:25 ` [RFC v9 PATCH 06/21] memory-hotplug: export the function acpi_bus_remove() wency
2012-10-02  0:34   ` Ni zhan Chen
2012-10-02 17:28     ` KOSAKI Motohiro
2012-09-05  9:25 ` [RFC v9 PATCH 07/21] memory-hotplug: call acpi_bus_remove() to remove memory device wency
2012-09-05  9:25 ` [RFC v9 PATCH 08/21] memory-hotplug: remove /sys/firmware/memmap/X sysfs wency
2012-09-05  9:25 ` [RFC v9 PATCH 09/21] memory-hotplug: does not release memory region in PAGES_PER_SECTION chunks wency
2012-09-05  9:25 ` [RFC v9 PATCH 10/21] memory-hotplug: add memory_block_release wency
2012-09-05  9:25 ` [RFC v9 PATCH 11/21] memory-hotplug: remove_memory calls __remove_pages wency
2012-09-05  9:25 ` [RFC v9 PATCH 12/21] memory-hotplug: introduce new function arch_remove_memory() wency
2012-09-05  9:25 ` [RFC v9 PATCH 13/21] memory-hotplug: check page type in get_page_bootmem wency
2012-09-29  2:15   ` Ni zhan Chen
2012-10-01  3:03     ` Yasuaki Ishimatsu
2012-10-02 12:24       ` Ni zhan Chen
2012-09-05  9:25 ` [RFC v9 PATCH 14/21] memory-hotplug: move register_page_bootmem_info_node and put_page_bootmem for sparse-vmemmap wency
2012-09-05  9:25 ` [RFC v9 PATCH 15/21] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap wency
2012-09-05  9:25 ` [RFC v9 PATCH 16/21] memory-hotplug: free memmap " wency
2012-10-02  4:21   ` Ni zhan Chen
2012-10-04  6:26     ` Yasuaki Ishimatsu
2012-10-06 14:18       ` Ni zhan Chen
2012-09-05  9:25 ` [RFC v9 PATCH 17/21] memory_hotplug: clear zone when the memory is removed wency
2012-09-05  9:25 ` [RFC v9 PATCH 18/21] memory-hotplug: add node_device_release wency
2012-09-05  9:25 ` [RFC v9 PATCH 19/21] memory-hotplug: remove sysfs file of node wency
2012-09-05  9:25 ` [RFC v9 PATCH 20/21] memory-hotplug: clear hwpoisoned flag when onlining pages wency
2012-09-06  7:27   ` andywu106建国
2012-09-06  8:41     ` Wen Congyang
2012-09-05  9:25 ` [RFC v9 PATCH 21/21] memory-hotplug: auto offline page_cgroup when onlining memory block failed wency
2012-09-26 16:46 ` [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory Vasilis Liaskovitis
2012-09-27  0:59   ` Wen Congyang
2012-09-27  6:37   ` Wen Congyang
2012-09-27 10:35     ` Vasilis Liaskovitis
2012-09-28  1:41       ` Wen Congyang
2012-10-08 10:19   ` Wen Congyang
2012-10-09  6:16   ` Wen Congyang
2012-10-09  8:11   ` Wen Congyang
2012-09-26 16:58 ` Vasilis Liaskovitis
2012-09-27  1:03   ` Wen Congyang
2012-09-27  8:53   ` Wen Congyang
2012-09-27 10:06   ` Wen Congyang
2012-09-27 11:02     ` Vasilis Liaskovitis
2012-09-29  3:45 ` Ni zhan Chen
2012-09-29  8:19 ` Ni zhan Chen
2012-10-01  4:44   ` Yasuaki Ishimatsu
2012-10-01 23:45     ` Ni zhan Chen
2012-10-02  0:02       ` Yasuaki Ishimatsu

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).