linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch]mm: __tlb_remove_page checks correct batch
@ 2011-06-28  3:46 Shaohua Li
  2011-06-28  9:10 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: Shaohua Li @ 2011-06-28  3:46 UTC (permalink / raw)
  To: Andrew Morton; +Cc: a.p.zijlstra, linux-mm

__tlb_remove_page switchs to a new batch page, but still checks space in the
old batch. This check always fails, and causes force tlb flush.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

diff --git a/mm/memory.c b/mm/memory.c
index 40b7531..9b8a01d 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -305,6 +305,7 @@ int __tlb_remove_page(struct mmu_gather *tlb, struct page *page)
 	if (batch->nr == batch->max) {
 		if (!tlb_next_batch(tlb))
 			return 0;
+		batch = tlb->active;
 	}
 	VM_BUG_ON(batch->nr > batch->max);
 


--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [patch]mm: __tlb_remove_page checks correct batch
  2011-06-28  3:46 [patch]mm: __tlb_remove_page checks correct batch Shaohua Li
@ 2011-06-28  9:10 ` Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2011-06-28  9:10 UTC (permalink / raw)
  To: Shaohua Li; +Cc: Andrew Morton, linux-mm

On Tue, 2011-06-28 at 11:46 +0800, Shaohua Li wrote:
> __tlb_remove_page switchs to a new batch page, but still checks space in the
> old batch. This check always fails, and causes force tlb flush.
> 
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>

Indeed!

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>

> diff --git a/mm/memory.c b/mm/memory.c
> index 40b7531..9b8a01d 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -305,6 +305,7 @@ int __tlb_remove_page(struct mmu_gather *tlb, struct page *page)
>  	if (batch->nr == batch->max) {
>  		if (!tlb_next_batch(tlb))
>  			return 0;
> +		batch = tlb->active;
>  	}
>  	VM_BUG_ON(batch->nr > batch->max);
>  
> 
> 

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2011-06-28  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-28  3:46 [patch]mm: __tlb_remove_page checks correct batch Shaohua Li
2011-06-28  9:10 ` Peter Zijlstra

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