linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block
@ 2013-08-02  1:57 Joonsoo Kim
  2013-08-02  1:57 ` [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func Joonsoo Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Joonsoo Kim @ 2013-08-02  1:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, linux-kernel, Zhang Yanfei, Joonsoo Kim,
	Johannes Weiner, Joonsoo Kim

vbq in vmap_block isn't used. So remove it.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 13a5495..d23c432 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -752,7 +752,6 @@ struct vmap_block_queue {
 struct vmap_block {
 	spinlock_t lock;
 	struct vmap_area *va;
-	struct vmap_block_queue *vbq;
 	unsigned long free, dirty;
 	DECLARE_BITMAP(dirty_map, VMAP_BBMAP_BITS);
 	struct list_head free_list;
@@ -830,7 +829,6 @@ static struct vmap_block *new_vmap_block(gfp_t gfp_mask)
 	radix_tree_preload_end();
 
 	vbq = &get_cpu_var(vmap_block_queue);
-	vb->vbq = vbq;
 	spin_lock(&vbq->lock);
 	list_add_rcu(&vb->free_list, &vbq->free);
 	spin_unlock(&vbq->lock);
-- 
1.7.9.5

--
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 related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func
  2013-08-02  1:57 [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block Joonsoo Kim
@ 2013-08-02  1:57 ` Joonsoo Kim
  2013-08-02  8:28   ` Wanpeng Li
                     ` (3 more replies)
  2013-08-02  8:14 ` [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block Wanpeng Li
                   ` (3 subsequent siblings)
  4 siblings, 4 replies; 11+ messages in thread
From: Joonsoo Kim @ 2013-08-02  1:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, linux-kernel, Zhang Yanfei, Joonsoo Kim,
	Johannes Weiner, Joonsoo Kim

