From patchwork Tue May 29 07:16:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Zhang X-Patchwork-Id: 161660 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 927D5B7056 for ; Tue, 29 May 2012 17:18:43 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753317Ab2E2HR5 (ORCPT ); Tue, 29 May 2012 03:17:57 -0400 Received: from mail-vc0-f174.google.com ([209.85.220.174]:50086 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753161Ab2E2HR4 (ORCPT ); Tue, 29 May 2012 03:17:56 -0400 Received: by vcbf11 with SMTP id f11so1864596vcb.19 for ; Tue, 29 May 2012 00:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=lspavUTMX2AorPskgxvdBr1hMAY0AOkqvQOcg3R+bFY=; b=0vAha1P0xL0FmV3Zst6IxutOhIndB1tfDOGY8Cc9WDYnFbJqxRFqnUHNsi6SM9WASV PriM8FHMYotHZP06QUChaFqvRii9/riN/2oWBeOHlg/k4btIN6AAXzA0lK2FhOb26M7B 76IJbXuBlWJJ1pVaaZb4MPZp0yvlaQH80/dha4ZnYuP0xfoo1+Q0s9nzCN0vIIgEaCEY CgEecRc1Yf0oHyzlPKA0EY866WFGkV+GU0Q6V/xf+qaX3PMQKJIplgxAMVvbI/lXpsu6 ws8fGciLtHoRKRweOrq1jWSThLw7zRUxoBsg/CXvyLYekv0c44MukbUZeygZf17W2K1I B++g== Received: by 10.220.241.130 with SMTP id le2mr11539131vcb.38.1338275875371; Tue, 29 May 2012 00:17:55 -0700 (PDT) Received: from localhost ([61.148.56.138]) by mx.google.com with ESMTPS id bj6sm22966851vdc.12.2012.05.29.00.17.48 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 May 2012 00:17:54 -0700 (PDT) From: Yong Zhang To: linux-kernel@vger.kernel.org Cc: ralf@linux-mips.org, sshtylyov@mvista.com, david.daney@cavium.com, nikunj@linux.vnet.ibm.com, paulmck@linux.vnet.ibm.com, axboe@kernel.dk, mingo@kernel.org, tglx@linutronix.de, peterz@infradead.org, akpm@linux-foundation.org, srivatsa.bhat@linux.vnet.ibm.com, "David S. Miller" , sparclinux@vger.kernel.org Subject: [PATCH 08/10] SPARC: smp: remove call to ipi_call_lock_irq()/ipi_call_unlock_irq() Date: Tue, 29 May 2012 15:16:03 +0800 Message-Id: <1338275765-3217-9-git-send-email-yong.zhang0@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1338275765-3217-1-git-send-email-yong.zhang0@gmail.com> References: <1338275765-3217-1-git-send-email-yong.zhang0@gmail.com> Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From: Yong Zhang 1) call_function.lock used in smp_call_function_many() is just to protect call_function.queue and &data->refs, cpu_online_mask is outside of the lock. And it's not necessary to protect cpu_online_mask, because data->cpumask is pre-calculate and even if a cpu is brougt up when calling arch_send_call_function_ipi_mask(), it's harmless because validation test in generic_smp_call_function_interrupt() will take care of it. 2) For cpu down issue, stop_machine() will guarantee that no concurrent smp_call_fuction() is processing. Signed-off-by: Yong Zhang Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org --- arch/sparc/kernel/smp_64.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index f591598..60e745c 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c @@ -124,9 +124,9 @@ void __cpuinit smp_callin(void) while (!cpumask_test_cpu(cpuid, &smp_commenced_mask)) rmb(); - ipi_call_lock_irq(); + local_irq_disable(); set_cpu_online(cpuid, true); - ipi_call_unlock_irq(); + local_irq_enable(); /* idle thread is expected to have preempt disabled */ preempt_disable(); @@ -1308,9 +1308,7 @@ int __cpu_disable(void) mdelay(1); local_irq_disable(); - ipi_call_lock(); set_cpu_online(cpu, false); - ipi_call_unlock(); cpu_map_rebuild();