{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/3656","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/3656/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/3656/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/3656/events","html_url":"https://github.com/zfsonlinux/zfs/pull/3656","id":98622548,"number":3656,"title":"TRIM/Discard support from Nexenta","user":{"login":"dweeezil","id":1432005,"avatar_url":"https://avatars.githubusercontent.com/u/1432005?v=3","gravatar_id":"","url":"https://api.github.com/users/dweeezil","html_url":"https://github.com/dweeezil","followers_url":"https://api.github.com/users/dweeezil/followers","following_url":"https://api.github.com/users/dweeezil/following{/other_user}","gists_url":"https://api.github.com/users/dweeezil/gists{/gist_id}","starred_url":"https://api.github.com/users/dweeezil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dweeezil/subscriptions","organizations_url":"https://api.github.com/users/dweeezil/orgs","repos_url":"https://api.github.com/users/dweeezil/repos","events_url":"https://api.github.com/users/dweeezil/events{/privacy}","received_events_url":"https://api.github.com/users/dweeezil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":38,"created_at":"2015-08-02T17:10:22Z","updated_at":"2015-11-23T18:09:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/3656","html_url":"https://github.com/zfsonlinux/zfs/pull/3656","diff_url":"https://github.com/zfsonlinux/zfs/pull/3656.diff","patch_url":"https://github.com/zfsonlinux/zfs/pull/3656.patch"},"body":"This patch stack includes Nextenta's support for TRIM/Discard on disk and file vdevs as well as an update to the dkio headers for appropriate Solaris compatibility.  It requires the current https://github.com/dweeezil/spl/tree/ntrim patch in order to compile properly.\r\n\r\nThe usual disclaimers apply at this point:  I've performed moderate testing with ext4-backed file vdevs and light testing with SSD-backed disk vdevs and it appears to work properly.  Use at your own risk.  It may DESTROY YOUR DATA!  I'm posting the pull request because it seems to work during initial testing and I'd like the buildbots to get a chance at it (which I'm expecting to fail unless they use the corresponding SPL code).\r\n\r\nThe initial TRIM support (currently in commit 719301c) caused frequent deadlocks in ztest due to the SCL_ALL spa locking during the trim operations.  The follow-on patch to support on-demand trim changed the locking scheme and I'm no longer seeing deadlocks with either ztest or normal operation.\r\n\r\nThe final last commit (currently 9e5cfd7) adds ZIL logging for zvol trim operations.  This code was mostly borrowed from an older Nexenta patch (referenced in the commit log) and has been merged into the existing zvol trim function.\r\n\r\nIn order to enable the feature, you must use ```zpool set autotrim=on``` on the pool and the ```zfs_trim``` module parameter must be set to 1 (which is its default value).  The ```zfs_trim``` parameter controls the lower-level vdev trimming whereas the pool property controls it at a higher level.  By default, trims are batched and only applied every 32 transaction groups as controlled by the new ```zfs_txgs_per_trim``` parameter.  This allows for ```zpool import -T``` to continue to be useful.  Finally, by default, only regions of at least 1MiB are trimmed as set by the ```zfs_trim_min_ext_sz``` module parameter. "},"comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments/159015206","html_url":"https://github.com/zfsonlinux/zfs/pull/3656#issuecomment-159015206","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/3656","id":159015206,"user":{"login":"RichardSharpe","id":947462,"avatar_url":"https://avatars.githubusercontent.com/u/947462?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardSharpe","html_url":"https://github.com/RichardSharpe","followers_url":"https://api.github.com/users/RichardSharpe/followers","following_url":"https://api.github.com/users/RichardSharpe/following{/other_user}","gists_url":"https://api.github.com/users/RichardSharpe/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardSharpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardSharpe/subscriptions","organizations_url":"https://api.github.com/users/RichardSharpe/orgs","repos_url":"https://api.github.com/users/RichardSharpe/repos","events_url":"https://api.github.com/users/RichardSharpe/events{/privacy}","received_events_url":"https://api.github.com/users/RichardSharpe/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T18:09:21Z","updated_at":"2015-11-23T18:09:21Z","body":"It seems like I could change TQ_NOQUEUE to TQ_QUEUE to prevent that panic.\r\n\r\nDoes that seem correct?"}}