{"action":"created","comment":{"url":"https://api.github.com/repos/axboe/fio/pulls/comments/204449012","pull_request_review_id":139531783,"id":204449012,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDQ0OTAxMg==","diff_hunk":"@@ -3,6 +3,39 @@\n  *\n  * IO engine that uses the Linux SG v3 interface to talk to SCSI devices\n  *\n+ * This ioengine can operate in two modes:\n+ *\tsync\twith block devices (/dev/sdX) or\n+ *\t\twith character devices (/dev/sgY) with direct=1 or sync=1\n+ *\tasync\twith character devices with direct=0 and sync=0\n+ *\n+ * What value does queue() return for the different cases?\n+ *\t\t\t\tqueue() return value\n+ * In sync mode:\n+ *  /dev/sdX\t\tRWT\tFIO_Q_COMPLETED\n+ *  /dev/sgY\t\tRWT\tFIO_Q_COMPLETED\n+ *   with direct=1 or sync=1\n+ *\n+ * In async mode:\n+ *  /dev/sgY\t\tRWT\tFIO_Q_QUEUED\n+ *   direct=0 and sync=0\n+ *\n+ * Because FIO_SYNCIO is set for this ioengine td_io_queue() will fill in issue_time *before* each IO is sent to queue()\n+ *\n+ * Where are the IO counting functions called for the different cases?\n+ * In sync mode:\t\tio_u_mark_depth()\t\tio_u_mark_submit/comp()\t\tissue_time\n+ *  /dev/sdX:\t\tRWT\tcalled in td_io_queue()\t\tcalled in td_io_queue()\t\tset in td_io_queue()\n+ *  commit==NULL\n+ *\n+ *  /dev/sgY with direct=1 or sync=1:\n+ *  commit does nothing\tRWT\tcalled in td_io_queue()\t\tcalled in queue()\t\tset in td_io_queue()\n+ *\n+ *\n+ * In async mode:\t\tread and write operations are submitted in queue()\n+ *\t\t\tRW\tcalled in queue()\t\tsubmit called in queue()\tset in td_io_queue()\n+ *\n+ *\t\t\t\ttrim operations are queued in queue() and submitted in commit()\n+ *\t\t\tT\tcalled in commit()\t\tsubmit called in commit()\tset in commit()\n+ *","path":"engines/sg.c","position":36,"original_position":36,"commit_id":"b6d8cf387ad0d921b3c290abbcb93e00012efd13","original_commit_id":"f56dcff023501628421d549ae2c6684a9864fcb5","user":{"login":"axboe","id":2619634,"node_id":"MDQ6VXNlcjI2MTk2MzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2619634?v=4","gravatar_id":"","url":"https://api.github.com/users/axboe","html_url":"https://github.com/axboe","followers_url":"https://api.github.com/users/axboe/followers","following_url":"https://api.github.com/users/axboe/following{/other_user}","gists_url":"https://api.github.com/users/axboe/gists{/gist_id}","starred_url":"https://api.github.com/users/axboe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axboe/subscriptions","organizations_url":"https://api.github.com/users/axboe/orgs","repos_url":"https://api.github.com/users/axboe/repos","events_url":"https://api.github.com/users/axboe/events{/privacy}","received_events_url":"https://api.github.com/users/axboe/received_events","type":"User","site_admin":false},"body":"I like the detailed explanations, but please keep it within 80 chars. It's unreadable in my term.","created_at":"2018-07-23T15:36:14Z","updated_at":"2018-07-23T15:36:14Z","html_url":"https://github.com/axboe/fio/pull/626#discussion_r204449012","pull_request_url":"https://api.github.com/repos/axboe/fio/pulls/626","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/axboe/fio/pulls/comments/204449012"},"html":{"href":"https://github.com/axboe/fio/pull/626#discussion_r204449012"},"pull_request":{"href":"https://api.github.com/repos/axboe/fio/pulls/626"}}},"pull_request":{"url":"https://api.github.com/repos/axboe/fio/pulls/626","id":203258376,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMjU4Mzc2","html_url":"https://github.com/axboe/fio/pull/626","diff_url":"https://github.com/axboe/fio/pull/626.diff","patch_url":"https://github.com/axboe/fio/pull/626.patch","issue_url":"https://api.github.com/repos/axboe/fio/issues/626","number":626,"state":"open","locked":false,"title":"Add trim support to the sg ioengine","user":{"login":"vincentkfu","id":24612399,"node_id":"MDQ6VXNlcjI0NjEyMzk5","avatar_url":"https://avatars0.githubusercontent.com/u/24612399?v=4","gravatar_id":"","url":"https://api.github.com/users/vincentkfu","html_url":"https://github.com/vincentkfu","followers_url":"https://api.github.com/users/vincentkfu/followers","following_url":"https://api.github.com/users/vincentkfu/following{/other_user}","gists_url":"https://api.github.com/users/vincentkfu/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentkfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentkfu/subscriptions","organizations_url":"https://api.github.com/users/vincentkfu/orgs","repos_url":"https://api.github.com/users/vincentkfu/repos","events_url":"https://api.github.com/users/vincentkfu/events{/privacy}","received_events_url":"https://api.github.com/users/vincentkfu/received_events","type":"User","site_admin":false},"body":"This is a follow-up to #590 \r\n\r\nJens, please consider this pull request.\r\n\r\nThese patches add trim support to the sg ioengine via the SCSI unmap command. Following the established sg pattern, unmap commands for block devices are carried out synchronously. For character devices, however, it is possible to submit multiple ranges with a single unmap command by setting iodepth_batch.\r\n\r\n@sitsofe, I considered adding an option to use WRITE SAME but using unmap was my first priority since that was what was requested by the group that this feature was developed for. Note that it would be pretty easy to add an option so that write workloads with sg_write_mode=same carry out trims.","created_at":"2018-07-23T15:32:20Z","updated_at":"2018-07-23T15:36:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96efc11f4e1b11024813405e0f2a010553d0f6c8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/axboe/fio/pulls/626/commits","review_comments_url":"https://api.github.com/repos/axboe/fio/pulls/626/comments","review_comment_url":"https://api.github.com/repos/axboe/fio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/axboe/fio/issues/626/comments","statuses_url":"https://api.github.com/repos/axboe/fio/statuses/b6d8cf387ad0d921b3c290abbcb93e00012efd13","head":{"label":"vincentkfu:sgunmap2","ref":"sgunmap2","sha":"b6d8cf387ad0d921b3c290abbcb93e00012efd13","user":{"login":"vincentkfu","id":24612399,"node_id":"MDQ6VXNlcjI0NjEyMzk5","avatar_url":"https://avatars0.githubusercontent.com/u/24612399?v=4","gravatar_id":"","url":"https://api.github.com/users/vincentkfu","html_url":"https://github.com/vincentkfu","followers_url":"https://api.github.com/users/vincentkfu/followers","following_url":"https://api.github.com/users/vincentkfu/following{/other_user}","gists_url":"https://api.github.com/users/vincentkfu/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentkfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentkfu/subscriptions","organizations_url":"https://api.github.com/users/vincentkfu/orgs","repos_url":"https://api.github.com/users/vincentkfu/repos","events_url":"https://api.github.com/users/vincentkfu/events{/privacy}","received_events_url":"https://api.github.com/users/vincentkfu/received_events","type":"User","site_admin":false},"repo":{"id":95021259,"node_id":"MDEwOlJlcG9zaXRvcnk5NTAyMTI1OQ==","name":"fio","full_name":"vincentkfu/fio","owner":{"login":"vincentkfu","id":24612399,"node_id":"MDQ6VXNlcjI0NjEyMzk5","avatar_url":"https://avatars0.githubusercontent.com/u/24612399?v=4","gravatar_id":"","url":"https://api.github.com/users/vincentkfu","html_url":"https://github.com/vincentkfu","followers_url":"https://api.github.com/users/vincentkfu/followers","following_url":"https://api.github.com/users/vincentkfu/following{/other_user}","gists_url":"https://api.github.com/users/vincentkfu/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentkfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentkfu/subscriptions","organizations_url":"https://api.github.com/users/vincentkfu/orgs","repos_url":"https://api.github.com/users/vincentkfu/repos","events_url":"https://api.github.com/users/vincentkfu/events{/privacy}","received_events_url":"https://api.github.com/users/vincentkfu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vincentkfu/fio","description":"Flexible I/O Tester","fork":true,"url":"https://api.github.com/repos/vincentkfu/fio","forks_url":"https://api.github.com/repos/vincentkfu/fio/forks","keys_url":"https://api.github.com/repos/vincentkfu/fio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vincentkfu/fio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vincentkfu/fio/teams","hooks_url":"https://api.github.com/repos/vincentkfu/fio/hooks","issue_events_url":"https://api.github.com/repos/vincentkfu/fio/issues/events{/number}","events_url":"https://api.github.com/repos/vincentkfu/fio/events","assignees_url":"https://api.github.com/repos/vincentkfu/fio/assignees{/user}","branches_url":"https://api.github.com/repos/vincentkfu/fio/branches{/branch}","tags_url":"https://api.github.com/repos/vincentkfu/fio/tags","blobs_url":"https://api.github.com/repos/vincentkfu/fio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vincentkfu/fio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vincentkfu/fio/git/refs{/sha}","trees_url":"https://api.github.com/repos/vincentkfu/fio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vincentkfu/fio/statuses/{sha}","languages_url":"https://api.github.com/repos/vincentkfu/fio/languages","stargazers_url":"https://api.github.com/repos/vincentkfu/fio/stargazers","contributors_url":"https://api.github.com/repos/vincentkfu/fio/contributors","subscribers_url":"https://api.github.com/repos/vincentkfu/fio/subscribers","subscription_url":"https://api.github.com/repos/vincentkfu/fio/subscription","commits_url":"https://api.github.com/repos/vincentkfu/fio/commits{/sha}","git_commits_url":"https://api.github.com/repos/vincentkfu/fio/git/commits{/sha}","comments_url":"https://api.github.com/repos/vincentkfu/fio/comments{/number}","issue_comment_url":"https://api.github.com/repos/vincentkfu/fio/issues/comments{/number}","contents_url":"https://api.github.com/repos/vincentkfu/fio/contents/{+path}","compare_url":"https://api.github.com/repos/vincentkfu/fio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vincentkfu/fio/merges","archive_url":"https://api.github.com/repos/vincentkfu/fio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vincentkfu/fio/downloads","issues_url":"https://api.github.com/repos/vincentkfu/fio/issues{/number}","pulls_url":"https://api.github.com/repos/vincentkfu/fio/pulls{/number}","milestones_url":"https://api.github.com/repos/vincentkfu/fio/milestones{/number}","notifications_url":"https://api.github.com/repos/vincentkfu/fio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vincentkfu/fio/labels{/name}","releases_url":"https://api.github.com/repos/vincentkfu/fio/releases{/id}","deployments_url":"https://api.github.com/repos/vincentkfu/fio/deployments","created_at":"2017-06-21T15:56:06Z","updated_at":"2018-06-18T17:15:23Z","pushed_at":"2018-07-23T14:49:47Z","git_url":"git://github.com/vincentkfu/fio.git","ssh_url":"git@github.com:vincentkfu/fio.git","clone_url":"https://github.com/vincentkfu/fio.git","svn_url":"https://github.com/vincentkfu/fio","homepage":null,"size":17781,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"axboe:master","ref":"master","sha":"5fff95436922873dd9ded8b21af7222689e2ec5d","user":{"login":"axboe","id":2619634,"node_id":"MDQ6VXNlcjI2MTk2MzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2619634?v=4","gravatar_id":"","url":"https://api.github.com/users/axboe","html_url":"https://github.com/axboe","followers_url":"https://api.github.com/users/axboe/followers","following_url":"https://api.github.com/users/axboe/following{/other_user}","gists_url":"https://api.github.com/users/axboe/gists{/gist_id}","starred_url":"https://api.github.com/users/axboe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axboe/subscriptions","organizations_url":"https://api.github.com/users/axboe/orgs","repos_url":"https://api.github.com/users/axboe/repos","events_url":"https://api.github.com/users/axboe/events{/privacy}","received_events_url":"https://api.github.com/users/axboe/received_events","type":"User","site_admin":false},"repo":{"id":6331631,"node_id":"MDEwOlJlcG9zaXRvcnk2MzMxNjMx","name":"fio","full_name":"axboe/fio","owner":{"login":"axboe","id":2619634,"node_id":"MDQ6VXNlcjI2MTk2MzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2619634?v=4","gravatar_id":"","url":"https://api.github.com/users/axboe","html_url":"https://github.com/axboe","followers_url":"https://api.github.com/users/axboe/followers","following_url":"https://api.github.com/users/axboe/following{/other_user}","gists_url":"https://api.github.com/users/axboe/gists{/gist_id}","starred_url":"https://api.github.com/users/axboe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axboe/subscriptions","organizations_url":"https://api.github.com/users/axboe/orgs","repos_url":"https://api.github.com/users/axboe/repos","events_url":"https://api.github.com/users/axboe/events{/privacy}","received_events_url":"https://api.github.com/users/axboe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/axboe/fio","description":"Flexible I/O Tester","fork":false,"url":"https://api.github.com/repos/axboe/fio","forks_url":"https://api.github.com/repos/axboe/fio/forks","keys_url":"https://api.github.com/repos/axboe/fio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axboe/fio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axboe/fio/teams","hooks_url":"https://api.github.com/repos/axboe/fio/hooks","issue_events_url":"https://api.github.com/repos/axboe/fio/issues/events{/number}","events_url":"https://api.github.com/repos/axboe/fio/events","assignees_url":"https://api.github.com/repos/axboe/fio/assignees{/user}","branches_url":"https://api.github.com/repos/axboe/fio/branches{/branch}","tags_url":"https://api.github.com/repos/axboe/fio/tags","blobs_url":"https://api.github.com/repos/axboe/fio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axboe/fio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axboe/fio/git/refs{/sha}","trees_url":"https://api.github.com/repos/axboe/fio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axboe/fio/statuses/{sha}","languages_url":"https://api.github.com/repos/axboe/fio/languages","stargazers_url":"https://api.github.com/repos/axboe/fio/stargazers","contributors_url":"https://api.github.com/repos/axboe/fio/contributors","subscribers_url":"https://api.github.com/repos/axboe/fio/subscribers","subscription_url":"https://api.github.com/repos/axboe/fio/subscription","commits_url":"https://api.github.com/repos/axboe/fio/commits{/sha}","git_commits_url":"https://api.github.com/repos/axboe/fio/git/commits{/sha}","comments_url":"https://api.github.com/repos/axboe/fio/comments{/number}","issue_comment_url":"https://api.github.com/repos/axboe/fio/issues/comments{/number}","contents_url":"https://api.github.com/repos/axboe/fio/contents/{+path}","compare_url":"https://api.github.com/repos/axboe/fio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axboe/fio/merges","archive_url":"https://api.github.com/repos/axboe/fio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axboe/fio/downloads","issues_url":"https://api.github.com/repos/axboe/fio/issues{/number}","pulls_url":"https://api.github.com/repos/axboe/fio/pulls{/number}","milestones_url":"https://api.github.com/repos/axboe/fio/milestones{/number}","notifications_url":"https://api.github.com/repos/axboe/fio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axboe/fio/labels{/name}","releases_url":"https://api.github.com/repos/axboe/fio/releases{/id}","deployments_url":"https://api.github.com/repos/axboe/fio/deployments","created_at":"2012-10-22T08:20:41Z","updated_at":"2018-07-23T15:17:19Z","pushed_at":"2018-07-23T15:32:21Z","git_url":"git://github.com/axboe/fio.git","ssh_url":"git@github.com:axboe/fio.git","clone_url":"https://github.com/axboe/fio.git","svn_url":"https://github.com/axboe/fio","homepage":null,"size":17801,"stargazers_count":1209,"watchers_count":1209,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":459,"mirror_url":null,"archived":false,"open_issues_count":61,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":459,"open_issues":61,"watchers":1209,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/axboe/fio/pulls/626"},"html":{"href":"https://github.com/axboe/fio/pull/626"},"issue":{"href":"https://api.github.com/repos/axboe/fio/issues/626"},"comments":{"href":"https://api.github.com/repos/axboe/fio/issues/626/comments"},"review_comments":{"href":"https://api.github.com/repos/axboe/fio/pulls/626/comments"},"review_comment":{"href":"https://api.github.com/repos/axboe/fio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/axboe/fio/pulls/626/commits"},"statuses":{"href":"https://api.github.com/repos/axboe/fio/statuses/b6d8cf387ad0d921b3c290abbcb93e00012efd13"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"axboe"}}