Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp203467imw; Fri, 8 Jul 2022 01:03:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vrSwwv9FQ+TR/UigKltFZfVcoWhiHeUMcvi/cUvUUwmWJVzN4z6k7s9MNrKJD5oQbM788P X-Received: by 2002:a63:55:0:b0:40c:a2e4:c328 with SMTP id 82-20020a630055000000b0040ca2e4c328mr2168240pga.499.1657267408211; Fri, 08 Jul 2022 01:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657267408; cv=none; d=google.com; s=arc-20160816; b=yepRNjiqIJNkuKQZPnVyZNywi1OKTi6BuP66nz9q1+nj/72//EniEexEzq4azIzf1W NRNryVcXFpzIiAugJ52SB0bq9T2TBcKtf2gDyGLfYo+P13OFYzgGC0WvsIf2/HMY5FXH fzkeH8EZrNWYzhFfKqTFgN2kKaQx9Kh0fPtW7olRAuvUMv/vfIyW4TKYGkrsS5Lp0Z0Y k/CpHtQxY7m2jWZ40fLiuVWc0q9cBscHdZL2tRpLpYqryFfwoa1qgEg5tKu/ChOLMFkj u5EuIuugO0z5z+bIXjb1nMtowBoXzb/i0bk+KBGBO0wLyZ4H84GPsqPZ1+TScL75FjV1 atjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ger7AXoipHQnVDoEh6jCczwlc3wU2JQI8RBDWadO9ds=; b=Jq4tmUE1XTiOpzdquK6j9GcVhOfHbL6fu1WTS79RyOgDLlkXSiwfM5Z+AIojgemdoX fMgTmfAUrvuosdPtJyn26LyqPxl0QO7uOZGsynDRfFC62TNFxnn8y8BLa42PvcxDv7+g d7TjUOIGBfoI7UfrViniBs+HH7L8WouJzgGQHuTNAoGnE71Aw1/is21HX5he3r0sn5a4 hOjroJn2ZjXrO8Bj7gBjpMJUjHeXezDAtR72nb4xI8Ux29Voc4Huesu7zVxou2QjdXub v8BQLA2EcT3FtKN1HrWvDd0IVRqVTNljzKjxiaEYEsr+hNujr0PoMDtRG56bPdBQKvr2 4x6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@veeam.com header.s=mx2-2022 header.b=arF5cObh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=veeam.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a056a00194900b005252ffbda2esi2179271pfk.36.2022.07.08.01.03.06; Fri, 08 Jul 2022 01:03:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@veeam.com header.s=mx2-2022 header.b=arF5cObh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=veeam.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237200AbiGHH6i (ORCPT + 99 others); Fri, 8 Jul 2022 03:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237265AbiGHH6h (ORCPT ); Fri, 8 Jul 2022 03:58:37 -0400 Received: from mx2.veeam.com (mx2.veeam.com [64.129.123.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA945FDA; Fri, 8 Jul 2022 00:58:32 -0700 (PDT) Received: from usmail.veeam.com (colmbx01.amust.local [172.18.0.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.veeam.com (Postfix) with ESMTPS id 1E7E540C7C; Fri, 8 Jul 2022 03:58:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veeam.com; s=mx2-2022; t=1657267109; bh=ger7AXoipHQnVDoEh6jCczwlc3wU2JQI8RBDWadO9ds=; h=Date:Subject:To:CC:References:From:In-Reply-To:From; b=arF5cObhikWiaEzbVdfPC7UubpFczJHYkoTQP+/cINVguGpJQc+wjiBwiQW5P+pA0 LYi4T1w7CIHxwnwBmAl/ctl9yk2zPnltUYPKWqiR1tvFHx+5V2GVKifXyRK1W/S3pf e/ulsO8z4ZyhE8sr5WGP7XXZ5M9GLnFPuhzcbmj1oeiehjZaEowUBvWvSjRRgLRCww hmex/N+lXkaoI0MuLS+JLEvWh/SbJMLkb8DXlKDj2ujvHXmSMO0M1SPwzvUGCdhz/H SWsXuGf+k/kcTbqFc2gQYx4I0vvljk7HRBVqO98WIBFLEKl5ex3HDVjYgx4xv8kcG3 h852isQqV1Ypg== Received: from [172.24.11.83] (172.24.11.83) by colmbx01.amust.local (172.18.0.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Fri, 8 Jul 2022 03:58:26 -0400 Message-ID: Date: Fri, 8 Jul 2022 09:58:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 15/20] block, blksnap: snapshot image block device Content-Language: en-US To: Christoph Hellwig CC: "axboe@kernel.dk" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1655135593-1900-1-git-send-email-sergei.shtepa@veeam.com> <1655135593-1900-16-git-send-email-sergei.shtepa@veeam.com> <49039d2b-e4bc-62a1-7b4a-a78001a2f430@veeam.com> From: Sergei Shtepa In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.24.11.83] X-ClientProxiedBy: prgmbx02.amust.local (172.24.128.103) To colmbx01.amust.local (172.18.0.171) X-EsetResult: clean, is OK X-EsetId: 37303A29078F7554657D65 X-Veeam-MMEX: True X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Thu, Jul 07, 2022 at 11:16:42AM +0200, Sergei Shtepa wrote: >> The module creates a block device for each snapshot image. >> To make a backup of a block device, the backup tool reads snapshot image. >> This snapshot image block device allows to mount a file system on it >> and perform the necessary preparation. If not for this requirement, >> it would be possible to implement reading via an additional ioctl. >> But that wouldn't be a good design, I think. > Ok, got it. It was just me who was confused. > >> Perhaps I have implemented this block device incorrectly? >> Processing requests of the snapshot image block device is started >> in the function snapimage_queue_rq(). And ends in the >> snapimage_queue_work() in another kernel thread. Therefore, when >> the request is initialized in snapimage_init_request(), a kernel worker >> is prepared. > I don't think it is wrong, but there is some potential for optimization. > > Is there a reson this is implemented as a blk-mq driver vs a bio > based driver that just implements ->submit_bio? The latter has > the advantage that you are always called in user context, and don't > need the extra workqueue offload. > > The block layer also generally assumes that blk-mq drivers don't > call submit_bio_noacct underneath, so if we can't I'd much > prefer the bio based driver approach here. > There was a goal to use the kernel innovations whenever possible. Of course, it makes sense to return to bio based if it allows to achieve better performance. This is not a matter of principle.