Skip to contentSkip to conversation

mm/vmalloc: don't set area->caller twice

PATCH Superseded Wanpeng Li 2 participants 8 messages Sep 3, 2013

Subsystems (2)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Wanpeng Li

author
#0 lore raw

PATCH v2 1/3 mm/vmalloc: don't set area->caller twice

Changelog:
* rebase against mmotm tree

The caller address has already been set in set_vmalloc_vm(), there's no need to set it again in __vmalloc_area_node.

---
 mm/vmalloc.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
mm/vmalloc.c +0 -1
index 1074543..d78d117 100644
@@ -1566,7 +1566,6 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 		pages = kmalloc_node(array_size, nested_gfp, node);
 	}
 	area->pages = pages;
-	area->caller = caller;
 	if (!area->pages) {
 		remove_vm_area(area->addr);
 		kfree(area);
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH v2 2/3 mm/vmalloc: don't warning vmalloc allocation failure twice

Don't warning twice in __vmalloc_area_node and __vmalloc_node_range if __vmalloc_area_node allocation failure.

---
 mm/vmalloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/vmalloc.c +1 -1
index d78d117..e3ec8b4 100644
@@ -1635,7 +1635,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
 
 	addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller);
 	if (!addr)
-		goto fail;
+		return NULL;
 
 	/*
 	 * In this function, newly allocated vm_struct has VM_UNINITIALIZED
Signature · 7 lines
1.7.5.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#2 lore raw

Re: [PATCH v2 2/3] mm/vmalloc: don't warning vmalloc allocation failure twice

Quoted 4 lines · Wanpeng Li

Don't warning twice in __vmalloc_area_node and __vmalloc_node_range if __vmalloc_area_node allocation failure.

OK, I missed the warning in __vmalloc_area_node(), so you are right. You can just revert the commit 46c001a2753f47ffa621131baa3409e636515347.

Quoted 18 lines
---
 mm/vmalloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/vmalloc.c +1 -1
index d78d117..e3ec8b4 100644
@@ -1635,7 +1635,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
 
 	addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller);
 	if (!addr)
-		goto fail;
+		return NULL;
 
 	/*
 	 * In this function, newly allocated vm_struct has VM_UNINITIALIZED
Signature · 8 lines
Thanks.
Zhang Yanfei

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
author
#3 lore raw

PATCH v2 3/3 mm/vmalloc: move VM_UNINITIALIZED just before show_numa_info

In reply to Wanpeng Li

The VM_UNINITIALIZED/VM_UNLIST flag introduced by commit f5252e00(mm: avoid null pointer access in vm_struct via /proc/vmallocinfo) is used to avoid accessing the pages field with unallocated page when show_numa_info() is called. This patch move the check just before show_numa_info in order that some messages still can be dumped via /proc/vmallocinfo.

---
 mm/vmalloc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
mm/vmalloc.c +5 -5
index e3ec8b4..c4720cd 100644
@@ -2590,11 +2590,6 @@ static int s_show(struct seq_file *m, void *p)
 
 	v = va->vm;
 
-	/* Pair with smp_wmb() in clear_vm_uninitialized_flag() */
-	smp_rmb();
-	if (v->flags & VM_UNINITIALIZED)
-		return 0;
-
 	seq_printf(m, "0x%pK-0x%pK %7ld",
 		v->addr, v->addr + v->size, v->size);
 
@@ -2622,6 +2617,11 @@ static int s_show(struct seq_file *m, void *p)
 	if (v->flags & VM_VPAGES)
 		seq_printf(m, " vpages");
 
+	/* Pair with smp_wmb() in clear_vm_uninitialized_flag() */
+	smp_rmb();
+	if (v->flags & VM_UNINITIALIZED)
+		return 0;
+
 	show_numa_info(m, v);
 	seq_putc(m, '\n');
 	return 0;
Signature · 7 lines
1.7.5.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#4 lore raw

Re: [PATCH v2 3/3] mm/vmalloc: move VM_UNINITIALIZED just before show_numa_info

Quoted 7 lines · Wanpeng Li

The VM_UNINITIALIZED/VM_UNLIST flag introduced by commit f5252e00(mm: avoid null pointer access in vm_struct via /proc/vmallocinfo) is used to avoid accessing the pages field with unallocated page when show_numa_info() is called. This patch move the check just before show_numa_info in order that some messages still can be dumped via /proc/vmallocinfo.

Hmmm, sorry again. Please revert commit d157a55815ffff48caec311dfb543ce8a79e283e. That said, we could still do the check in show_numa_info like before.

Quoted 33 lines
---
 mm/vmalloc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
mm/vmalloc.c +5 -5
index e3ec8b4..c4720cd 100644
@@ -2590,11 +2590,6 @@ static int s_show(struct seq_file *m, void *p)
 
 	v = va->vm;
 
-	/* Pair with smp_wmb() in clear_vm_uninitialized_flag() */
-	smp_rmb();
-	if (v->flags & VM_UNINITIALIZED)
-		return 0;
-
 	seq_printf(m, "0x%pK-0x%pK %7ld",
 		v->addr, v->addr + v->size, v->size);
 
@@ -2622,6 +2617,11 @@ static int s_show(struct seq_file *m, void *p)
 	if (v->flags & VM_VPAGES)
 		seq_printf(m, " vpages");
 
