From owner-svn-src-head@freebsd.org Fri Nov 30 14:23:15 2018 Return-Path: Delivered-To: svn-src-head@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 EB91111458C6 for ; Fri, 30 Nov 2018 14:23:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 E5BCC845AF for ; Fri, 30 Nov 2018 14:23:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id n12so3214533qkh.11 for ; Fri, 30 Nov 2018 06:23:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=heRaYwgEP5kiB9wX9aY17kjqVWYhTEctdb7ysAMCoI8=; b=cNJsGAWx7EOh3wSIiBJi16kv6VjbuZQ1yDHLcm3TWiYMXcl2pBX9aXszFOskenJWoN ElMeCSo0Qtk31Bn1x6OczjKPiKitSEp/RxMEGAo26AnalZ+IsOpnUBD6Tcy6yz/d8fa2 kDzjsmrN4aoBXQTt2PlhqbCYSG7/ocP8e15ryP85c8qQZ44druJLB0HsacPNuEqjXfYU E01aIHCGzL18FjQiyCbFZJ+ONemiZJJQuZ3XsLwVvu5EMEi3Gjun/n1hpevC+AQQoN/I ZxlYKegW5joRlpLVjq6NqEcKYObHVgjqKOfaRymSuzolWKDV71tKCDRj4bgU+nVhyf4i JVzw== 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=heRaYwgEP5kiB9wX9aY17kjqVWYhTEctdb7ysAMCoI8=; b=mSfd1r8DXY7jjeUzvKUYy5yZXVaO9dYj8DsT1J578mTmhLSbO+lxBsOqtF67zYw0FH g0wslhNKfLfpEIBxAt1t0ftxprvBCJ/+KDpnKHS8UH+LRx6i2jVJtZcTTnirfpOnHbUG 28m73719pn4MHkEDbHZ4EKBzzxWEFFH7pBfOM7LwFhQMSUP3CuBrTemBnVvgHzwhFUHD 74Kt/PzfVDYQNGbwfmOked+tVRKmpIUQCczUZA8dPU9SB6x916t3hyrCwsdQZLescNhX WGs7q1Ds/DxQL/hgoeXaL1HOAXAQopLMIoKnA6hpr+tn8ZrtzeMGH7cuet3Ya0oTHrIA lHJg== X-Gm-Message-State: AA+aEWZdmDEhlo9yBtq9KL9Gd3zLB6hH68Yf+o1IeFUK4Zy9fOfMhY8z WQnSK4+CQiiqqKpXdCj6XqOvtlZeW7S7DfnUVTxa8A== X-Google-Smtp-Source: AFSGD/VVGZfMGqL2f2fr7AdmjiwL7QEDJTGebO550rIyM9Ufv+99e+FqedfQWhZ2m3WI2XChV37PB/CAJSyH/yVf+5g= X-Received: by 2002:a37:6e86:: with SMTP id j128mr5616222qkc.46.1543587793256; Fri, 30 Nov 2018 06:23:13 -0800 (PST) MIME-Version: 1.0 References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> <20181130115515.GA28531@FreeBSD.org> <20181130125645.GA97463@FreeBSD.org> In-Reply-To: <20181130125645.GA97463@FreeBSD.org> From: Warner Losh Date: Fri, 30 Nov 2018 07:23:01 -0700 Message-ID: Subject: Re: svn: head/usr.bin: . trim To: Alexey Dokuchaev Cc: Eugene Grosbein , src-committers , svn-src-all@freebsd.org, Steven Hartland , svn-src-head@freebsd.org, Cy Schubert X-Rspamd-Queue-Id: E5BCC845AF X-Spamd-Result: default: False [-5.46 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[0.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.46)[ip: (-9.14), ipnet: 2607:f8b0::/32(-1.74), asn: 15169(-1.33), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 14:23:15 -0000 On Fri, Nov 30, 2018 at 5:57 AM Alexey Dokuchaev wrote: > On Fri, Nov 30, 2018 at 07:27:46PM +0700, Eugene Grosbein wrote: > > 30.11.2018 18:55, Alexey Dokuchaev wrote: > > > > >>> Another point: the manpage says, "It is only relevant for flash based > > >>> storage devices that use wear-leveling algorithms", which is an > argument > > >>> against generic "trim". I would mind less of it would be called > ftrim(8) > > >>> or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. > > > > [skip] > > > > > Yes, I understand you. Like I've said, a little more > flash-media-related > > > name would perhaps be more appropriate for such an utility. > > > > This excludes virtio_blk and ZFS. Perhaps, manpage should be corrected > > as quoted phrase has been taken from news -E description as is. > > How about mtrim(8) or media_trim(8)? I vaguely when back in times misc/mc > was installed as bin/midc because some commercial Unix implementation had > "mc" as a "media copy" command or something like that. > We should just put it in dd and remove this experiment. Both of these suggested names are horrible. They are too specific. And the notion that trim is too generic may have some merit, but the cure is worse than the disease. So I'm back to my point: we should just put it into dd and move on with our lives. It's really the right place for it. Why? Because then we can have 'dd if=image of=/dev/foo conf=sparse,erase' and it will erase the bits of the drive that are all 0's. We won't have to resort to weird hacks to make most of them trimmed. While this works only on media where trim is persistently 0's, that describes all modern flash media and most (all?) of the virtualization / thin storage scenarios I'm aware of. You can't do that with the current utility, at least not w/o a lot of effort. Warner