LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/rmap: disable preemption for trace_tlb_flush()
@ 2015-07-17  6:12 Sergey Senozhatsky
  2015-07-17 10:39 ` Mel Gorman
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Senozhatsky @ 2015-07-17  6:12 UTC (permalink / raw
  To: Andrew Morton
  Cc: Mel Gorman, linux-mm, linux-kernel, Sergey Senozhatsky,
	Sergey Senozhatsky

tlb_flush contains TP_CONDITION(cpu_online(smp_processor_id()))
which is better be executed with preemption disabled.

Move trace_tlb_flush(TLB_REMOTE_SHOOTDOWN) in try_to_unmap_flush()
under get_cpu().

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 30812e9..74086cc 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -613,9 +613,9 @@ void try_to_unmap_flush(void)
 	if (!tlb_ubc->flush_required)
 		return;
 
+	cpu = get_cpu();
 	trace_tlb_flush(TLB_REMOTE_SHOOTDOWN, -1UL);
 
-	cpu = get_cpu();
 	if (cpumask_test_cpu(cpu, &tlb_ubc->cpumask))
 		percpu_flush_tlb_batch_pages(&tlb_ubc->cpumask);
 
-- 
2.4.6


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

* Re: [PATCH] mm/rmap: disable preemption for trace_tlb_flush()
  2015-07-17  6:12 [PATCH] mm/rmap: disable preemption for trace_tlb_flush() Sergey Senozhatsky
@ 2015-07-17 10:39 ` Mel Gorman
  2015-07-17 11:19   ` Sergey Senozhatsky
  0 siblings, 1 reply; 3+ messages in thread
From: Mel Gorman @ 2015-07-17 10:39 UTC (permalink / raw
  To: Sergey Senozhatsky
  Cc: Andrew Morton, linux-mm, linux-kernel, Sergey Senozhatsky

On Fri, Jul 17, 2015 at 03:12:54PM +0900, Sergey Senozhatsky wrote:
> tlb_flush contains TP_CONDITION(cpu_online(smp_processor_id()))
> which is better be executed with preemption disabled.
> 
> Move trace_tlb_flush(TLB_REMOTE_SHOOTDOWN) in try_to_unmap_flush()
> under get_cpu().
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

Your patch is valid but Sasha also had sent an almost identicial fix a few
hours ago for identical reasons that Andrew picked up. Thanks for sending
it in.

-- 
Mel Gorman
SUSE Labs

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

* Re: [PATCH] mm/rmap: disable preemption for trace_tlb_flush()
  2015-07-17 10:39 ` Mel Gorman
@ 2015-07-17 11:19   ` Sergey Senozhatsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Senozhatsky @ 2015-07-17 11:19 UTC (permalink / raw
  To: Mel Gorman
  Cc: Sergey Senozhatsky, Andrew Morton, linux-mm, linux-kernel,
	Sergey Senozhatsky

On (07/17/15 11:39), Mel Gorman wrote:
> On Fri, Jul 17, 2015 at 03:12:54PM +0900, Sergey Senozhatsky wrote:
> > tlb_flush contains TP_CONDITION(cpu_online(smp_processor_id()))
> > which is better be executed with preemption disabled.
> > 
> > Move trace_tlb_flush(TLB_REMOTE_SHOOTDOWN) in try_to_unmap_flush()
> > under get_cpu().
> > 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> 
> Your patch is valid but Sasha also had sent an almost identicial fix a few
> hours ago for identical reasons that Andrew picked up. Thanks for sending
> it in.

Oh, didn't know that. Thanks.

	-ss

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

end of thread, other threads:[~2015-07-17 11:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-17  6:12 [PATCH] mm/rmap: disable preemption for trace_tlb_flush() Sergey Senozhatsky
2015-07-17 10:39 ` Mel Gorman
2015-07-17 11:19   ` Sergey Senozhatsky

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 read-only IMAP folder(s) and NNTP newsgroup(s).