From patchwork Sun Apr 7 10:09:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangminqiang X-Patchwork-Id: 2402841 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C8BE23FC71 for ; Sun, 7 Apr 2013 10:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933096Ab3DGKJ4 (ORCPT ); Sun, 7 Apr 2013 06:09:56 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:8497 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933056Ab3DGKJz convert rfc822-to-8bit (ORCPT ); Sun, 7 Apr 2013 06:09:55 -0400 Received: from 172.24.2.119 (EHLO szxeml214-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id AZR26434; Sun, 07 Apr 2013 18:09:53 +0800 (CST) Received: from SZXEML453-HUB.china.huawei.com (10.82.67.196) by szxeml214-edg.china.huawei.com (172.24.2.29) with Microsoft SMTP Server (TLS) id 14.1.323.7; Sun, 7 Apr 2013 18:09:54 +0800 Received: from SZXEML538-MBX.china.huawei.com ([169.254.4.92]) by SZXEML453-HUB.china.huawei.com ([10.82.67.196]) with mapi id 14.01.0323.007; Sun, 7 Apr 2013 18:09:42 +0800 From: Yangminqiang To: "tomoki.sekiyama@hds.com" CC: "kvm@vger.kernel.org" , Haofeng , "Luohao (brian)" Subject: RE: KVM: kvm_set_slave_cpu: Invalid argument when trying direct interrupt delivery Thread-Topic: KVM: kvm_set_slave_cpu: Invalid argument when trying direct interrupt delivery Thread-Index: Ac4vdSQDWs/CquN4QtS6dilobv2MNQAVxleAAOoklBg= Date: Sun, 7 Apr 2013 10:09:41 +0000 Message-ID: <74961C475F61A9459FE12A5810EF11CE032E7924@szxeml538-mbx.china.huawei.com> References: <74961C475F61A9459FE12A5810EF11CE032E631D@szxeml538-mbx.china.huawei.com>, <1364954549.515b8dd74ea4a@webmail.sdl.hitachi.co.jp> In-Reply-To: <1364954549.515b8dd74ea4a@webmail.sdl.hitachi.co.jp> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.146.22.147] MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Tomoki, I offline the cpu2 and cpu3 on my machine and continue to try your patch. I run the vm without pass-through device for I only want to know the interrupt latency improvement.(Am I right?) my qemu parameter: ./x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 1024 -cpu qemu64,+x2apic -no-kvm-pit -serial pty -nographic -drive file=/mnt/sdb/vms/testfc/testfc.qcow2,if=virtio,index=0,format=qcow2 -spice port=12000,addr=186.100.8.171,disable-ticketing,plaintext-channel=main,plaintext-channel=playback,plaintext-channel=record,image-compression=auto_glz -no-kvm-pit cyclictest: cyclictest -m -p 99 -n -l 100000 -h 3000 -q but I got very bad result: avg lantency: 20000+ us max lantency: 50000+ us and got Message from syslogd@kvmsteven at Apr 7 05:43:30 ... kernel:[ 2201.151817] BUG: soft lockup - CPU#18 stuck for 22s! [qemu-system-x86:2365] my setup: host kernel: 3.6.0-rc4+ and your patches guest kernel: 3.6.11.1-rt32 qemu: qemu-kvm-1.0 with your patch BTW, I am sure that my rt-kernel works well, which got 12us max latency as a host OS. Could you please provoide me more detail about your benchmark so I could reproduce your benchmark result? Thanks, Steven diff -Narup a/qemu-kvm-1.0/qemu-kvm-x86.c b/qemu-kvm-1.0/qemu-kvm-x86.c --- a/qemu-kvm-1.0/qemu-kvm-x86.c 2011-12-04 19:38:06.000000000 +0900 +++ b/qemu-kvm-1.0/qemu-kvm-x86.c 2012-09-06 20:19:44.828163734 +0900 @@ -139,12 +139,28 @@ static int kvm_enable_tpr_access_reporti return kvm_vcpu_ioctl(env, KVM_TPR_ACCESS_REPORTING, &tac); } +static int kvm_set_slave_cpu(CPUState *env) +{ + int r, slave = env->cpu_index == 0 ? 2 : env->cpu_index == 1 ? 3 : -1; `slave' is the offlined CPU ID assigned, and `env->cpu_index' is the virtual CPU ID. You need to modify here and recompile qemu-kvm (or just offline cpu 2 and 3 for a 2vcpus guest ;) ). Thanks, Tomoki Sekiyama -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html