From patchwork Thu Oct 22 13:03:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiahui Cen X-Patchwork-Id: 1386269 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com 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 ozlabs.org (Postfix) with ESMTPS id 4CH79P6XLZz9sSn for ; Fri, 23 Oct 2020 00:14:01 +1100 (AEDT) Received: from localhost ([::1]:47074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVaPm-0008G8-Io for incoming@patchwork.ozlabs.org; Thu, 22 Oct 2020 09:13:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVaG7-00052v-It; Thu, 22 Oct 2020 09:03:59 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5715 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVaFx-0000gn-Rm; Thu, 22 Oct 2020 09:03:59 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1F3A5716043171552079; Thu, 22 Oct 2020 21:03:43 +0800 (CST) Received: from localhost (10.174.184.155) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Thu, 22 Oct 2020 21:03:34 +0800 From: Jiahui Cen To: , , , Subject: [PATCH v3 9/9] docs: add a doc about I/O hang Date: Thu, 22 Oct 2020 21:03:03 +0800 Message-ID: <20201022130303.1092-10-cenjiahui@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201022130303.1092-1-cenjiahui@huawei.com> References: <20201022130303.1092-1-cenjiahui@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.184.155] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.191; envelope-from=cenjiahui@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 09:03:44 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: , Cc: cenjiahui@huawei.com, zhang.zhanghailiang@huawei.com, qemu-block@nongnu.org, stefanha@redhat.com, fangying1@huawei.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Give some details about the I/O hang and how to use it. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- docs/io-hang.rst | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/io-hang.rst diff --git a/docs/io-hang.rst b/docs/io-hang.rst new file mode 100644 index 0000000000..53356ceed2 --- /dev/null +++ b/docs/io-hang.rst @@ -0,0 +1,45 @@ +======== +I/O hang +======== + +Introduction +============ + +I/O hang is a mechanism to automatically rehandle AIOs when an error occurs on +the backend block device, which is unperceivable for Guest. If the error on the +backend device is temporary, like NFS returns EIO due to network fluctuations, +once the device is recovered, the AIOs will be resent automatically and done +successfully. If the error on the device is unrecoverable, the failed AIOs will +be returned to Guest after rehandle timeout. + +This mechanism can provide self-recovery and high availability to VM. From the +view of Guest, AIOs sent to the device are hung for a time and the finished, and +any other unrelated service in Guest can work as usual. + +Implementation +============== + +Each BlockBackend will have a list to store AIOs which need be rehandled and a +timer to monitor the timeout. + +If I/O hang is enabled, all returned AIOs will be checked and the failed ones +will be inserted into BlockBackend's list. The timer will be started and the +AIOs in the list will be resent to the backend device. Once the result of AIOs +relevant to this backend device is success, the AIOs will be returned back to +Guest. Otherwise, those AIOs will be rehandled periodically until timeout. + +I/O hang provides interfaces to drain all the AIOs in BlockBackend's list. There +are some situations to drain the rehandling AIOs, eg. resetting virtio-blk. + +I/O hang also provides qapi events, which can be used for manager tools like +libvirt to monitor. + +Examples +======== + +Enable I/O hang when launching QEMU:: + + $ qemu-system-x86_64 \ + -machine pc,accel=kvm -smp 1 -m 2048 \ + -drive file=shared.img,format=raw,cache=none,aio=native,iohang-timeout=60 +