Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp564087imd; Fri, 26 Oct 2018 13:03:54 -0700 (PDT) X-Google-Smtp-Source: AJdET5dItUR1C51VSoXw85pPgY/j4hM2Lxx3BkUeChz58+Xc8v8MRSquvOqyiGfZL1+m++1B6VAf X-Received: by 2002:a17:902:854c:: with SMTP id d12-v6mr4802528plo.313.1540584234918; Fri, 26 Oct 2018 13:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540584234; cv=none; d=google.com; s=arc-20160816; b=LEHx9e0CKHJQGr7ak0p+njik35P5HjqPAKO6zCl7qQw9Vpcj3MgjJFle4lVD3WCQN+ YuIfU3MwAaUpB0kYU7jZ35mfKxvsZeLliSrC7lhsnIn87SfL9Ea/4iQWueEbW7iXyqBV 7eCD+a1fZGk7yzz6SkxxmTg8ftHhFH6yBAmJ0VTi2qoHftzsdiD0XV3p6khFvhasMogf DTIgJhiZ1YLft1xsUgP0Uf/mY28iMbZGu7XKwpvIC15MVLRJ2UCOXel/LHdBLCrpeoQD gHzWwV+05Eae7STcv9Dw4MSeFGT57wejpWVBk9/TUpsukmdiZSA3LzRJ9F+VDlp2AL4O T8Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=wJ2hWDS5miTh2oCYRrKNT87EtbTQI1OoC8k0aftkDy4=; b=xSxAtuYyzU1cQL/dnJsVnzL44CG6wIMq252oyrAwRmEGEZrhksB9CQHG2TDGetWUG6 LrLQAdAzbUSgmWeyCe/dK8YXBf6oGB87YEG9RMSaVxcNcc+lOVSZw1brqKaDt0+DF8ur KIUIPjDHXiZmtQ+QkYQYzpDM3G1DsGSizjNRGRD5eWvSHiQTuZr5I1B6Jc9REZNEAOiR VupcP+Io5MeVRKvUU6G5rWihiH3DFfDgSBR75rpu4UovX4oLFCVhN/0AxNSEvbv4ySFR T/yjqb2Ks5F7djz2wbbLbWd+0r+UQzEWJsZoLdo7jqUBMfRZB7kvi20gqcLxu+lG0uV1 6waQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10-v6si12418391pgg.216.2018.10.26.13.03.38; Fri, 26 Oct 2018 13:03:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727764AbeJ0Elh (ORCPT + 99 others); Sat, 27 Oct 2018 00:41:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51372 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbeJ0Elh (ORCPT ); Sat, 27 Oct 2018 00:41:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0E5680F96; Fri, 26 Oct 2018 20:03:15 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28EA4183CF; Fri, 26 Oct 2018 20:03:11 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id w9QK3A85030069; Fri, 26 Oct 2018 16:03:10 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w9QK3A1a030065; Fri, 26 Oct 2018 16:03:10 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Fri, 26 Oct 2018 16:03:10 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Paul Lawrence cc: Alasdair Kergon , Mike Snitzer , linux-doc@vger.kernel.org, kernel-team@android.com, Jonathan Corbet , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, dm-devel@redhat.com, Shaohua Li Subject: Re: [dm-devel] [RFC] dm-bow working prototype In-Reply-To: <4a934593-1bd1-be5f-35c0-945c42762627@google.com> Message-ID: References: <20181023212358.60292-1-paullawrence@google.com> <20181023221819.GB17552@agk-dp.fab.redhat.com> <296148c2-f2d9-5818-ea76-d71a0d6f5cd4@google.com> <4a934593-1bd1-be5f-35c0-945c42762627@google.com> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 26 Oct 2018 20:03:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Oct 2018, Paul Lawrence wrote: > Thank you for the suggestion. I spent part of yesterday experimenting with > this idea, and it is certainly very promising. However, it does have some > disadvantages as compared to dm-bow, if I am understanding the setup > correctly: > > 1) Since dm-snap has no concept of the free space on the underlying file > system any write into the free space will trigger a backup, so using twice the > space of dm-bow. Changing existing data will create a backup with both > drivers, but since we have to reserve the space for the backups up-front with > dm-snap, we would likely only have half the space for that. Either way, it > seems that dm-bow is likely to double the amount of changes we could make. > > (Might it be possible to dynamically resize the backup file if it is mostly > used up? This would fix the problem of only having half the space for changing Yes - the snapshot store can be extended while the snapshot is active. > existing data. The documentation seems to indicate that you can increase the > size of the snapshot partition, and it seems like it should be possible to > grow the underlying file without triggering a lot of writes. OTOH this would > have to happen in userspace which creates other issues.) > > 2) Similarly, since writes into free space do not trigger a backup in dm-bow, > dm-bow is likely to have a lower performance overhead in many circumstances. > On the flip side, dm-bow's backup is in free space and will collide with other > writes, so this advantage will reduce as free space fills up. But by choosing > a suitable algorithm for how we use free space we might be able to retain most > of this advantage. > > I intend to put together a fully working prototype of your suggestion next to > better compare with dm-bow. But I do believe there is value in tracking free > space and utilizing it in any such solution. The snapshot target could be hacked so that it remembers space trimmed with REQ_OP_DISCARD and won't reallocate these blocks. But I suspect that running discard over the whole device would degrade performance more than copying some unneeded data. How much data do you intend to backup with this solution? Mikulas