From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8131EC282D8 for ; Fri, 1 Feb 2019 13:49:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F6DE218A6 for ; Fri, 1 Feb 2019 13:49:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RaOkHi0b" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730318AbfBANtz (ORCPT ); Fri, 1 Feb 2019 08:49:55 -0500 Received: from mail-yb1-f170.google.com ([209.85.219.170]:34531 "EHLO mail-yb1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbfBANtz (ORCPT ); Fri, 1 Feb 2019 08:49:55 -0500 Received: by mail-yb1-f170.google.com with SMTP id k9so2684401ybg.1; Fri, 01 Feb 2019 05:49:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HR4U/MUdv+L2fwtndkN+jN+MeZINqMtUbeniQX6LjoA=; b=RaOkHi0bqyKdU05PsiiG2pLuYvQv9AEDCKEVpYEtuMbBtEr4rRSpXAkbUZ84uWjsSH FURIlz89P8YQqfVIgVPPDafQgTrtGiKTZz/p7MfdzCSrSy2tFXDh0xida/p52PuSxE2y w+fo8QWb+PGGDpzOTGfN1Jbjz8PomuBk9X4xD50/aZATUDN7Vx9D5rqo0VmudtL9BhBY Bpu3LLdXu7/OlPsb/PdRMCAOG0Aq+X+JZp/+KlFR8yqVYUe8GDbedXO5HdBYPYULmoB9 GbZ9pFYy+5kbsKYVkFVpTXCEHADa5d/xkNXTaobpAY5sVUoO6p1J88SADu4irpcWkOu7 Gh/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HR4U/MUdv+L2fwtndkN+jN+MeZINqMtUbeniQX6LjoA=; b=VR4ZpGnHcANm7AMn/hUPgU7fxCfDxQUWG8c7wrF1DgE6tlxvXn/f78ditQwxhwg0qR dLfq4aQNmTXXPTAaoD376XA1HyC/MHtqLs4On7G2MJe4Sw0im4rnOt7xoBd17ee/vpTR hqf2E3zOxnqG+tgcf+6Ug53RZfoQ/CJA81zuHqS96Fc+FpHzvT1JacnV70bO3k82AoYf oURH7p4acRUBzCbTmeps9uNHqeEEkN+WRNTuA9mRgyOkcO6GAtBy74gpN9CLWvzIVHVy 8uMdB/bPeMfqYvALjvAO9JNDAmWDSi0B33BAsBtLxeSS2LXw1C9TRF6o+3mFOBRX3X2f EWLQ== X-Gm-Message-State: AHQUAuZGYAFKIxlKL3Tm0dakeUNt0WotN1fRlnZB7QIO9ApXdsGacrfu Ux/9G+SZqONB2XDtaJ8UfDtbLyuNG71fGPoPLu4M7g== X-Google-Smtp-Source: AHgI3IZRfU9Mf5k8Bv3kidmd3BNSQYp65rkellu3myRTPuoAQlUY/6t2GpHakDrZTyP0/eueczAMq5ONS3Vivet2xr8= X-Received: by 2002:a25:8242:: with SMTP id d2mr18371805ybn.507.1549028994142; Fri, 01 Feb 2019 05:49:54 -0800 (PST) MIME-Version: 1.0 References: <20190128125044.GC27972@quack2.suse.cz> <20190128212642.GQ4205@dastard> <20190131211351.GB26359@bombadil.infradead.org> In-Reply-To: <20190131211351.GB26359@bombadil.infradead.org> From: Amir Goldstein Date: Fri, 1 Feb 2019 15:49:42 +0200 Message-ID: Subject: Re: [LSF/MM TOPIC] Lazy file reflink To: Matthew Wilcox Cc: Dave Chinner , Jan Kara , lsf-pc@lists.linux-foundation.org, linux-fsdevel , linux-xfs , "Darrick J. Wong" , Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Jan 31, 2019 at 11:13 PM Matthew Wilcox wrote: > > On Tue, Jan 29, 2019 at 08:26:43AM +1100, Dave Chinner wrote: > > Really, though, for this use case it's make more sense to have "per > > file freeze" semantics. i.e. if you want a consistent backup image > > on snapshot capable storage, the process is usually "freeze > > filesystem, snapshot fs, unfreeze fs, do backup from snapshot, > > remove snapshot". We can already transparently block incoming > > writes/modifications on files via the freeze mechanism, so why not > > just extend that to per-file granularity so writes to the "very > > large read-mostly file" block while it's being backed up.... > > > > Indeed, this would probably only require a simple extension to > > FIFREEZE/FITHAW - the parameter is currently ignored, but as defined > > by XFS it was a "freeze level". Set this to 0xffffffff and then it > > freezes just the fd passed in, not the whole filesystem. > > Alternatively, FI_FREEZE_FILE/FI_THAW_FILE is simple to define... > > This sounds like you want a lease (aka oplock), which we already have > implemented. Yes, its possibly true. I think that it could make sense to skip the reflink optimization for files that are open for write in our workloads. I'll need to check with my peers. Thanks, Amir.