From patchwork Fri Nov 24 16:38:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtepa X-Patchwork-Id: 169513 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp1356310vqx; Fri, 24 Nov 2023 08:40:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIzNnwVial42xvVbV2HIn3VRushO3W3LT91Lj7fnc8hO50niE95dH55c+8dibUFxvFgg2Z X-Received: by 2002:a05:6a00:1402:b0:6cb:440c:1f60 with SMTP id l2-20020a056a00140200b006cb440c1f60mr4554058pfu.13.1700844043051; Fri, 24 Nov 2023 08:40:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700844043; cv=none; d=google.com; s=arc-20160816; b=mNsGzNJYeGi6SvdF59fjkTqjIuZ6jf/iXdOcqIVXrCBt0kqHmWKWjb2uGmmLr4IYuZ nZ39Ywg0lQPFGskeneB6h4Nh5P4g3OPsP/9o8o+9l52gc/x6PMcW3/5Ac2mRQyvaBmTn XmDR6kd5yqU/WLuZMLqo0jlDk0bGXkX1N1jpYdenYo+2RM2rjK8WLwUcQXf4+wWzZGg3 N8Zqu+TVU0uXLJ5TImRkyvjiD1RJASFxTKqIpL8oDfHm1kIAKQ1dz4NsRhoJIeA/yzEA 8z8TsBp6tEaO1mnrOULFbTnHiplGolvxeDKnzCvfsy6pMJ+UJqxJ81p7DGV2tTN7DW1l tJSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3H2EngB4IC7J9sBiro1fbNUKQKRJyLxYEzCizNHIL5o=; fh=a9ApmeGvcCB6Trsutt5tt4NXJ5Ik8LZp8ymXtojMIXc=; b=oLLUWfprpDx4HrG/KjNP0pPOJEP2yb0lPcdyIVwrvzq62Zz29EXUk8gQq6cRkZdmMI KsIPxLiyDEAA2I/EM2b6Y7buS+LgkZr08kwPuUk+xrY4byhyKhbbiQbmpTgV+f4+Va1k WmclzjGVgoxso+CcJ2nPoY4J7XLPDAg5mtGYuHZIEHQBj5WSogdmQmylntWsgIFp3Kfk fkMjbOs4+DqY53pBbunnI+iZ1u0+Pn4qjddelkHfJK7IOHOblqIVWBQ5YgJ75JKaJ9n2 iRgpGcPIZMbREokX/le4DJKhCR84VFEGGk6hRUDoJdNme2mcF/nqctZvqxcWlz5P5sKj pHcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=mGN39DXq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id x9-20020a63fe49000000b0057795cb4f16si4017935pgj.684.2023.11.24.08.40.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 08:40:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=mGN39DXq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 97482807828D; Fri, 24 Nov 2023 08:40:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231494AbjKXQkM (ORCPT + 99 others); Fri, 24 Nov 2023 11:40:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231567AbjKXQjm (ORCPT ); Fri, 24 Nov 2023 11:39:42 -0500 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [IPv6:2001:41d0:1004:224b::aa]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B3C19A5 for ; Fri, 24 Nov 2023 08:39:37 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700843975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3H2EngB4IC7J9sBiro1fbNUKQKRJyLxYEzCizNHIL5o=; b=mGN39DXq4SgDm8jtg/clJ70sX/mHBpPI6KT3KlLWh/qAVEU0LxE9gfefLsntV2VzlDHlZs OoohQ0F3izzGlI/E+Ar5n5s16PjcSzURaqyF72QsRRD7xKnJM9z83fL65uGa+LO5X5POrU gXiSXTTKbIdnGK6p3S1Wf2b1V41zG/0= From: Sergei Shtepa To: axboe@kernel.dk, hch@infradead.org, corbet@lwn.net, snitzer@kernel.org Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, mgorman@suse.de, vschneid@redhat.com, viro@zeniv.linux.org.uk, brauner@kernel.org, linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Sergei Shtepa Subject: [PATCH v6 10/11] blksnap: Kconfig and Makefile Date: Fri, 24 Nov 2023 17:38:35 +0100 Message-Id: <20231124163836.27256-11-sergei.shtepa@linux.dev> In-Reply-To: <20231124163836.27256-1-sergei.shtepa@linux.dev> References: <20231124163836.27256-1-sergei.shtepa@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 24 Nov 2023 08:40:37 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783464243373718137 X-GMAIL-MSGID: 1783464243373718137 From: Sergei Shtepa Allows to build a module and add the blksnap to the kernel tree. Co-developed-by: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Sergei Shtepa --- drivers/block/Kconfig | 2 ++ drivers/block/Makefile | 2 ++ drivers/block/blksnap/Kconfig | 31 +++++++++++++++++++++++++++++++ drivers/block/blksnap/Makefile | 15 +++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 drivers/block/blksnap/Kconfig create mode 100644 drivers/block/blksnap/Makefile diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index 5b9d4aaebb81..74d2d55526a3 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig @@ -404,4 +404,6 @@ config BLKDEV_UBLK_LEGACY_OPCODES source "drivers/block/rnbd/Kconfig" +source "drivers/block/blksnap/Kconfig" + endif # BLK_DEV diff --git a/drivers/block/Makefile b/drivers/block/Makefile index 101612cba303..9a2a9a56a247 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -40,3 +40,5 @@ obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk/ obj-$(CONFIG_BLK_DEV_UBLK) += ublk_drv.o swim_mod-y := swim.o swim_asm.o + +obj-$(CONFIG_BLKSNAP) += blksnap/ diff --git a/drivers/block/blksnap/Kconfig b/drivers/block/blksnap/Kconfig new file mode 100644 index 000000000000..f52272c12e1b --- /dev/null +++ b/drivers/block/blksnap/Kconfig @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Block device snapshot module configuration +# + +config BLKSNAP + tristate "Block Devices Snapshots Module (blksnap)" + help + Allow to create snapshots and track block changes for block devices. + Designed for creating backups for block devices. Snapshots are + temporary and are released when backup is completed. Change block + tracking allows to create incremental or differential backups. + +config BLKSNAP_DIFF_BLKDEV + bool "Use an optimized algorithm to store difference on a block device" + depends on BLKSNAP + default y + help + The difference storage for a snapshot can be a regular file or a + block device. We can work with a block device through the interface + of a regular file. However, direct management of I/O units should + allow for higher performance. + +config BLKSNAP_CHUNK_DIFF_BIO_SYNC + bool "Use a synchronous I/O unit processing algorithm for the snapshot image" + depends on BLKSNAP + default n + help + Theoretical asynchronous algorithm for processing I/O units should + have higher performance. However, an attempt to confirm this on test + runs did not bring any results. diff --git a/drivers/block/blksnap/Makefile b/drivers/block/blksnap/Makefile new file mode 100644 index 000000000000..8d528b95579a --- /dev/null +++ b/drivers/block/blksnap/Makefile @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: GPL-2.0 + +blksnap-y := \ + cbt_map.o \ + chunk.o \ + diff_area.o \ + diff_buffer.o \ + diff_storage.o \ + event_queue.o \ + main.o \ + snapimage.o \ + snapshot.o \ + tracker.o + +obj-$(CONFIG_BLKSNAP) += blksnap.o