Re: [Nbd] NBD kernel module, client and server with support for TRIM
- To: katon goukakyuuno <katongoukakyuuno@...223...>
- Cc: email@example.com
- Subject: Re: [Nbd] NBD kernel module, client and server with support for TRIM
- From: Wouter Verhelst <w@...112...>
- Date: Fri, 16 Mar 2012 18:58:13 +0100
- Message-id: <20120316175813.GY8426@...3...>
- In-reply-to: <CAKx_x+ANh2egJRPSrsDoKKurEioo2VwMP9ztYk2WL8q3FWB7qA@...18...>
- References: <CAKx_x+CjckUirdzKi+MxH9BfOGrNf0sXtMyYp6Xx_jbAPwL5Bg@...18...> <20120315203142.GH26123@...3...> <CAKx_x+ANh2egJRPSrsDoKKurEioo2VwMP9ztYk2WL8q3FWB7qA@...18...>
On Fri, Mar 16, 2012 at 10:42:03AM -0700, katon goukakyuuno wrote:
> Hi Wouter,
> Thank you very much for replying! I have patched my kernel to support only
> TRIM. I hope I need not apply the patch for FLUSH/FUA as well to just use TRIM?
> I hope all patches are added to the latest Linux kernel soon!
> I have also updated the nbd client and server to version 3.0 (the latest
> version) which does support TRIM.
> How do I test if TRIM is working properly on my system? Are there any test
> scripts readily available;
Not at this time. In fact, while I expect it to be working, I haven't
actually tested it much myself.
> or, do I need to create a new /dev/nbd and mount a
> file system which supports TRIM and then try to issue some commands from
> userspace? I haven't completely figured out this part yet.
Something like that. This should work:
- set the 'trim' option to 'true' in an nbd export
- connect to that NBD export from a client (may be the same machine)
- create an ext4 filesystem on that device
- mount the filesystem with the option 'discard'
- create a large file on the filesystem
- run 'du' on the nbd backend file
- remove the file
- sync again
- run 'du' again, and see if the file is now smaller. If it is, then a
TRIM command was sent successfully to the server.
The volume of a pizza of thickness a and radius z can be described by
the following formula:
pi zz a