Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Nov 2018 11:42:05 +0100
From:      Lars Engels <lars.engels@0x20.net>
To:        Eugene Grosbein <eugen@grosbein.net>
Cc:        Warner Losh <imp@bsdimp.com>, FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: TRIM utility
Message-ID:  <20181123104205.GZ59358@e.0x20.net>
In-Reply-To: <6975ff4e-6383-e52c-3a11-d35b95cca114@grosbein.net>
References:  <7699de57-d903-1d61-ee42-062ed312b20d@grosbein.net> <CANCZdfr4fADoG9OzPC8TXd6CeMkUqYqosx3QkheP08BTB7ajwA@mail.gmail.com> <6975ff4e-6383-e52c-3a11-d35b95cca114@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 23, 2018 at 01:59:31PM +0700, Eugene Grosbein wrote:
> 23.11.2018 6:20, Warner Losh wrote:
> 
> >> I found we have no utility capable to perform TRIM for the whole SSD device
> >> or arbitrary part of it, so I wrote simple one. I can't think of nice name
> >> for it, so proposal are welcome! Draft name is "erase".
> >>
> >> I ask for pre-commit code review, too.
> >> The code is tested with TRIM-capable SSD and non-capable other devices.
> >>
> >> Currently it has four options, all of them are, hmm, optional:
> >>
> >> -b: to specify offset from the beginning of the device for trimmed region
> >> instead of default 0;
> >> -l: to specify offset from the "-b" margin - length - for trimmed region
> >> instead of whole device;
> >> -r rfile: for alternative way to specify length as length of referenced
> >> file;
> >>
> > 
> > This seems really obscure and would be better handled by a stat command.
> 
> This is inspired by truncate(1) having same option that saves extra call to stat.
> 
> Forgot to note, that options -b and -l allow suffixes [K|k|M|m|G|g|T|t]
> just like truncate's option -s does.
> 
> > "erase" is a really bad name. It's fraught with too many overloaded
> > meanings. "trim" is likely the least bad name we can use.
> 
> I'm fine with this, renamed.
> 
> > Linux has a fstrim command, which does something kinda similar (it's a lot
> > like fsck -E to erase unused parts of the filesystem), so there is some
> > overlap. I couldn't find a dedicated command to do that, but if it does, we
> > should follow that convention to reimplement.
> 
> Well, they have http://man7.org/linux/man-pages/man8/blkdiscard.8.html
> 
> I don't like the name, though. It's too complicated to pronounce and too long same time.

Would "hdtrim" or "ssdtrim" be better names?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181123104205.GZ59358>