From owner-freebsd-fs@freebsd.org Tue Nov 13 23:09:05 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F99E113658B; Tue, 13 Nov 2018 23:09:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com [209.85.166.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D92B7E388; Tue, 13 Nov 2018 23:09:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f179.google.com with SMTP id v11so21183381itj.0; Tue, 13 Nov 2018 15:09:04 -0800 (PST) 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:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=9stKphtTKlpfIWzZb+DMF+rZL4fj6TT/NCpcLOJ/7BA=; b=HrGqAB+OdmOXMmjltowy9196FACbdzsUom2W9Vj9Z1pPn6oa27yTzetGIfDPfQCEvj qeT1AO4yWAbwjJ1jBDoYADUW7jdKwt3b/jiUazfqwOx77FJrUQUTlxzJvz8PIk3aojNo E+om/W9QiscLWt/9paG5sqrqm0MCD+HG3DXc10SVTPT3VbSxgYRjIFQ7STvxFCZuiNCB dq5OmKLa6pqSOKqHRyIiIRV3yivw5Z2fPny9gbsleVlwjCSqlreIcWHAwd9slcDd0UjB 0vAq+toyX0g5Cenbm1cS57LFr7ffhtVSLL3AGVuF/TlE0YVsn/EoVWcrPKw37fPHgHY3 wCPA== X-Gm-Message-State: AGRZ1gIMhUVt7RTFkc6Vk18ExU/mLxh/f/hpvKXXqYC09hYuURh+3s5E q2uCwHymAFIf27rO7SKhCIWLTIqb X-Google-Smtp-Source: AJdET5eFJzKMYLTriBR2sKkjueOV5D2rIGNuIXTNiNCkHl+xPT2zC6mWTIDsilVkfm3+rekJqFvvxA== X-Received: by 2002:a02:12c5:: with SMTP id 66mr6091541jap.54.1542150543558; Tue, 13 Nov 2018 15:09:03 -0800 (PST) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com. [209.85.166.41]) by smtp.gmail.com with ESMTPSA id n24-v6sm2786499ioc.65.2018.11.13.15.09.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 15:09:03 -0800 (PST) Received: by mail-io1-f41.google.com with SMTP id h4so6178227iom.5; Tue, 13 Nov 2018 15:09:03 -0800 (PST) X-Received: by 2002:a6b:6119:: with SMTP id v25mr6169014iob.107.1542150542921; Tue, 13 Nov 2018 15:09:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 13 Nov 2018 15:08:51 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Hole-punching, TRIM, etc To: Alan Somers Cc: "freebsd-arch@freebsd.org" , freebsd-fs , freebsd-current Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 9D92B7E388 X-Spamd-Result: default: False [-4.05 / 200.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; IP_SCORE(-1.09)[ipnet: 209.85.128.0/17(-3.45), asn: 15169(-1.90), country: US(-0.09)]; RCVD_IN_DNSWL_NONE(0.00)[179.166.85.209.list.dnswl.org : 127.0.5.0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 23:09:05 -0000 On Tue, Nov 13, 2018 at 2:59 PM Alan Somers wrote: > > On Tue, Nov 13, 2018 at 3:51 PM Conrad Meyer wrote: >> >> On Tue, Nov 13, 2018 at 2:10 PM Alan Somers wrote: >> > ... >> > 8) Add aio_freesp(2), an asynchronous version of fcntl(F_FREESP). >> >> Why not just add DIOCGDELETE support to various VOP_IOCTL >> implementations? The file objects forward correctly through vn_ioctl >> to VOP_IOCTL for both regular files and devfs VCHR nodes. >> >> We can emulate the Linux API if we want to be compatible there, but I >> wouldn't bother with Solaris. > > The only reason that I prefer the Solaris API is because it doesn't requi= re adding another syscall, and because Linux's fallocate(2) does a whole bu= nch of other things besides hole-punching. I am imagining that if we went this route, we would implement Linux fallocate as a library shim around the native FreeBSD ioctl (or whatever) rather than an independent system call. This would be for API compatibility, not ABI compatibility. But Linux compat can be set aside for now, I think =E2=80=94 it's a secondary concern. > What about an asynchronous version? ioctl(2) is still synchronous. Do y= ou see any better way to hole-punch/TRIM asynchronously than with aio? Yeah, this is a good consideration. No, I don't have any better suggestion for an asynchronous API. In general our VOPs tend to be synchronous. Aio does seem like the logical home for a new asynchronous API. Best regards, Conrad