linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: [RFC patch] mm: hugetlb: fix __unmap_hugepage_range
Date: Fri, 31 Oct 2014 10:28:12 +0100	[thread overview]
Message-ID: <20141031092812.GB16840@dhcp22.suse.cz> (raw)
In-Reply-To: <028701cff4c2$3e9e2ca0$bbda85e0$@alibaba-inc.com>

[CCing people involved in 24669e58477e2]

On Fri 31-10-14 12:22:12, Hillf Danton wrote:
> First, after flushing TLB, we have no need to scan pte from start again.
> Second, before bail out loop, the address is forwarded one step.

I can imagine a more comprehensive wording here. It is not immediately
clear whether this is just an optimization or a bug fix as well
(especially the second part).

Anyway the optimization looks good to me.

> Signed-off-by: Hillf Danton <hillf.zj@alibaba-inc.com>

Reviewed-by: Michal Hocko <mhocko@suse.cz>

> ---
> 
> --- a/mm/hugetlb.c	Fri Oct 31 11:47:25 2014
> +++ b/mm/hugetlb.c	Fri Oct 31 11:52:42 2014
> @@ -2641,8 +2641,9 @@ void __unmap_hugepage_range(struct mmu_g
>  
>  	tlb_start_vma(tlb, vma);
>  	mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
> +	address = start;
>  again:
> -	for (address = start; address < end; address += sz) {
> +	for (; address < end; address += sz) {
>  		ptep = huge_pte_offset(mm, address);
>  		if (!ptep)
>  			continue;
> @@ -2689,6 +2690,7 @@ again:
>  		page_remove_rmap(page);
>  		force_flush = !__tlb_remove_page(tlb, page);
>  		if (force_flush) {
> +			address += sz;
>  			spin_unlock(ptl);
>  			break;
>  		}
> --
> 
> 

-- 
Michal Hocko
SUSE Labs

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

  reply	other threads:[~2014-10-31  9:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31  4:22 Hillf Danton
2014-10-31  9:28 ` Michal Hocko [this message]
2014-11-03 23:36 ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141031092812.GB16840@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=hillf.zj@alibaba-inc.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox