From patchwork Tue Dec 10 14:21:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 3318341 Return-Path: X-Original-To: patchwork-kvm@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 CF52A9F37C for ; Tue, 10 Dec 2013 14:22:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C2CC20384 for ; Tue, 10 Dec 2013 14:22:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BE7F2037F for ; Tue, 10 Dec 2013 14:22:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753703Ab3LJOVo (ORCPT ); Tue, 10 Dec 2013 09:21:44 -0500 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:56353 "EHLO e28smtp06.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753279Ab3LJOVi (ORCPT ); Tue, 10 Dec 2013 09:21:38 -0500 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Dec 2013 19:51:36 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp06.in.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 10 Dec 2013 19:51:34 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id BBFF73940023; Tue, 10 Dec 2013 19:51:33 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBAELU0w46792790; Tue, 10 Dec 2013 19:51:30 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBAELWUl031280; Tue, 10 Dec 2013 19:51:33 +0530 Received: from skywalker.in.ibm.com ([9.124.210.64]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id rBAELUZm031164; Tue, 10 Dec 2013 19:51:32 +0530 From: "Aneesh Kumar K.V" To: agraf@suse.de, benh@kernel.crashing.org, paulus@samba.org Cc: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, "Aneesh Kumar K.V" Subject: [PATCH] KVM: PPC: Use schedule instead of cond_resched Date: Tue, 10 Dec 2013 19:51:24 +0530 Message-Id: <1386685284-3862-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.3.2 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13121014-9574-0000-0000-00000AF71B25 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.1 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 From: "Aneesh Kumar K.V" We already checked need_resched. So we can call schedule directly Signed-off-by: Aneesh Kumar K.V --- NOTE: This patch also work around a regression upstream w.r.t PR KVM BUG: soft lockup - CPU#0 stuck for 23s! [qemu-system-ppc:4394] Modules linked in: CPU: 0 PID: 4394 Comm: qemu-system-ppc Not tainted 3.13.0-rc3+ #98 task: c0000001d0788400 ti: c0000001dca00000 task.ti: c0000001dca00000 NIP: c00000000082dd80 LR: c000000000081ae0 CTR: c000000000062ba0 REGS: c0000001dca02f70 TRAP: 0901 Not tainted (3.13.0-rc3+) MSR: 8000000000009032 CR: 24822024 XER: 00000000 CFAR: c000000000081adc SOFTE: 1 GPR00: c000000000081ae0 c0000001dca031f0 c000000000d67ab0 0000000000000001 GPR04: 0000000071000002 0000000000000001 00000189a0d786b7 00000000018c0000 GPR08: 0000000000000001 0000000000000000 0000000000000000 c000000000da0000 GPR12: 0000000000000c00 c00000000fef0000 NIP [c00000000082dd80] ._cond_resched+0x0/0x40 LR [c000000000081ae0] .kvmppc_prepare_to_enter+0x2a0/0x2e0 Call Trace: [c0000001dca031f0] [c000000000081ae0] .kvmppc_prepare_to_enter+0x2a0/0x2e0 (unreliable) [c0000001dca03290] [c00000000008f2cc] .kvmppc_handle_exit_pr+0xec/0xa40 [c0000001dca03340] [c0000000000918c4] kvm_start_lightweight+0xac/0xbc [c0000001dca03510] [c00000000008efe0] .kvmppc_vcpu_run_pr+0x130/0x2a0 [c0000001dca039e0] [c0000000000855bc] .kvmppc_vcpu_run+0x2c/0x40 [c0000001dca03a50] [c000000000082c94] .kvm_arch_vcpu_ioctl_run+0x54/0x1b0 [c0000001dca03ae0] [c00000000007d5f8] .kvm_vcpu_ioctl+0x478/0x740 [c0000001dca03ca0] [c000000000218864] .do_vfs_ioctl+0x4a4/0x760 [c0000001dca03d80] [c000000000218b78] .SyS_ioctl+0x58/0xb0 [c0000001dca03e30] [c000000000009e58] syscall_exit+0x0/0x98 Instruction dump: e92d0260 e94911c0 812a0004 5529f07e 5529103e 912a0004 38210080 e8010010 ebc1fff0 ebe1fff8 7c0803a6 4e800020 <7c0802a6> 38600000 f8010010 f821ff91 arch/powerpc/kvm/powerpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index e4d511c8b38b..6a49b23a3276 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -74,7 +74,7 @@ int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu) while (true) { if (need_resched()) { local_irq_enable(); - cond_resched(); + schedule(); local_irq_disable(); continue; }