From patchwork Sun Jun 23 13:45:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srivatsa S. Bhat" X-Patchwork-Id: 2768041 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 84B019F245 for ; Sun, 23 Jun 2013 13:53:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D49E2018A for ; Sun, 23 Jun 2013 13:53:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C7F020181 for ; Sun, 23 Jun 2013 13:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752727Ab3FWNsp (ORCPT ); Sun, 23 Jun 2013 09:48:45 -0400 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:41812 "EHLO e28smtp03.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752721Ab3FWNsl (ORCPT ); Sun, 23 Jun 2013 09:48:41 -0400 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 23 Jun 2013 19:12:42 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp03.in.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 23 Jun 2013 19:12:39 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id C2BC1E0056; Sun, 23 Jun 2013 19:18:05 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5NDmpPW18677874; Sun, 23 Jun 2013 19:18:51 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5NDmX25029750; Sun, 23 Jun 2013 23:48:35 +1000 Received: from srivatsabhat.in.ibm.com ([9.79.195.141]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r5NDmWR0029715; Sun, 23 Jun 2013 23:48:32 +1000 From: "Srivatsa S. Bhat" Subject: [PATCH 31/45] alpha/smp: Use get/put_online_cpus_atomic() to prevent CPU offline To: tglx@linutronix.de, peterz@infradead.org, tj@kernel.org, oleg@redhat.com, paulmck@linux.vnet.ibm.com, rusty@rustcorp.com.au, mingo@kernel.org, akpm@linux-foundation.org, namhyung@kernel.org, walken@google.com, vincent.guittot@linaro.org, laijs@cn.fujitsu.com Cc: rostedt@goodmis.org, wangyun@linux.vnet.ibm.com, xiaoguangrong@linux.vnet.ibm.com, sbw@mit.edu, fweisbec@gmail.com, zhong@linux.vnet.ibm.com, nikunj@linux.vnet.ibm.com, srivatsa.bhat@linux.vnet.ibm.com, linux-pm@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Gleixner , linux-alpha@vger.kernel.org Date: Sun, 23 Jun 2013 19:15:20 +0530 Message-ID: <20130623134516.19094.57189.stgit@srivatsabhat.in.ibm.com> In-Reply-To: <20130623133642.19094.16038.stgit@srivatsabhat.in.ibm.com> References: <20130623133642.19094.16038.stgit@srivatsabhat.in.ibm.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13062313-3864-0000-0000-000008C2BAAE Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Once stop_machine() is gone from the CPU offline path, we won't be able to depend on disabling preemption to prevent CPUs from going offline from under us. Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going offline, while invoking from atomic context. Also, remove the non-ASCII character present in this file! Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Thomas Gleixner Cc: linux-alpha@vger.kernel.org Signed-off-by: Srivatsa S. Bhat --- arch/alpha/kernel/smp.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 7b60834..e147268 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -497,7 +497,6 @@ smp_cpus_done(unsigned int max_cpus) ((bogosum + 2500) / (5000/HZ)) % 100); } - void smp_percpu_timer_interrupt(struct pt_regs *regs) { @@ -681,7 +680,7 @@ ipi_flush_tlb_mm(void *x) void flush_tlb_mm(struct mm_struct *mm) { - preempt_disable(); + get_online_cpus_atomic(); if (mm == current->active_mm) { flush_tlb_current(mm); @@ -693,7 +692,7 @@ flush_tlb_mm(struct mm_struct *mm) if (mm->context[cpu]) mm->context[cpu] = 0; } - preempt_enable(); + put_online_cpus_atomic(); return; } } @@ -702,7 +701,7 @@ flush_tlb_mm(struct mm_struct *mm) printk(KERN_CRIT "flush_tlb_mm: timed out\n"); } - preempt_enable(); + put_online_cpus_atomic(); } EXPORT_SYMBOL(flush_tlb_mm); @@ -730,7 +729,7 @@ flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) struct flush_tlb_page_struct data; struct mm_struct *mm = vma->vm_mm; - preempt_disable(); + get_online_cpus_atomic(); if (mm == current->active_mm) { flush_tlb_current_page(mm, vma, addr); @@ -742,7 +741,7 @@ flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) if (mm->context[cpu]) mm->context[cpu] = 0; } - preempt_enable(); + put_online_cpus_atomic(); return; } } @@ -755,7 +754,7 @@ flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) printk(KERN_CRIT "flush_tlb_page: timed out\n"); } - preempt_enable(); + put_online_cpus_atomic(); } EXPORT_SYMBOL(flush_tlb_page); @@ -786,7 +785,7 @@ flush_icache_user_range(struct vm_area_struct *vma, struct page *page, if ((vma->vm_flags & VM_EXEC) == 0) return; - preempt_disable(); + get_online_cpus_atomic(); if (mm == current->active_mm) { __load_new_mm_context(mm); @@ -798,7 +797,7 @@ flush_icache_user_range(struct vm_area_struct *vma, struct page *page, if (mm->context[cpu]) mm->context[cpu] = 0; } - preempt_enable(); + put_online_cpus_atomic(); return; } } @@ -807,5 +806,5 @@ flush_icache_user_range(struct vm_area_struct *vma, struct page *page, printk(KERN_CRIT "flush_icache_page: timed out\n"); } - preempt_enable(); + put_online_cpus_atomic(); }