From patchwork Mon Nov 23 15:44:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Shinkevich X-Patchwork-Id: 11925637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B79EC56202 for ; Mon, 23 Nov 2020 15:47:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94DBF20B1F for ; Mon, 23 Nov 2020 15:47:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94DBF20B1F Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=nongnu.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khE4B-0006ZH-Ga for qemu-devel@archiver.kernel.org; Mon, 23 Nov 2020 10:47:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khE1P-0005Aq-AX; Mon, 23 Nov 2020 10:44:55 -0500 Received: from relay.sw.ru ([185.231.240.75]:43414 helo=relay3.sw.ru) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khE1M-0008JE-2u; Mon, 23 Nov 2020 10:44:54 -0500 Received: from [172.16.25.136] (helo=localhost.sw.ru) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from ) id 1khE0x-009zBo-1F; Mon, 23 Nov 2020 18:44:27 +0300 To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, marcandre.lureau@redhat.com, pbonzini@redhat.com, kwolf@redhat.com, mreitz@redhat.com, armbru@redhat.com, dgilbert@redhat.com, den@openvz.org, vsementsov@virtuozzo.com, andrey.shinkevich@virtuozzo.com Subject: [PATCH v2 0/2] Increase amount of data for monitor to read Date: Mon, 23 Nov 2020 18:44:32 +0300 Message-Id: <1606146274-246154-1-git-send-email-andrey.shinkevich@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 Received-SPF: pass client-ip=185.231.240.75; envelope-from=andrey.shinkevich@virtuozzo.com; helo=relay3.sw.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: Andrey Shinkevich X-Patchwork-Original-From: Andrey Shinkevich via From: Andrey Shinkevich The subject was discussed here: https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg00206.html This series is a solution for the issue with QMP monitor buffered input. A JSON little parser is introduced to separate QMP commands read from the input buffer so that incoming requests do not overwhelm the monitor queue. A side effect raised in the test #247 was managed in the first patch. It may be considered as a workaround. Any sane fix suggested will be appreciated. Note: This series goes after the Vladimir's one: '[PATCH v3 00/25] backup performance: block_status + async"' To make the test #129 passed, the following patch should be applied first: '[PATCH v3 01/25] iotests: 129 don't check backup "busy"'. v2: 02: The static JSONthrottle object was made a member of the Chardev structure. The fd_chr_read functions were merged. The monitor thread synchronization was added to protect the input queue from overflow. Andrey Shinkevich (2): iotests: add another bash sleep command to 247 monitor: increase amount of data for monitor to read chardev/char-fd.c | 35 +++++++++++++++++++++++++++++++++-- chardev/char-socket.c | 42 +++++++++++++++++++++++++++++++++++++++--- chardev/char.c | 41 +++++++++++++++++++++++++++++++++++++++++ include/chardev/char.h | 15 +++++++++++++++ monitor/monitor.c | 2 +- tests/qemu-iotests/247 | 2 ++ tests/qemu-iotests/247.out | 1 + 7 files changed, 132 insertions(+), 6 deletions(-)