From patchwork Tue Nov 19 23:00:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luigi Rizzo X-Patchwork-Id: 292599 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 91A1C2C012D for ; Wed, 20 Nov 2013 10:01:05 +1100 (EST) Received: from localhost ([::1]:51994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViuI1-0005Y8-UL for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2013 18:01:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViuHN-0005Bn-4m for qemu-devel@nongnu.org; Tue, 19 Nov 2013 18:00:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViuHL-00065x-Dm for qemu-devel@nongnu.org; Tue, 19 Nov 2013 18:00:21 -0500 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:45954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViuHL-00065o-1A for qemu-devel@nongnu.org; Tue, 19 Nov 2013 18:00:19 -0500 Received: by mail-la0-f46.google.com with SMTP id eh20so6705586lab.33 for ; Tue, 19 Nov 2013 15:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=kq0/Xgtx+S1UfrVt7HwbKmTM3lk/yON+Oago0wxhItg=; b=Sl39FHfnNub6EMs3Ux6IaJIjmMOz/w+8WGo+HpGpKAzsESeJB/p0cru/+7XKIgV+ZL +4WnlAwsKUu8OPSKjuQtUxlPDxMPablkc1bCGfr2pEb+h0/GTZwTas4Pza2ACbeHySNo YkNZEstR8pJLAly/hWg4t9WflZC8JhBzbrxy9K/3jfami69yHpWilnhXgwoufiJUdzhc wuE8M3JSqKbuY99+rUHGMqeII4edMSrqJAb1u/wkpJQwyq66989i8u4Z1229BZGfbUXA q1XKn4B0cL6zsXV8fUHBtWrDeI5+iAamib5S/mDnbdTDVh/CQ35fYsvHBb08/XH5PY3z MVdA== MIME-Version: 1.0 X-Received: by 10.152.45.8 with SMTP id i8mr9606506lam.12.1384902017285; Tue, 19 Nov 2013 15:00:17 -0800 (PST) Received: by 10.114.77.228 with HTTP; Tue, 19 Nov 2013 15:00:17 -0800 (PST) Date: Wed, 20 Nov 2013 00:00:17 +0100 X-Google-Sender-Auth: ktrNlUoAoZJxuwsdRLXBkWwuH1M Message-ID: From: Luigi Rizzo To: qemu-devel , Alex Bligh X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22e Subject: [Qemu-devel] commit b1bbfe72 causes huge slowdown with no kvm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org I recently found out that without kvm enabled, and especially with -smp 2 or greater, qemu becomes incredibly slow (to the point that you can see kernel messages in the quest print one character at a time). This happens with a Linux host (even with -smp 1) and with FreeBSD host (in this case -smp 2 or greater; -smp 1 seems to work fine there). Bisecting points to this commit as the culprit: commit b1bbfe72ec1ebf302d97f886cc646466c0abd679 Author: Alex Bligh Date: Wed Aug 21 16:02:55 2013 +0100 aio / timers: On timer modification, qemu_notify or aio_notify On qemu_mod_timer_ns, ensure qemu_notify or aio_notify is called to end the appropriate poll(), irrespective of use_icount value. On qemu_clock_enable, ensure qemu_notify or aio_notify is called for all QEMUTimerLists attached to the QEMUClock. Signed-off-by: Alex Bligh Signed-off-by: Stefan Hajnoczi I could not revert this individual commit into master because of other changes, but i notice that one key changes of the commit was to ma k e a call to timerlist_notify() unconditional, whereas before it was controlled by the " use_icount " variable. So I tried the small patch below and it seems to restore the original performance, but I have no idea what use_icount does and whether the change makes sense. If not, there is an open problem. Any ideas ? cheers luigi d iff --git a/qemu-timer.c b/qemu-timer.c index e15ce47..4180a86 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -380,6 +380,7 @@ static void timerlist_rearm(QEMUTimerList *timer_list) { /* Interrupt execution to force deadline recalculation. */ qemu_clock_warp(timer_list->clock->type); +if (use_icount) // XXX timerlist_notify(timer_list); }