Our intention in here is to find last_bit within the region to flush.
There is well-defined function, find_last_bit() for this purpose and
it's performance may be slightly better than current implementation.
So change it.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index d23c432..93d3182 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1016,15 +1016,16 @@ void vm_unmap_aliases(void)
 
 		rcu_read_lock();
 		list_for_each_entry_rcu(vb, &vbq->free, free_list) {
-			int i;
+			int i, j;
 
 			spin_lock(&vb->lock);
 			i = find_first_bit(vb->dirty_map, VMAP_BBMAP_BITS);
-			while (i < VMAP_BBMAP_BITS) {
+			if (i < VMAP_BBMAP_BITS) {
 				unsigned long s, e;
-				int j;
-				j = find_next_zero_bit(vb->dirty_map,
-					VMAP_BBMAP_BITS, i);
+
+				j = find_last_bit(vb->dirty_map,
+							VMAP_BBMAP_BITS);
+				j = j + 1; /* need exclusive index */
 
 				s = vb->va->va_start + (i << PAGE_SHIFT);
 				e = vb->va->va_start + (j << PAGE_SHIFT);
@@ -1034,10 +1035,6 @@ void vm_unmap_aliases(void)
 					start = s;
 				if (e > end)
 					end = e;
-
-				i = j;
-				i = find_next_bit(vb->dirty_map,
-							VMAP_BBMAP_BITS, i);
 			}
 			spin_unlock(&vb->lock);
 		}
-- 
1.7.9.5

--
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 related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block
  2013-08-02  1:57 [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block Joonsoo Kim
  2013-08-02  1:57 ` [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func Joonsoo Kim
@ 2013-08-02  8:14 ` Wanpeng Li
  2013-08-02  8:14 ` Wanpeng Li
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Wanpeng Li @ 2013-08-02  8:14 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Andrew Morton, linux-mm, linux-kernel, Zhang Yanfei, Joonsoo Kim,
	Johannes Weiner

On Fri, Aug 02, 2013 at 10:57:00AM +0900, Joonsoo Kim wrote:
>vbq in vmap_block isn't used. So remove it.
>
>Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>

Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>

>diff --git a/mm/vmalloc.c b/mm/vmalloc.c
>index 13a5495..d23c432 100644
>--- a/mm/vmalloc.c
>+++ b/mm/vmalloc.c
>@@ -752,7 +752,6 @@ struct vmap_block_queue {
> struct vmap_block {
> 	spinlock_t lock;
> 	struct vmap_area *va;
>-	struct vmap_block_queue *vbq;
> 	unsigned long free, dirty;
> 	DECLARE_BITMAP(dirty_map, VMAP_BBMAP_BITS);
> 	struct list_head free_list;
>@@ -830,7 +829,6 @@ static struct vmap_block *new_vmap_block(gfp_t gfp_mask)
> 	radix_tree_preload_end();
>
> 	vbq = &get_cpu_var(vmap_block_queue);
>-	vb->vbq = vbq;
> 	spin_lock(&vbq->lock);
> 	list_add_rcu(&vb->free_list, &vbq->free);
> 	spin_unlock(&vbq->lock);
>-- 
>1.7.9.5
>
>--
>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>

--
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] 11+ messages in thread

* Re: [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block
  2013-08-02  1:57 [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block Joonsoo Kim
  2013-08-02  1:57 ` [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func Joonsoo Kim
  2013-08-02  8:14 ` [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block Wanpeng Li
@ 2013-08-02  8:14 ` Wanpeng Li
  2013-08-02 19:15 ` Johannes Weiner
  2013-08-03  0:38 ` Yanfei Zhang
  4 siblings, 0 replies; 11+ messages in thread
From: Wanpeng Li @ 2013-08-02  8:14 UTC (permalink / raw)
  Cc: Andrew Morton, linux-mm, linux-kernel, Zhang Yanfei, Joonsoo Kim,
	Johannes Weiner, Joonsoo Kim

On Fri, Aug 02, 2013 at 10:57:00AM +0900, Joonsoo Kim wrote:
>vbq in vmap_block isn't used. So remove it.
>
>Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>

Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>

>diff --git a/mm/vmalloc.c b/mm/vmalloc.c
>index 13a5495..d23c432 100644
>--- a/mm/vmalloc.c
>+++ b/mm/vmalloc.c
>@@ -752,7 +752,6 @@ struct vmap_block_queue {
> struct vmap_block {
> 	spinlock_t lock;
> 	struct vmap_area *va;
>-	struct vmap_block_queue *vbq;
> 	unsigned long free, dirty;
> 	DECLARE_BITMAP(dirty_map, VMAP_BBMAP_BITS);
> 	struct list_head free_list;
>@@ -830,7 +829,6 @@ static struct vmap_block *new_vmap_block(gfp_t gfp_mask)
> 	radix_tree_preload_end();
>
> 	vbq = &get_cpu_var(vmap_block_queue);
>-	vb->vbq = vbq;
> 	spin_lock(&vbq->lock);
> 	list_add_rcu(&vb->free_list, &vbq->free);
> 	spin_unlock(&vbq->lock);
>-- 
>1.7.9.5
>
>--
>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>

--
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] 11+ messages in thread

* Re: [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func
  2013-08-02  1:57 ` [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func Joonsoo Kim
@ 2013-08-02  8:28   ` Wanpeng Li
  2013-08-02  8:28   ` Wanpeng Li
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Wanpeng Li @ 2013-08-02  8:28 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Andrew Morton, linux-mm, linux-kernel, Zhang Yanfei, Joonsoo Kim,
	Johannes Weiner

On Fri, Aug 02, 2013 at 10:57:01AM +0900, Joonsoo Kim wrote:
>Our intention in here is to find last_bit within the region to flush.
>There is well-defined function, find_last_bit() for this purpose and
>it's performance may be slightly better than current implementation.
>So change it.
>
>Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>

>
>diff --git a/mm/vmalloc.c b/mm/vmalloc.c
>index d23c432..93d3182 100644
>--- a/mm/vmalloc.c
>+++ b/mm/vmalloc.c
>@@ -1016,15 +1016,16 @@ void vm_unmap_aliases(void)
>
> 		rcu_read_lock();
> 		list_for_each_entry_rcu(vb, &vbq->free, free_list) {
>-			int i;
>+			int i, j;
>
> 			spin_lock(&vb->lock);
> 			i = find_first_bit(vb->dirty_map, VMAP_BBMAP_BITS);
>-			while (i < VMAP_BBMAP_BITS) {
>+			if (i < VMAP_BBMAP_BITS) {
> 				unsigned long s, e;
>-				int j;
>-				j = find_next_zero_bit(vb->dirty_map,
>-					VMAP_BBMAP_BITS, i);
>+
>+				j = find_last_bit(vb->dirty_map,
>+							VMAP_BBMAP_BITS);
>+				j = j + 1; /* need exclusive index */
>
> 				s = vb->va->va_start + (i << PAGE_SHIFT);
> 				e = vb->va->va_start + (j << PAGE_SHIFT);
>@@ -1034,10 +1035,6 @@ void vm_unmap_aliases(void)
> 					start = s;
> 				if (e > end)
> 					end = e;
>-
>-				i = j;
>-				i = find_next_bit(vb->dirty_map,
>-							VMAP_BBMAP_BITS, i);
> 			}
> 			spin_unlock(&vb->lock);
> 		}
>-- 
>1.7.9.5
>
>--
>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>

--
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] 11+ messages in thread

* Re: [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func
  2013-08-02  1:57 ` [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func Joonsoo Kim
  2013-08-02  8:28   ` Wanpeng Li
@ 2013-08-02  8:28   ` Wanpeng Li
  2013-08-02 19:22   ` Johannes Weiner
  2013-08-03  0:46   ` Yanfei Zhang
  3 siblings, 0 replies; 11+ messages in thread
From: Wanpeng Li @ 2013-08-02  8:28 UTC (permalink / raw)
  Cc: Andrew Morton, linux-mm, linux-kernel, Zhang Yanfei, Joonsoo Kim,
	Johannes Weiner, Joonsoo Kim

On Fri, Aug 02, 2013 at 10:57:01AM +0900, Joonsoo Kim wrote:
>Our intention in here is to find last_bit within the region to flush.
>There is well-defined function, find_last_bit() for this purpose and
>it's performance may be slightly better than current implementation.
>So change it.
>
>Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>

>
>diff --git a/mm/vmalloc.c b/mm/vmalloc.c
>index d23c432..93d3182 100644
>--- a/mm/vmalloc.c
>+++ b/mm/vmalloc.c
>@@ -1016,15 +1016,16 @@ void vm_unmap_aliases(void)
>
> 		rcu_read_lock();
> 		list_for_each_entry_rcu(vb, &vbq->free, free_list) {
>-			int i;
>+			int i, j;
>
> 			spin_lock(&vb->lock);
> 			i = find_first_bit(vb->dirty_map, VMAP_BBMAP_BITS);
>-			while (i < VMAP_BBMAP_BITS) {
>+			if (i < VMAP_BBMAP_BITS) {
> 				unsigned long s, e;
>-				int j;
>-				j = find_next_zero_bit(vb->dirty_map,
>-					VMAP_BBMAP_BITS, i);
>+
>+				j = find_last_bit(vb->dirty_map,
>+							VMAP_BBMAP_BITS);
>+				j = j + 1; /* need exclusive index */
>
> 				s = vb->va->va_start + (i << PAGE_SHIFT);
> 				e = vb->va->va_start + (j << PAGE_SHIFT);
>@@ -1034,10 +1035,6 @@ void vm_unmap_aliases(void)
> 					start = s;
> 				if (e > end)
> 					end = e;
>-
>-				i = j;
>-				i = find_next_bit(vb->dirty_map,
>-							VMAP_BBMAP_BITS, i);
> 			}
> 			spin_unlock(&vb->lock);
> 		}
>-- 
>1.7.9.5
>
>--
>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>

--
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] 11+ messages in thread

* Re: [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block
  2013-08-02  1:57 [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block Joonsoo Kim
                   ` (2 preceding siblings ...)
  2013-08-02  8:14 ` Wanpeng Li
@ 2013-08-02 19:15 ` Johannes Weiner
  2013-08-03  0:38 ` Yanfei Zhang
  4 siblings, 0 replies; 11+ messages in thread
From: Johannes Weiner @ 2013-08-02 19:15 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Andrew Morton, linux-mm, linux-kernel, Zhang Yanfei, Joonsoo Kim

On Fri, Aug 02, 2013 at 10:57:00AM +0900, Joonsoo Kim wrote:
> vbq in vmap_block isn't used. So remove it.
> 
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

--
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] 11+ messages in thread

* Re: [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func
  2013-08-02  1:57 ` [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func Joonsoo Kim
  2013-08-02  8:28   ` Wanpeng Li
  2013-08-02  8:28   ` Wanpeng Li
@ 2013-08-02 19:22   ` Johannes Weiner
  2013-08-03  0:46   ` Yanfei Zhang
  3 siblings, 0 replies; 11+ messages in thread
From: Johannes Weiner @ 2013-08-02 19:22 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Andrew Morton, linux-mm, linux-kernel, Zhang Yanfei, Joonsoo Kim

On Fri, Aug 02, 2013 at 10:57:01AM +0900, Joonsoo Kim wrote:
> Our intention in here is to find last_bit within the region to flush.
> There is well-defined function, find_last_bit() for this purpose and
> it's performance may be slightly better than current implementation.
> So change it.
> 
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

--
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] 11+ messages in thread

* Re: [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block
  2013-08-02  1:57 [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block Joonsoo Kim
                   ` (3 preceding siblings ...)
  2013-08-02 19:15 ` Johannes Weiner
@ 2013-08-03  0:38 ` Yanfei Zhang
  2013-08-03  0:44   ` Yanfei Zhang
  4 siblings, 1 reply; 11+ messages in thread
From: Yanfei Zhang @ 2013-08-03  0:38 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Andrew Morton, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Zhang Yanfei, Joonsoo Kim, Johannes Weiner

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

On Friday, August 2, 2013, Joonsoo Kim wrote:

> vbq in vmap_block isn't used. So remove it.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com <javascript:;>>


Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.con>


> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 13a5495..d23c432 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -752,7 +752,6 @@ struct vmap_block_queue {
>  struct vmap_block {
>         spinlock_t lock;
>         struct vmap_area *va;
> -       struct vmap_block_queue *vbq;
>         unsigned long free, dirty;
>         DECLARE_BITMAP(dirty_map, VMAP_BBMAP_BITS);
>         struct list_head free_list;
> @@ -830,7 +829,6 @@ static struct vmap_block *new_vmap_block(gfp_t
> gfp_mask)
>         radix_tree_preload_end();
>
>         vbq = &get_cpu_var(vmap_block_queue);
> -       vb->vbq = vbq;
>         spin_lock(&vbq->lock);
>         list_add_rcu(&vb->free_list, &vbq->free);
>         spin_unlock(&vbq->lock);
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org <javascript:;>
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

[-- Attachment #2: Type: text/html, Size: 2022 bytes --]

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

* Re: [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block
  2013-08-03  0:38 ` Yanfei Zhang
@ 2013-08-03  0:44   ` Yanfei Zhang
  0 siblings, 0 replies; 11+ messages in thread
From: Yanfei Zhang @ 2013-08-03  0:44 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Andrew Morton, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Zhang Yanfei, Joonsoo Kim, Johannes Weiner

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

On Saturday, August 3, 2013, Yanfei Zhang wrote:

> On Friday, August 2, 2013, Joonsoo Kim wrote:
>
>> vbq in vmap_block isn't used. So remove it.
>>
>> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>
>
> Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.con>
>

Sorry, the mail was wrongly written, it should be :

Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>


>
>
>> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
>> index 13a5495..d23c432 100644
>> --- a/mm/vmalloc.c
>> +++ b/mm/vmalloc.c
>> @@ -752,7 +752,6 @@ struct vmap_block_queue {
>>  struct vmap_block {
>>         spinlock_t lock;
>>         struct vmap_area *va;
>> -       struct vmap_block_queue *vbq;
>>         unsigned long free, dirty;
>>         DECLARE_BITMAP(dirty_map, VMAP_BBMAP_BITS);
>>         struct list_head free_list;
>> @@ -830,7 +829,6 @@ static struct vmap_block *new_vmap_block(gfp_t
>> gfp_mask)
>>         radix_tree_preload_end();
>>
>>         vbq = &get_cpu_var(vmap_block_queue);
>> -       vb->vbq = vbq;
>>         spin_lock(&vbq->lock);
>>         list_add_rcu(&vb->free_list, &vbq->free);
>>         spin_unlock(&vbq->lock);
>> --
>> 1.7.9.5
>>
>> --
>> 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/
>>
>

[-- Attachment #2: Type: text/html, Size: 2549 bytes --]

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

* Re: [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func
  2013-08-02  1:57 ` [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func Joonsoo Kim
                     ` (2 preceding siblings ...)
  2013-08-02 19:22   ` Johannes Weiner
@ 2013-08-03  0:46   ` Yanfei Zhang
  3 siblings, 0 replies; 11+ messages in thread
From: Yanfei Zhang @ 2013-08-03  0:46 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Andrew Morton, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Zhang Yanfei, Joonsoo Kim, Johannes Weiner

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

On Friday, August 2, 2013, Joonsoo Kim wrote:

> Our intention in here is to find last_bit within the region to flush.
> There is well-defined function, find_last_bit() for this purpose and
> it's performance may be slightly better than current implementation.
> So change it.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com <javascript:;>>


Looks reasonable.

Acked-by: Zhang Yanfei
<zhangyanfei@cn.fujitsu.com<https://mail.google.com/mail/mu/mp/219/?source=nap&hr=1&hl=en>
>


>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index d23c432..93d3182 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -1016,15 +1016,16 @@ void vm_unmap_aliases(void)
>
>                 rcu_read_lock();
>                 list_for_each_entry_rcu(vb, &vbq->free, free_list) {
> -                       int i;
> +                       int i, j;
>
>                         spin_lock(&vb->lock);
>                         i = find_first_bit(vb->dirty_map, VMAP_BBMAP_BITS);
> -                       while (i < VMAP_BBMAP_BITS) {
> +                       if (i < VMAP_BBMAP_BITS) {
>                                 unsigned long s, e;
> -                               int j;
> -                               j = find_next_zero_bit(vb->dirty_map,
> -                                       VMAP_BBMAP_BITS, i);
> +
> +                               j = find_last_bit(vb->dirty_map,
> +                                                       VMAP_BBMAP_BITS);
> +                               j = j + 1; /* need exclusive index */
>
>                                 s = vb->va->va_start + (i << PAGE_SHIFT);
>                                 e = vb->va->va_start + (j << PAGE_SHIFT);
> @@ -1034,10 +1035,6 @@ void vm_unmap_aliases(void)
>                                         start = s;
>                                 if (e > end)
>                                         end = e;
> -
> -                               i = j;
> -                               i = find_next_bit(vb->dirty_map,
> -                                                       VMAP_BBMAP_BITS,
> i);
>                         }
>                         spin_unlock(&vb->lock);
>                 }
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org <javascript:;>
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

[-- Attachment #2: Type: text/html, Size: 3825 bytes --]

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

end of thread, other threads:[~2013-08-03  0:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-02  1:57 [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block Joonsoo Kim
2013-08-02  1:57 ` [PATCH 2/2] mm, vmalloc: use well-defined find_last_bit() func Joonsoo Kim
2013-08-02  8:28   ` Wanpeng Li
2013-08-02  8:28   ` Wanpeng Li
2013-08-02 19:22   ` Johannes Weiner
2013-08-03  0:46   ` Yanfei Zhang
2013-08-02  8:14 ` [PATCH 1/2] mm, vmalloc: remove useless variable in vmap_block Wanpeng Li
2013-08-02  8:14 ` Wanpeng Li
2013-08-02 19:15 ` Johannes Weiner
2013-08-03  0:38 ` Yanfei Zhang
2013-08-03  0:44   ` Yanfei Zhang

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