From owner-svn-src-all@freebsd.org Fri Nov 30 17:02:54 2018 Return-Path: Delivered-To: svn-src-all@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 9A23A1149DFE; Fri, 30 Nov 2018 17:02:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E57106C8D7; Fri, 30 Nov 2018 17:02:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAUGkJmc019025; Fri, 30 Nov 2018 08:46:19 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAUGkICh019024; Fri, 30 Nov 2018 08:46:18 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811301646.wAUGkICh019024@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn: head/usr.bin: . trim In-Reply-To: To: Warner Losh Date: Fri, 30 Nov 2018 08:46:18 -0800 (PST) CC: Alexey Dokuchaev , Eugene Grosbein , src-committers , svn-src-all@freebsd.org, Steven Hartland , svn-src-head@freebsd.org, Cy Schubert Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: E57106C8D7 X-Spamd-Result: default: False [-1.21 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.78)[-0.778,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.76)[-0.758,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_HAM_SHORT(-0.55)[-0.549,0]; RCPT_COUNT_SEVEN(0.00)[8]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 17:02:54 -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 conf -> conv, and why erase? We are not actually erasing anything during this "copy" operation. I am having some confusion as to how the above would actually do the same thing that trim(8) implements. I do not really care if this is implemented as trim(8) or part of dd, either way is reasonable, though I am upset at repeating the discussion that already occured pre commit. Seems not enough committers follow hackers any more, so that has become a poor forum for vettting ideas, and now we post commit vet them on -commit. > 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. If your reading from file image and writting to dev foo I do not see that description matching the above command invocation. I think it would be: dd if=/dev/foo of=/dev/foo conv=noerror,sync,trim sparse is not involved, it is for files, not devices. erase imho is the wrong keyword, nothing in the trim/delete world calls this operation erase do they? trim could imply noerror,sync. -- Rod Grimes rgrimes@freebsd.org