From patchwork Wed Jun 15 21:33:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 883612 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5FLcHv7021879 for ; Wed, 15 Jun 2011 21:38:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754951Ab1FOViP (ORCPT ); Wed, 15 Jun 2011 17:38:15 -0400 Received: from mail-qy0-f174.google.com ([209.85.216.174]:42060 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754211Ab1FOViO (ORCPT ); Wed, 15 Jun 2011 17:38:14 -0400 Received: by qyk7 with SMTP id 7so2219773qyk.19 for ; Wed, 15 Jun 2011 14:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=0Otuu+XWA9BxN79fevPpRx+grFoKeCozG7GZYfF62d4=; b=wH0mIpKXC3MYkguGiEtIVl+i9zNaBESGLApR/TPENb+xHCwJFRHpL4di5L1JUaIUGD bDL6yQWgG3aauxoMIBDoZ0Gu6+ERzWryZdO/eZD0CFEr8vbVied2lLj6kGhtp8Rc9Owv tMveq584GLUx5VTETlJoOn+wPzIkweShkIrRk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=qUR+gPTze1MNSy8VQKYwC8SMMUKec7ImNU3vFtyvxIw9hxkDeBK2noqa3mjN4fuIsD mvy5pnXCdUztbdbN5wfdxBhfKXwRRTWxRrm72KSrVUnoPmxl/qwU6iBqcpFPbMiV3Ryu Kqxgrv5k0OypthgVPsIBzXUIIi8eydXGL2UyA= Received: by 10.229.130.141 with SMTP id t13mr132766qcs.117.1308173893544; Wed, 15 Jun 2011 14:38:13 -0700 (PDT) Received: from localhost.localdomain (c-71-232-157-243.hsd1.ma.comcast.net [71.232.157.243]) by mx.google.com with ESMTPS id r32sm656751qcs.2.2011.06.15.14.38.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2011 14:38:12 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, Sasha Levin Subject: [PATCH] kvm tools: Signal only one thread when injecting console interrupts Date: Wed, 15 Jun 2011 17:33:06 -0400 Message-Id: <1308173586-5344-1-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.5.3 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 15 Jun 2011 21:38:17 +0000 (UTC) Send signals only to the thread which handles console injection instead of the entire process. This prevents every single thread from having to ignore SIGALRM and will help scaling when running large amount of VCPU threads. Suggested-by: Ingo Molnar Signed-off-by: Sasha Levin Tested-by: Asias He Acked-by: Ingo Molnar --- tools/kvm/kvm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index 2c56a79..22871db 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -28,6 +28,7 @@ #include #include #include +#include #define DEFINE_KVM_EXIT_REASON(reason) [reason] = #reason @@ -529,8 +530,9 @@ void kvm__start_timer(struct kvm *kvm) memset(&sev, 0, sizeof(struct sigevent)); sev.sigev_value.sival_int = 0; - sev.sigev_notify = SIGEV_SIGNAL; + sev.sigev_notify = SIGEV_THREAD_ID; sev.sigev_signo = SIGALRM; + sev._sigev_un._tid = syscall(__NR_gettid); if (timer_create(CLOCK_REALTIME, &sev, &kvm->timerid) < 0) die("timer_create()");