From patchwork Mon Mar 18 09:15:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongsheng Yang X-Patchwork-Id: 10857021 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 47A45139A for ; Mon, 18 Mar 2019 09:24:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E69428F49 for ; Mon, 18 Mar 2019 09:24:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 227C628FD9; Mon, 18 Mar 2019 09:24:20 +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, NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_HI,WEIRD_PORT 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 AB85128F49 for ; Mon, 18 Mar 2019 09:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbfCRJYS (ORCPT ); Mon, 18 Mar 2019 05:24:18 -0400 Received: from m97134.mail.qiye.163.com ([220.181.97.134]:53149 "EHLO m97134.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbfCRJYS (ORCPT ); Mon, 18 Mar 2019 05:24:18 -0400 Received: from atest-guest.localdomain (unknown [218.94.118.90]) by smtp5 (Coremail) with SMTP id huCowABHr4m4YY9cO8zEAg--.331S2; Mon, 18 Mar 2019 17:15:37 +0800 (CST) From: Dongsheng Yang To: idryomov@gmail.com, jdillama@redhat.com, sage@redhat.com, elder@kernel.org Cc: ceph-devel@vger.kernel.org, Dongsheng Yang Subject: [PATCH v2 00/16] rbd journaling feature Date: Mon, 18 Mar 2019 05:15:18 -0400 Message-Id: <1552900534-29026-1-git-send-email-dongsheng.yang@easystack.cn> X-Mailer: git-send-email 1.8.3.1 X-CM-TRANSID: huCowABHr4m4YY9cO8zEAg--.331S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxCry7WF18Wr4ftFyrCr1Utrb_yoWrXw48pF y3Gw13XrWUAr12yws3Jr1UJryYvrW0yrWUurnrGr1xtw15AFy2qr48trWrJry7JryxG3WU Jr1UJ3WUGw17tFDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0JbDpnPUUUUU= X-Originating-IP: [218.94.118.90] X-CM-SenderInfo: 5grqw2pkhqwhp1dqwq5hdv52pwdfyhdfq/1tbiihl7eltVf9eIlgAAsq 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 Ilya, Jason and all: This is V2 for rbd journaling. Testing: It passes krbd suite in my teuthology testing, 47 passed, 0 failed. http://218.94.118.90:8082/teuthworker-2019-03-16_14:49:51-krbd-krbd_mirror_qa-distro-basic-plana/ kernel branch: https://github.com/yangdongsheng/linux/tree/journaling_rebase ceph branch: https://github.com/yangdongsheng/ceph/tree/krbd_mirror_qa test suite: teuthology-suite -v -s krbd -c krbd_mirror_qa -m plana -S d557744d538fe02e167e0513a7dd261a11c48d88 --filter-out "rbd_workunit_suites_ffsb.yaml,rbd_workunit_suites_iozone.yaml,rbd_xfstests.yaml,rbd_simple_big,pre-single-major,rbd_concurrent,rbd_kfsx" (1): I filtered out some cases because it failed but not related with krbd journaling, such as rbd_simple_big and others. (2): I filtered out the rbd_concurrent because of http://tracker.ceph.com/issues/38553. This is a problem in rbd remove command. (3): A new test added: workunits/rbd/kernel_journal.sh: to test the journal replaying in krbd, it will be improved when we support more event types, such as snapshot. (4): A new test added: qa/suites/krbd/mirror/, this test krbd journaling with rbd-mirror daemon. Performance: compared with librbd journaling, preformance of krbd journaling looks reasonable. ------------------------------------------------------------------------------------- (1) rbd bench with journaling disabled: | IOPS: 204 ------------------------------------------------------------------------------------- (2) rbd bench with journaling enabled: | IOPS: 81 ------------------------------------------------------------------------------------- (3) fio krbd with journaling disabled: | IOPS: 210 ------------------------------------------------------------------------------------- (4) fio krbd with journaling enabled: | IOPS: 92 ------------------------------------------------------------------------------------- Changelog: -V1 1. add test case in qa 2. address all memleak found in kmemleak 3. several bug fixes 4. performance improvement. -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. Any comments are welcome!! Dongsheng Yang (16): libceph: introduce ceph_extract_encoded_string_kvmalloc libceph: introduce a new parameter of workqueue in ceph_osdc_watch() libceph: support op append libceph: add prefix and suffix in ceph_osd_req_op.extent 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: wakeup requests when we get -EBLACKLISTED in lock acquiring rbd: wait image request all complete in lock releasing rbd: introduce completion for each img_request rbd: introduce journal in rbd_device rbd: append journal first before sending img_request rbd: replay events in journal rbd: add support for feature of RBD_FEATURE_JOURNALING drivers/block/rbd.c | 688 +++++++++- include/linux/ceph/cls_journaler_client.h | 91 ++ include/linux/ceph/decode.h | 21 +- include/linux/ceph/journaler.h | 180 +++ include/linux/ceph/osd_client.h | 19 + net/ceph/Makefile | 3 +- net/ceph/cls_journaler_client.c | 556 ++++++++ net/ceph/journaler.c | 1992 +++++++++++++++++++++++++++++ net/ceph/osd_client.c | 61 +- 9 files changed, 3580 insertions(+), 31 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