From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754618Ab2BENt1 (ORCPT ); Sun, 5 Feb 2012 08:49:27 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:51550 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752130Ab2BENtZ (ORCPT ); Sun, 5 Feb 2012 08:49:25 -0500 MIME-Version: 1.0 From: Gilad Ben-Yossef To: linux-kernel@vger.kernel.org Cc: Gilad Ben-Yossef , Frederic Weisbecker , Russell King , Christoph Lameter , Chris Metcalf , linux-mm@kvack.org, Pekka Enberg , Matt Mackall , Rik van Riel , Andi Kleen , Sasha Levin , Mel Gorman , Andrew Morton , Alexander Viro , linux-fsdevel@vger.kernel.org, Avi Kivity , Michal Nazarewicz , Kosaki Motohiro , Milton Miller Subject: [PATCH v8 2/8] arm: move arm over to generic on_each_cpu_mask Date: Sun, 5 Feb 2012 15:48:36 +0200 Message-Id: <1328449722-15959-1-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1328448800-15794-1-git-send-email-gilad@benyossef.com> References: <1328448800-15794-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Note that the generic version is a little different then the Arm one: 1. It has the mask as first parameter 2. It calls the function on the calling CPU with interrupts disabled, but this should be OK since the function is called on the other CPUs with interrupts disabled anyway. Signed-off-by: Gilad Ben-Yossef Acked-by: Peter Zijlstra CC: Frederic Weisbecker CC: Russell King CC: Christoph Lameter CC: Chris Metcalf CC: linux-mm@kvack.org CC: Pekka Enberg CC: Matt Mackall CC: Rik van Riel CC: Andi Kleen CC: Sasha Levin CC: Mel Gorman CC: Andrew Morton CC: Alexander Viro CC: linux-fsdevel@vger.kernel.org CC: Avi Kivity CC: Michal Nazarewicz CC: Kosaki Motohiro CC: Milton Miller --- arch/arm/kernel/smp_tlb.c | 20 +++++--------------- 1 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index 7dcb352..02c5d2c 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c @@ -13,18 +13,6 @@ #include #include -static void on_each_cpu_mask(void (*func)(void *), void *info, int wait, - const struct cpumask *mask) -{ - preempt_disable(); - - smp_call_function_many(mask, func, info, wait); - if (cpumask_test_cpu(smp_processor_id(), mask)) - func(info); - - preempt_enable(); -} - /**********************************************************************/ /* @@ -87,7 +75,7 @@ void flush_tlb_all(void) void flush_tlb_mm(struct mm_struct *mm) { if (tlb_ops_need_broadcast()) - on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mm_cpumask(mm)); + on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1); else local_flush_tlb_mm(mm); } @@ -98,7 +86,8 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) struct tlb_args ta; ta.ta_vma = vma; ta.ta_start = uaddr; - on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, mm_cpumask(vma->vm_mm)); + on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_page, + &ta, 1); } else local_flush_tlb_page(vma, uaddr); } @@ -121,7 +110,8 @@ void flush_tlb_range(struct vm_area_struct *vma, ta.ta_vma = vma; ta.ta_start = start; ta.ta_end = end; - on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, mm_cpumask(vma->vm_mm)); + on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_range, + &ta, 1); } else local_flush_tlb_range(vma, start, end); } -- 1.7.0.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gilad Ben-Yossef Subject: [PATCH v8 2/8] arm: move arm over to generic on_each_cpu_mask Date: Sun, 5 Feb 2012 15:48:36 +0200 Message-ID: <1328449722-15959-1-git-send-email-gilad@benyossef.com> References: <1328448800-15794-1-git-send-email-gilad@benyossef.com> Mime-Version: 1.0 Cc: Gilad Ben-Yossef , Frederic Weisbecker , Russell King , Christoph Lameter , Chris Metcalf , linux-mm@kvack.org, Pekka Enberg , Matt Mackall , Rik van Riel , Andi Kleen , Sasha Levin , Mel Gorman , Andrew Morton , Alexander Viro , linux-fsdevel@vger.kernel.org, Avi Kivity , Michal Nazarewicz , Kosaki Motohiro , Milton Miller To: linux-kernel@vger.kernel.org Return-path: In-Reply-To: <1328448800-15794-1-git-send-email-gilad@benyossef.com> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org Note that the generic version is a little different then the Arm one: 1. It has the mask as first parameter 2. It calls the function on the calling CPU with interrupts disabled, but this should be OK since the function is called on the other CPUs with interrupts disabled anyway. Signed-off-by: Gilad Ben-Yossef Acked-by: Peter Zijlstra CC: Frederic Weisbecker CC: Russell King CC: Christoph Lameter CC: Chris Metcalf CC: linux-mm@kvack.org CC: Pekka Enberg CC: Matt Mackall CC: Rik van Riel CC: Andi Kleen CC: Sasha Levin CC: Mel Gorman CC: Andrew Morton CC: Alexander Viro CC: linux-fsdevel@vger.kernel.org CC: Avi Kivity CC: Michal Nazarewicz CC: Kosaki Motohiro CC: Milton Miller --- arch/arm/kernel/smp_tlb.c | 20 +++++--------------- 1 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index 7dcb352..02c5d2c 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c @@ -13,18 +13,6 @@ #include #include -static void on_each_cpu_mask(void (*func)(void *), void *info, int wait, - const struct cpumask *mask) -{ - preempt_disable(); - - smp_call_function_many(mask, func, info, wait); - if (cpumask_test_cpu(smp_processor_id(), mask)) - func(info); - - preempt_enable(); -} - /**********************************************************************/ /* @@ -87,7 +75,7 @@ void flush_tlb_all(void) void flush_tlb_mm(struct mm_struct *mm) { if (tlb_ops_need_broadcast()) - on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mm_cpumask(mm)); + on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1); else local_flush_tlb_mm(mm); } @@ -98,7 +86,8 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) struct tlb_args ta; ta.ta_vma = vma; ta.ta_start = uaddr; - on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, mm_cpumask(vma->vm_mm)); + on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_page, + &ta, 1); } else local_flush_tlb_page(vma, uaddr); } @@ -121,7 +110,8 @@ void flush_tlb_range(struct vm_area_struct *vma, ta.ta_vma = vma; ta.ta_start = start; ta.ta_end = end; - on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, mm_cpumask(vma->vm_mm)); + on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_range, + &ta, 1); } else local_flush_tlb_range(vma, start, end); } -- 1.7.0.4 -- 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: email@kvack.org