From patchwork Wed Sep 4 17:40:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Austin X-Patchwork-Id: 2853812 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CF586C0AB5 for ; Wed, 4 Sep 2013 17:41:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AB35720461 for ; Wed, 4 Sep 2013 17:41:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80E7620435 for ; Wed, 4 Sep 2013 17:41:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935360Ab3IDRlL (ORCPT ); Wed, 4 Sep 2013 13:41:11 -0400 Received: from service87.mimecast.com ([91.220.42.44]:46194 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935174Ab3IDRlK convert rfc822-to-8bit (ORCPT ); Wed, 4 Sep 2013 13:41:10 -0400 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 04 Sep 2013 18:41:07 +0100 Received: from [10.1.199.156] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 4 Sep 2013 18:41:05 +0100 Message-ID: <52277097.8020008@arm.com> Date: Wed, 04 Sep 2013 18:40:39 +0100 From: Jonathan Austin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: Pekka Enberg CC: KVM General , Marc Zyngier , Will Deacon , Matt Evans , Asias He , Sasha Levin Subject: Re: [PATCH v2 2/3] kvm tools: remove periodic tick in favour of a polling thread References: <1378301148-18823-1-git-send-email-jonathan.austin@arm.com> <1378301148-18823-3-git-send-email-jonathan.austin@arm.com> In-Reply-To: X-OriginalArrivalTime: 04 Sep 2013 17:41:05.0511 (UTC) FILETIME=[EE648770:01CEA995] X-MC-Unique: 113090418410702601 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Hi Pekka, On 04/09/13 16:58, Pekka Enberg wrote: > Hi Jonathan, > > On Wed, Sep 4, 2013 at 4:25 PM, Jonathan Austin wrote: >> Currently the only use of the periodic timer tick in kvmtool is to >> handle reading from stdin. Though functional, this periodic tick can be >> problematic on slow (eg FPGA) platforms and can cause low interactivity or >> even stop the execution from progressing at all. >> >> This patch removes the periodic tick in favour of a dedicated thread blocked >> waiting for input from the console. In order to reflect the new behaviour, >> the old 'kvm__arch_periodic_tick' function is renamed to 'kvm__arch_read_term'. >> >> Signed-off-by: Jonathan Austin >> Acked-by: Marc Zyngier > > I'm afraid this breaks "top" on x86. Does it work on arm? > Sorry about that... 'top' works on ARM with virtio console. I've just done some new testing and with the serial console emulation and I see the same as you're reporting. Previously with the 8250 emulation I'd booted to a prompt but didn't actually test top... I'm looking in to fixing this now... Looks like I need to find the right place from which to call serial8250_flush_tx now that it isn't getting called every tick. I've done the following and it works fixes 'top' with serial8250: -------8<---------- ------------->8----------- I guess it's a shame that we'll be printing each character (admittedly the rate will always be relatively low...) rather than flushing the buffer in a batch. Without a timer, though, I'm not sure I see a better option - every N chars doesn't seem like a good one to me. If you think that looks about right then I'll fold that in to the patch series, probably also removing the call to serial8250_flush_tx() in serial8250__receive. Thanks, Jonny --- 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 diff --git a/tools/kvm/hw/serial.c b/tools/kvm/hw/serial.c index 931067f..a71e68d 100644 --- a/tools/kvm/hw/serial.c +++ b/tools/kvm/hw/serial.c @@ -260,6 +260,7 @@ static bool serial8250_out(struct ioport *ioport, struct kvm *kvm, u16 port, dev->lsr &= ~UART_LSR_TEMT; if (dev->txcnt == FIFO_LEN / 2) dev->lsr &= ~UART_LSR_THRE; + serial8250_flush_tx(kvm, dev); } else { /* Should never happpen */ dev->lsr &= ~(UART_LSR_TEMT | UART_LSR_THRE);