{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/47356749","id":47356749,"diff_hunk":"@@ -1666,6 +1675,20 @@ void FileJournal::pop_write()\n   writeq.pop_front();\n }\n \n+void FileJournal::batch_peek_write(list<write_item> &items)\n+{\n+  assert(write_lock.is_locked());\n+  Mutex::Locker locker(writeq_lock);\n+  writeq.swap(items);\n+}\n+\n+void FileJournal::backfill_write(list<write_item> &items)\n+{\n+  assert(write_lock.is_locked());\n+  Mutex::Locker locker(writeq_lock);\n+  writeq.splice(writeq.begin(), items);\n+}\n+","path":"src/os/FileJournal.cc","position":130,"original_position":130,"commit_id":"5f11f818627d45b78d77da5535d720efa2c64721","original_commit_id":"5f11f818627d45b78d77da5535d720efa2c64721","user":{"login":"liewegas","id":433031,"avatar_url":"https://avatars.githubusercontent.com/u/433031?v=3","gravatar_id":"","url":"https://api.github.com/users/liewegas","html_url":"https://github.com/liewegas","followers_url":"https://api.github.com/users/liewegas/followers","following_url":"https://api.github.com/users/liewegas/following{/other_user}","gists_url":"https://api.github.com/users/liewegas/gists{/gist_id}","starred_url":"https://api.github.com/users/liewegas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liewegas/subscriptions","organizations_url":"https://api.github.com/users/liewegas/orgs","repos_url":"https://api.github.com/users/liewegas/repos","events_url":"https://api.github.com/users/liewegas/events{/privacy}","received_events_url":"https://api.github.com/users/liewegas/received_events","type":"User","site_admin":false},"body":"I'd call these batch_shift_writeq() and batch_unshift_writeq()?  (shift/unshift being the opposite of pop/push, as in perl).","created_at":"2015-12-11T13:57:43Z","updated_at":"2015-12-11T13:57:43Z","html_url":"https://github.com/ceph/ceph/pull/6701#discussion_r47356749","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/6701","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/47356749"},"html":{"href":"https://github.com/ceph/ceph/pull/6701#discussion_r47356749"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/6701"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/6701","id":51804274,"html_url":"https://github.com/ceph/ceph/pull/6701","diff_url":"https://github.com/ceph/ceph/pull/6701.diff","patch_url":"https://github.com/ceph/ceph/pull/6701.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/6701","number":6701,"state":"open","locked":false,"title":"FileJournal: Support batch peak and pop from writeq","user":{"login":"XinzeChi","id":3147032,"avatar_url":"https://avatars.githubusercontent.com/u/3147032?v=3","gravatar_id":"","url":"https://api.github.com/users/XinzeChi","html_url":"https://github.com/XinzeChi","followers_url":"https://api.github.com/users/XinzeChi/followers","following_url":"https://api.github.com/users/XinzeChi/following{/other_user}","gists_url":"https://api.github.com/users/XinzeChi/gists{/gist_id}","starred_url":"https://api.github.com/users/XinzeChi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XinzeChi/subscriptions","organizations_url":"https://api.github.com/users/XinzeChi/orgs","repos_url":"https://api.github.com/users/XinzeChi/repos","events_url":"https://api.github.com/users/XinzeChi/events{/privacy}","received_events_url":"https://api.github.com/users/XinzeChi/received_events","type":"User","site_admin":false},"body":"This would reduce writeq_lock contentions a lot.\r\nSigned-off-by: Xinze Chi <xinze@xsky.com>","created_at":"2015-11-25T14:59:02Z","updated_at":"2015-12-11T13:57:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a4338a2a280bbceb6962392d89e5b6e4bfba7d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/6701/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/6701/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/6701/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/5f11f818627d45b78d77da5535d720efa2c64721","head":{"label":"XinzeChi:wip-batch-peek-journal","ref":"wip-batch-peek-journal","sha":"5f11f818627d45b78d77da5535d720efa2c64721","user":{"login":"XinzeChi","id":3147032,"avatar_url":"https://avatars.githubusercontent.com/u/3147032?v=3","gravatar_id":"","url":"https://api.github.com/users/XinzeChi","html_url":"https://github.com/XinzeChi","followers_url":"https://api.github.com/users/XinzeChi/followers","following_url":"https://api.github.com/users/XinzeChi/following{/other_user}","gists_url":"https://api.github.com/users/XinzeChi/gists{/gist_id}","starred_url":"https://api.github.com/users/XinzeChi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XinzeChi/subscriptions","organizations_url":"https://api.github.com/users/XinzeChi/orgs","repos_url":"https://api.github.com/users/XinzeChi/repos","events_url":"https://api.github.com/users/XinzeChi/events{/privacy}","received_events_url":"https://api.github.com/users/XinzeChi/received_events","type":"User","site_admin":false},"repo":{"id":25850756,"name":"ceph","full_name":"XinzeChi/ceph","owner":{"login":"XinzeChi","id":3147032,"avatar_url":"https://avatars.githubusercontent.com/u/3147032?v=3","gravatar_id":"","url":"https://api.github.com/users/XinzeChi","html_url":"https://github.com/XinzeChi","followers_url":"https://api.github.com/users/XinzeChi/followers","following_url":"https://api.github.com/users/XinzeChi/following{/other_user}","gists_url":"https://api.github.com/users/XinzeChi/gists{/gist_id}","starred_url":"https://api.github.com/users/XinzeChi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XinzeChi/subscriptions","organizations_url":"https://api.github.com/users/XinzeChi/orgs","repos_url":"https://api.github.com/users/XinzeChi/repos","events_url":"https://api.github.com/users/XinzeChi/events{/privacy}","received_events_url":"https://api.github.com/users/XinzeChi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/XinzeChi/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/XinzeChi/ceph","forks_url":"https://api.github.com/repos/XinzeChi/ceph/forks","keys_url":"https://api.github.com/repos/XinzeChi/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XinzeChi/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XinzeChi/ceph/teams","hooks_url":"https://api.github.com/repos/XinzeChi/ceph/hooks","issue_events_url":"https://api.github.com/repos/XinzeChi/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/XinzeChi/ceph/events","assignees_url":"https://api.github.com/repos/XinzeChi/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/XinzeChi/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/XinzeChi/ceph/tags","blobs_url":"https://api.github.com/repos/XinzeChi/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XinzeChi/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XinzeChi/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/XinzeChi/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XinzeChi/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/XinzeChi/ceph/languages","stargazers_url":"https://api.github.com/repos/XinzeChi/ceph/stargazers","contributors_url":"https://api.github.com/repos/XinzeChi/ceph/contributors","subscribers_url":"https://api.github.com/repos/XinzeChi/ceph/subscribers","subscription_url":"https://api.github.com/repos/XinzeChi/ceph/subscription","commits_url":"https://api.github.com/repos/XinzeChi/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/XinzeChi/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/XinzeChi/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/XinzeChi/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/XinzeChi/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/XinzeChi/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XinzeChi/ceph/merges","archive_url":"https://api.github.com/repos/XinzeChi/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XinzeChi/ceph/downloads","issues_url":"https://api.github.com/repos/XinzeChi/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/XinzeChi/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/XinzeChi/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/XinzeChi/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XinzeChi/ceph/labels{/name}","releases_url":"https://api.github.com/repos/XinzeChi/ceph/releases{/id}","created_at":"2014-10-28T03:06:13Z","updated_at":"2015-05-01T23:44:24Z","pushed_at":"2015-12-11T11:57:04Z","git_url":"git://github.com/XinzeChi/ceph.git","ssh_url":"git@github.com:XinzeChi/ceph.git","clone_url":"https://github.com/XinzeChi/ceph.git","svn_url":"https://github.com/XinzeChi/ceph","homepage":"http://ceph.com","size":145504,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"88fe166cfa05d73334717706d3ce9ab0899789ea","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","created_at":"2011-09-01T21:41:26Z","updated_at":"2015-12-10T16:12:25Z","pushed_at":"2015-12-11T13:35:57Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":172226,"stargazers_count":1726,"watchers_count":1726,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1028,"mirror_url":null,"open_issues_count":263,"forks":1028,"open_issues":263,"watchers":1726,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/6701"},"html":{"href":"https://github.com/ceph/ceph/pull/6701"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/6701"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/6701/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/6701/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/6701/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/5f11f818627d45b78d77da5535d720efa2c64721"}}}}