Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1186483 > unrolled thread

[PATCH] mm/rmap: disable preemption for trace_tlb_flush()

Started bySergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
First post2015-07-17 08:20 +0200
Last post2015-07-17 13:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm/rmap: disable preemption for trace_tlb_flush() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-07-17 08:20 +0200
    Re: [PATCH] mm/rmap: disable preemption for trace_tlb_flush() Mel Gorman <mgorman@suse.de> - 2015-07-17 12:40 +0200
      Re: [PATCH] mm/rmap: disable preemption for trace_tlb_flush() Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-07-17 13:30 +0200

#1186483 — [PATCH] mm/rmap: disable preemption for trace_tlb_flush()

FromSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date2015-07-17 08:20 +0200
Subject[PATCH] mm/rmap: disable preemption for trace_tlb_flush()
Message-ID<pN7a2-5ys-5@gated-at.bofh.it>
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

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

[toc] | [next] | [standalone]


#1186683

FromMel Gorman <mgorman@suse.de>
Date2015-07-17 12:40 +0200
Message-ID<pNbdD-2PM-1@gated-at.bofh.it>
In reply to#1186483
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
--
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/

[toc] | [prev] | [next] | [standalone]


#1186722

FromSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Date2015-07-17 13:30 +0200
Message-ID<pNc02-3ZN-7@gated-at.bofh.it>
In reply to#1186683
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
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web