All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-vmalloc-use-well-defined-find_last_bit-func.patch added to -mm tree
@ 2013-08-07 21:05 akpm
  2013-08-08  0:54 ` Zhang Yanfei
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2013-08-07 21:05 UTC (permalink / raw)
  To: mm-commits, zhangyanfei, liwanp, hannes, iamjoonsoo.kim

Subject: + mm-vmalloc-use-well-defined-find_last_bit-func.patch added to -mm tree
To: iamjoonsoo.kim@lge.com,hannes@cmpxchg.org,liwanp@linux.vnet.ibm.com,zhangyanfei@cn.fujitsu.con
From: akpm@linux-foundation.org
Date: Wed, 07 Aug 2013 14:05:29 -0700


The patch titled
     Subject: mm, vmalloc: use well-defined find_last_bit() func
has been added to the -mm tree.  Its filename is
     mm-vmalloc-use-well-defined-find_last_bit-func.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-vmalloc-use-well-defined-find_last_bit-func.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-vmalloc-use-well-defined-find_last_bit-func.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: mm, vmalloc: use well-defined find_last_bit() func

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 its
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>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.con>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/vmalloc.c |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff -puN mm/vmalloc.c~mm-vmalloc-use-well-defined-find_last_bit-func mm/vmalloc.c
--- a/mm/vmalloc.c~mm-vmalloc-use-well-defined-find_last_bit-func
+++ a/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);
 		}
_

Patches currently in -mm which might be from iamjoonsoo.kim@lge.com are

mm-hugetlb-move-up-the-code-which-check-availability-of-free-huge-page.patch
mm-hugetlb-trivial-commenting-fix.patch
mm-hugetlb-clean-up-alloc_huge_page.patch
mm-hugetlb-fix-and-clean-up-node-iteration-code-to-alloc-or-free.patch
mm-hugetlb-remove-redundant-list_empty-check-in-gather_surplus_pages.patch
mm-hugetlb-do-not-use-a-page-in-page-cache-for-cow-optimization.patch
mm-hugetlb-add-vm_noreserve-check-in-vma_has_reserves.patch
mm-hugetlb-remove-decrement_hugepage_resv_vma.patch
mm-hugetlb-decrement-reserve-count-if-vm_noreserve-alloc-page-cache.patch
mm-hugetlb-decrement-reserve-count-if-vm_noreserve-alloc-page-cache-fix.patch
mm-page_alloc-add-unlikely-macro-to-help-compiler-optimization.patch
mm-move-pgtable-related-functions-to-right-place.patch
swap-clean-up-ifdef-in-page_mapping.patch
mm-vmalloc-remove-useless-variable-in-vmap_block.patch
mm-vmalloc-use-well-defined-find_last_bit-func.patch


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

* Re: + mm-vmalloc-use-well-defined-find_last_bit-func.patch added to -mm tree
  2013-08-07 21:05 + mm-vmalloc-use-well-defined-find_last_bit-func.patch added to -mm tree akpm
@ 2013-08-08  0:54 ` Zhang Yanfei
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang Yanfei @ 2013-08-08  0:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, mm-commits, zhangyanfei, liwanp, hannes, iamjoonsoo.kim

Hi Andrew,

于 2013/8/8 5:05, akpm@linux-foundation.org 写道:
> Subject: + mm-vmalloc-use-well-defined-find_last_bit-func.patch added to -mm tree
> To: iamjoonsoo.kim@lge.com,hannes@cmpxchg.org,liwanp@linux.vnet.ibm.com,zhangyanfei@cn.fujitsu.con
> From: akpm@linux-foundation.org
> Date: Wed, 07 Aug 2013 14:05:29 -0700
> 
> 
> The patch titled
>      Subject: mm, vmalloc: use well-defined find_last_bit() func
> has been added to the -mm tree.  Its filename is
>      mm-vmalloc-use-well-defined-find_last_bit-func.patch
> 
> This patch should soon appear at
>     http://ozlabs.org/~akpm/mmots/broken-out/mm-vmalloc-use-well-defined-find_last_bit-func.patch
> and later at
>     http://ozlabs.org/~akpm/mmotm/broken-out/mm-vmalloc-use-well-defined-find_last_bit-func.patch
> 
> Before you just go and hit "reply", please:
>    a) Consider who else should be cc'ed
>    b) Prefer to cc a suitable mailing list as well
>    c) Ideally: find the original patch on the mailing list and do a
>       reply-to-all to that, adding suitable additional cc's
> 
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
> 
> The -mm tree is included into linux-next and is updated
> there every 3-4 working days
> 
> ------------------------------------------------------
> From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> Subject: mm, vmalloc: use well-defined find_last_bit() func
> 
> 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 its
> 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>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.con>

s/zhangyanfei@cn.fujitsu.con/zhangyanfei@cn.fujitsu.com/g

> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  mm/vmalloc.c |   15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff -puN mm/vmalloc.c~mm-vmalloc-use-well-defined-find_last_bit-func mm/vmalloc.c
> --- a/mm/vmalloc.c~mm-vmalloc-use-well-defined-find_last_bit-func
> +++ a/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);
>  		}
> _
> 
> Patches currently in -mm which might be from iamjoonsoo.kim@lge.com are
> 
> mm-hugetlb-move-up-the-code-which-check-availability-of-free-huge-page.patch
> mm-hugetlb-trivial-commenting-fix.patch
> mm-hugetlb-clean-up-alloc_huge_page.patch
> mm-hugetlb-fix-and-clean-up-node-iteration-code-to-alloc-or-free.patch
> mm-hugetlb-remove-redundant-list_empty-check-in-gather_surplus_pages.patch
> mm-hugetlb-do-not-use-a-page-in-page-cache-for-cow-optimization.patch
> mm-hugetlb-add-vm_noreserve-check-in-vma_has_reserves.patch
> mm-hugetlb-remove-decrement_hugepage_resv_vma.patch
> mm-hugetlb-decrement-reserve-count-if-vm_noreserve-alloc-page-cache.patch
> mm-hugetlb-decrement-reserve-count-if-vm_noreserve-alloc-page-cache-fix.patch
> mm-page_alloc-add-unlikely-macro-to-help-compiler-optimization.patch
> mm-move-pgtable-related-functions-to-right-place.patch
> swap-clean-up-ifdef-in-page_mapping.patch
> mm-vmalloc-remove-useless-variable-in-vmap_block.patch
> mm-vmalloc-use-well-defined-find_last_bit-func.patch
> 
> --
> To unsubscribe from this list: send the line "unsubscribe mm-commits" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-- 
Thanks.
Zhang Yanfei

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-07 21:05 + mm-vmalloc-use-well-defined-find_last_bit-func.patch added to -mm tree akpm
2013-08-08  0:54 ` Zhang Yanfei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.