+	/* Pair with smp_wmb() in clear_vm_uninitialized_flag() */
+	smp_rmb();
+	if (v->flags & VM_UNINITIALIZED)
+		return 0;
+
 	show_numa_info(m, v);
 	seq_putc(m, '\n');
 	return 0;
Signature · 8 lines
Thanks.
Zhang Yanfei

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
author
#5 lore raw

Re: [PATCH v2 3/3] mm/vmalloc: move VM_UNINITIALIZED just before show_numa_info

Quoted 7 lines · Zhang Yanfei
Quoted 6 lines · Wanpeng Li

The VM_UNINITIALIZED/VM_UNLIST flag introduced by commit f5252e00(mm: avoid null pointer access in vm_struct via /proc/vmallocinfo) is used to avoid accessing the pages field with unallocated page when show_numa_info() is called. This patch move the check just before show_numa_info in order that some messages still can be dumped via /proc/vmallocinfo.

Quoted 6 lines
Quoted 1 line

Hmmm, sorry again. Please revert commit d157a55815ffff48caec311dfb543ce8a79e283e. That said, we could still do the check in show_numa_info like before.

Ok.

Regards,
Wanpeng Li

Quoted 24 lines
Quoted 24 lines
---
 mm/vmalloc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
mm/vmalloc.c +0 -5
index e3ec8b4..c4720cd 100644
@@ -2590,11 +2590,6 @@ static int s_show(struct seq_file *m, void *p)
 
 	v = va->vm;
 
-	/* Pair with smp_wmb() in clear_vm_uninitialized_flag() */
-	smp_rmb();
-	if (v->flags & VM_UNINITIALIZED)
-		return 0;
-
 	seq_printf(m, "0x%pK-0x%pK %7ld",
 		v->addr, v->addr + v->size, v->size);
 
@@ -2622,6 +2617,11 @@ static int s_show(struct seq_file *m, void *p)
 	if (v->flags & VM_VPAGES)
 		seq_printf(m, " vpages");
 
Quoted 14 lines
Quoted 9 lines
mm/vmalloc.c +5 -0
+	/* Pair with smp_wmb() in clear_vm_uninitialized_flag() */
+	smp_rmb();
+	if (v->flags & VM_UNINITIALIZED)
+		return 0;
+
 	show_numa_info(m, v);
 	seq_putc(m, '\n');
 	return 0;
Signature · 2 lines
Thanks.
Zhang Yanfei

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#6 lore raw

Re: [PATCH v2 3/3] mm/vmalloc: move VM_UNINITIALIZED just before show_numa_info

In reply to Zhang Yanfei
Quoted 7 lines · Zhang Yanfei
Quoted 6 lines · Wanpeng Li

The VM_UNINITIALIZED/VM_UNLIST flag introduced by commit f5252e00(mm: avoid null pointer access in vm_struct via /proc/vmallocinfo) is used to avoid accessing the pages field with unallocated page when show_numa_info() is called. This patch move the check just before show_numa_info in order that some messages still can be dumped via /proc/vmallocinfo.

Quoted 6 lines
Quoted 1 line

Hmmm, sorry again. Please revert commit d157a55815ffff48caec311dfb543ce8a79e283e. That said, we could still do the check in show_numa_info like before.

Ok.

Regards,
Wanpeng Li

Quoted 24 lines
Quoted 24 lines
---
 mm/vmalloc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
mm/vmalloc.c +0 -5
index e3ec8b4..c4720cd 100644
@@ -2590,11 +2590,6 @@ static int s_show(struct seq_file *m, void *p)
 
 	v = va->vm;
 
-	/* Pair with smp_wmb() in clear_vm_uninitialized_flag() */
-	smp_rmb();
-	if (v->flags & VM_UNINITIALIZED)
-		return 0;
-
 	seq_printf(m, "0x%pK-0x%pK %7ld",
 		v->addr, v->addr + v->size, v->size);
 
@@ -2622,6 +2617,11 @@ static int s_show(struct seq_file *m, void *p)
 	if (v->flags & VM_VPAGES)
 		seq_printf(m, " vpages");
 
Quoted 14 lines
Quoted 9 lines
mm/vmalloc.c +5 -0
+	/* Pair with smp_wmb() in clear_vm_uninitialized_flag() */
+	smp_rmb();
+	if (v->flags & VM_UNINITIALIZED)
+		return 0;
+
 	show_numa_info(m, v);
 	seq_putc(m, '\n');
 	return 0;
Signature · 2 lines
Thanks.
Zhang Yanfei

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Reviewed-by on v2 1/3
#7 lore raw
In reply to Wanpeng Li
Quoted 7 lines · Wanpeng Li

Changelog:
* rebase against mmotm tree

The caller address has already been set in set_vmalloc_vm(), there's no need to set it again in __vmalloc_area_node.

Quoted 17 lines
---
 mm/vmalloc.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
mm/vmalloc.c +0 -1
index 1074543..d78d117 100644
@@ -1566,7 +1566,6 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 		pages = kmalloc_node(array_size, nested_gfp, node);
 	}
 	area->pages = pages;
-	area->caller = caller;
 	if (!area->pages) {
 		remove_vm_area(area->addr);
 		kfree(area);
Signature · 8 lines
Thanks.
Zhang Yanfei

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>