From patchwork Wed Jul 27 12:26:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre DERUMIER X-Patchwork-Id: 9249777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50528607F0 for ; Wed, 27 Jul 2016 13:04:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41FA126253 for ; Wed, 27 Jul 2016 13:04:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36CEB27BF4; Wed, 27 Jul 2016 13:04:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C22B26253 for ; Wed, 27 Jul 2016 13:04:04 +0000 (UTC) Received: from localhost ([::1]:46385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSOVH-0006n6-9s for patchwork-qemu-devel@patchwork.kernel.org; Wed, 27 Jul 2016 09:04:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSOUS-0006Tg-To for qemu-devel@nongnu.org; Wed, 27 Jul 2016 09:03:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSOUO-0000Tm-0C for qemu-devel@nongnu.org; Wed, 27 Jul 2016 09:03:12 -0400 Received: from mailpro.odiso.net ([89.248.211.110]:33003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSOUN-0000Th-Pa for qemu-devel@nongnu.org; Wed, 27 Jul 2016 09:03:07 -0400 Received: from localhost (localhost [127.0.0.1]) by mailpro.odiso.net (Postfix) with ESMTP id BFB60423DBB13; Wed, 27 Jul 2016 14:26:44 +0200 (CEST) Received: from mailpro.odiso.net ([127.0.0.1]) by localhost (mailpro.odiso.net [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id KN7yOpyMtRQ1; Wed, 27 Jul 2016 14:26:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mailpro.odiso.net (Postfix) with ESMTP id 957BC4283F171; Wed, 27 Jul 2016 14:26:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at mailpro.odiso.com Received: from mailpro.odiso.net ([127.0.0.1]) by localhost (mailpro.odiso.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id tcjhjvNrsvp0; Wed, 27 Jul 2016 14:26:44 +0200 (CEST) Received: from kvmtest1.odiso.net (kvmtest1.odiso.net [10.3.94.31]) by mailpro.odiso.net (Postfix) with ESMTP id 69F55423DBB13; Wed, 27 Jul 2016 14:26:44 +0200 (CEST) Received: by kvmtest1.odiso.net (Postfix, from userid 0) id 5EC2530611B; Wed, 27 Jul 2016 14:26:44 +0200 (CEST) From: Alexandre Derumier To: qemu-devel@nongnu.org Date: Wed, 27 Jul 2016 14:26:42 +0200 Message-Id: <1469622402-8634-1-git-send-email-aderumier@odiso.com> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 89.248.211.110 Subject: [Qemu-devel] [PATCH] rbd : disable rbd_cache_writethrough_until_flush for cache=unsafe X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jdurgin@redhat.com, ceph-devel@vger.kernel.org, Alexandre Derumier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP ceph force writethrough until a flush is detected. With cache=unsafe, we never send flush. So we need to tell to ceph to set rbd_cache_writethrough_until_flush=false in this case. This speedup a lot qemu-img convert which use cache=unsafe by default Signed-off-by: Alexandre Derumier Reviewed-by: Josh Durgin --- block/rbd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/rbd.c b/block/rbd.c index 0106fea..f3af6c8 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -552,6 +552,10 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, rados_conf_set(s->cluster, "rbd_cache", "true"); } + if (flags & BDRV_O_NO_FLUSH) { + rados_conf_set(s->cluster, "rbd_cache_writethrough_until_flush", "false"); + } + r = rados_connect(s->cluster); if (r < 0) { error_setg_errno(errp, -r, "error connecting");