From patchwork Mon Dec 3 12:50:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongsheng Yang X-Patchwork-Id: 10709499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5FBE18BC for ; Mon, 3 Dec 2018 12:56:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A75222B408 for ; Mon, 3 Dec 2018 12:56:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B5D12B4AF; Mon, 3 Dec 2018 12:56:12 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 433BA2B408 for ; Mon, 3 Dec 2018 12:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbeLCM5G (ORCPT ); Mon, 3 Dec 2018 07:57:06 -0500 Received: from m50211.mail.qiye.163.com ([123.125.50.211]:22077 "EHLO m50211.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbeLCM5G (ORCPT ); Mon, 3 Dec 2018 07:57:06 -0500 Received: from atest-guest.localdomain (unknown [218.94.118.90]) by smtp3 (Coremail) with SMTP id PdOowEDpa0CfJgVcOwAAAA--.14S2; Mon, 03 Dec 2018 20:50:39 +0800 (CST) From: Dongsheng Yang To: idryomov@gmail.com, sage@redhat.com, elder@kernel.org, jdillama@redhat.com Cc: dongsheng.yang@easystack.cn, ceph-devel@vger.kernel.org Subject: [PATCH 00/11 V1] rbd journaling feature Date: Mon, 3 Dec 2018 07:50:24 -0500 Message-Id: <1543841435-13652-1-git-send-email-dongsheng.yang@easystack.cn> X-Mailer: git-send-email 1.8.3.1 X-CM-TRANSID: PdOowEDpa0CfJgVcOwAAAA--.14S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxXFykXw4UAF4rtFyrAF4fXwb_yoW5GFW5pF 98G3s0vrWUZr1S9393J3W8JFyS9rW8KrW7u3srKrnrKa43AFZFqF18Kr98urW3AFyxG3Wk GF1jka4Uuw1YyFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0Jbaa9-UUUUU= X-Originating-IP: [218.94.118.90] X-CM-SenderInfo: 5grqw2pkhqwhp1dqwq5hdv52pwdfyhdfq/1tbihx8SeltVe0ExIQAAsU Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi all, This is V1 to implement the journaling feature in kernel rbd, which makes mirroring in kubernetes possible. It passed the /ceph/ceph/qa/workunits/rbd/rbd_mirror.sh, with a little change as below: ``` [root@atest-guest build]# git diff /ceph/ceph/qa/workunits/rbd/rbd_mirror_helpers.sh ``` Changelog from RFC: 1. error out if there is some unsupported event type in replaying 2. just one memory copy from bio to msg. 3. use async IO in journal appending. 4. no mutex around IO. Dongsheng Yang (11): libceph: support prefix and suffix in bio_iter libceph: support op append libceph: introduce cls_journaler_client libceph: introduce generic journaling libceph: journaling: introduce api to replay uncommitted journal events libceph: journaling: introduce api for journal appending libceph: journaling: trim object set when we found there is no client refer it rbd: wait image request all complete in lock releasing rbd: introduce completion for each img_request rbd: introduce a lock_flag in rbd_dev to make some process exclusive-lock protected rbd: enable journaling drivers/block/rbd.c | 635 +++++++++- include/linux/ceph/cls_journaler_client.h | 93 ++ include/linux/ceph/journaler.h | 176 +++ include/linux/ceph/messenger.h | 9 + net/ceph/Makefile | 3 +- net/ceph/cls_journaler_client.c | 535 +++++++++ net/ceph/journaler.c | 1843 +++++++++++++++++++++++++++++ net/ceph/messenger.c | 96 +- net/ceph/osd_client.c | 14 +- 9 files changed, 3360 insertions(+), 44 deletions(-) create mode 100644 include/linux/ceph/cls_journaler_client.h create mode 100644 include/linux/ceph/journaler.h create mode 100644 net/ceph/cls_journaler_client.c create mode 100644 net/ceph/journaler.c diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index e019de5..9d00d3e 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -854,9 +854,9 @@ write_image() test -n "${size}" || size=4096 - rbd --cluster ${cluster} -p ${pool} bench ${image} --io-type write \ - --io-size ${size} --io-threads 1 --io-total $((size * count)) \ - --io-pattern rand + rbd --cluster ${cluster} -p ${pool} map ${image} + fio --name=test --rw=randwrite --bs=${size} --runtime=60 --ioengine=libaio --iodepth=1 --numjobs=1 --filename=/dev/rbd0 --direct=1 --group_reporting --size $((size * count)) --group_reporting --eta-newline 1 + rbd --cluster ${cluster} -p ${pool} unmap ${image} } stress_write_image()