From patchwork Sat Sep 14 12:00:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 274913 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 A1BCC2C00EC for ; Sat, 14 Sep 2013 22:00:22 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752746Ab3INMAN (ORCPT ); Sat, 14 Sep 2013 08:00:13 -0400 Received: from forward15.mail.yandex.net ([95.108.130.119]:55984 "EHLO forward15.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751442Ab3INMAM (ORCPT ); Sat, 14 Sep 2013 08:00:12 -0400 Received: from web12j.yandex.ru (web12j.yandex.ru [5.45.198.53]) by forward15.mail.yandex.net (Yandex) with ESMTP id 2F4089E23B1; Sat, 14 Sep 2013 16:00:10 +0400 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web12j.yandex.ru (Yandex) with ESMTP id C6BD9BC102D; Sat, 14 Sep 2013 16:00:09 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1379160009; bh=3l5ULAtqeCqxd4ZVXfI+08Z6Q4/6Wx7kgWVkVKiCWWo=; h=From:To:Cc:Subject:Date; b=YUaylRQFB/VkOTxdrvvA8ONolHQ8UY0DyqqfaruGMrbN6rAvfUCXkXPreqORFiTdP BOdEePg9kKSxRxG4AE/paSBsnsuLzNTiVdLZ27ugYowyQFMYvy+Xlth3hYpZWtr+uc Ibv7bUCl9jWc4tXTQ6kJl/bYlnPWp/SzO49c6nWw= Received: from ns.ineum.ru (ns.ineum.ru [213.247.249.139]) by web12j.yandex.ru with HTTP; Sat, 14 Sep 2013 16:00:09 +0400 From: Kirill Tkhai To: "sparclinux@vger.kernel.org" Cc: David Miller Subject: [PATCH 1/2] sparc64: Add self-IPI support for smp_send_reschedule() MIME-Version: 1.0 Message-Id: <147951379160009@web12j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 14 Sep 2013 16:00:09 +0400 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org CONFIG_NO_HZ_FULL requires possibility of smp_send_reschedule() for the calling CPU. Currently, it is used in inc_nr_running() scheduler primitive only. Nobody calls smp_send_reschedule() from preemptible context (furthermore, it looks like it will be save if anybody use it another way in the future). But anyway I add WARN_ON() here just to return here if anything changes. Signed-off-by: Kirill Tkhai CC: David Miller --- arch/sparc/kernel/smp_64.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe sparclinux" 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/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index e142545..b66a533 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c @@ -1399,8 +1399,13 @@ void __init smp_cpus_done(unsigned int max_cpus) void smp_send_reschedule(int cpu) { - xcall_deliver((u64) &xcall_receive_signal, 0, 0, - cpumask_of(cpu)); + if (cpu == smp_processor_id()) { + WARN_ON_ONCE(preemptible()); + set_softint(1 << PIL_SMP_RECEIVE_SIGNAL); + } else { + xcall_deliver((u64) &xcall_receive_signal, + 0, 0, cpumask_of(cpu)); + } } void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)