{"action":"created","comment":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/195545691","pull_request_review_id":128936849,"id":195545691,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTU0NTY5MQ==","diff_hunk":"@@ -770,23 +770,27 @@ int rxm_ep_prepost_buf(struct rxm_ep *rxm_ep, struct fid_ep *msg_ep,\n \t\t       struct dlist_entry *posted_rx_list)\n {\n \tstruct rxm_rx_buf *rx_buf;\n+\tstruct rxm_conn *rxm_conn = NULL;\n \tint ret;\n \tsize_t i;\n \n \tfor (i = 0; i < rxm_ep->msg_info->rx_attr->size; i++) {\n-\t\trx_buf = rxm_rx_buf_get(rxm_ep);\n+\t\tif (!rxm_ep->srx_ctx) {\n+\t\t\trxm_conn = container_of(msg_ep->fid.context,\n+\t\t\t\t\t\tstruct rxm_conn, handle);\n+\t\t\trx_buf = rxm_rx_buf_get(&rxm_conn->rx_buf_pool);\n+\t\t} else {\n+\t\t\trx_buf = rxm_rx_buf_get(&rxm_ep->buf_pools[RXM_BUF_POOL_RX]);\n+\t\t}\n \t\tif (OFI_UNLIKELY(!rx_buf))\n \t\t\treturn -FI_ENOMEM;\n \n+\t\trx_buf->conn = rxm_conn;","path":"prov/rxm/src/rxm_cq.c","position":20,"original_position":20,"commit_id":"ca22aa75cf998a42e329afde9f4aecbd8c77c6fd","original_commit_id":"c0443c8510e22d029e4d720c5072a1c6f5630c1b","user":{"login":"shefty","id":3967608,"node_id":"MDQ6VXNlcjM5Njc2MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/3967608?v=4","gravatar_id":"","url":"https://api.github.com/users/shefty","html_url":"https://github.com/shefty","followers_url":"https://api.github.com/users/shefty/followers","following_url":"https://api.github.com/users/shefty/following{/other_user}","gists_url":"https://api.github.com/users/shefty/gists{/gist_id}","starred_url":"https://api.github.com/users/shefty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shefty/subscriptions","organizations_url":"https://api.github.com/users/shefty/orgs","repos_url":"https://api.github.com/users/shefty/repos","events_url":"https://api.github.com/users/shefty/events{/privacy}","received_events_url":"https://api.github.com/users/shefty/received_events","type":"User","site_admin":false},"body":"Can this be set during initialization now?  Is it needed anymore?","created_at":"2018-06-14T19:35:10Z","updated_at":"2018-06-14T19:47:15Z","html_url":"https://github.com/ofiwg/libfabric/pull/4187#discussion_r195545691","pull_request_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/4187","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/195545691"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/4187#discussion_r195545691"},"pull_request":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/4187"}}},"pull_request":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/4187","id":194567991,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NTY3OTkx","html_url":"https://github.com/ofiwg/libfabric/pull/4187","diff_url":"https://github.com/ofiwg/libfabric/pull/4187.diff","patch_url":"https://github.com/ofiwg/libfabric/pull/4187.patch","issue_url":"https://api.github.com/repos/ofiwg/libfabric/issues/4187","number":4187,"state":"open","locked":false,"title":"prov/rxm: Fix simultaneous access to shared resources from CM and main thread","user":{"login":"gladkovdmitry17","id":11650339,"node_id":"MDQ6VXNlcjExNjUwMzM5","avatar_url":"https://avatars1.githubusercontent.com/u/11650339?v=4","gravatar_id":"","url":"https://api.github.com/users/gladkovdmitry17","html_url":"https://github.com/gladkovdmitry17","followers_url":"https://api.github.com/users/gladkovdmitry17/followers","following_url":"https://api.github.com/users/gladkovdmitry17/following{/other_user}","gists_url":"https://api.github.com/users/gladkovdmitry17/gists{/gist_id}","starred_url":"https://api.github.com/users/gladkovdmitry17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gladkovdmitry17/subscriptions","organizations_url":"https://api.github.com/users/gladkovdmitry17/orgs","repos_url":"https://api.github.com/users/gladkovdmitry17/repos","events_url":"https://api.github.com/users/gladkovdmitry17/events{/privacy}","received_events_url":"https://api.github.com/users/gladkovdmitry17/received_events","type":"User","site_admin":false},"body":"The PR fix simultaneous access to shared resources from different threads by implementing the following solutions:\r\n- **prov/rxm: Allocate RX buffer pool per connection**\r\nThe RX buffer pool is used by all connections. Currently an allocation of buffers from the RX buffer pool is done from main and CM thread, but an access to the RX buffer pool isn't serialized in case of FI_THREAD_SAFE isn't set by app. This leads to unexpected behavior of programs, if there is simultaneous access to the RX buffer pool from CM and main thread.\r\nThe commit fixes this problem by maintaining separate RX buffers per connection.\r\nAlso this solution fixes problem for unlimited growing numbers of RX buffers on a master process for spawning-destroing workers (slaves).\r\n- **prov/rxm: Don't release shared TX resources in CM thread**\r\nIf data is transmitted by fi_inject or transmission via fi_send is failed when processing deferred queue in CM thread, the TX entry and TX buffer are released.\r\nThe TX buffer and TX entry aren't protected by any synchronization primitive in case of FI_THREAD_SAFE isn't set. So, they must not be accessed from different threads.\r\nThe solution is to defer releasing of TX entry and TX buffer for the moment when connection is established and a main thread is notified about that.\r\n","created_at":"2018-06-13T12:23:23Z","updated_at":"2018-06-14T19:47:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb0b556e760084d86b72172278196cc57e389511","assignee":null,"assignees":[],"requested_reviewers":[{"login":"a-ilango","id":8547674,"node_id":"MDQ6VXNlcjg1NDc2NzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8547674?v=4","gravatar_id":"","url":"https://api.github.com/users/a-ilango","html_url":"https://github.com/a-ilango","followers_url":"https://api.github.com/users/a-ilango/followers","following_url":"https://api.github.com/users/a-ilango/following{/other_user}","gists_url":"https://api.github.com/users/a-ilango/gists{/gist_id}","starred_url":"https://api.github.com/users/a-ilango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-ilango/subscriptions","organizations_url":"https://api.github.com/users/a-ilango/orgs","repos_url":"https://api.github.com/users/a-ilango/repos","events_url":"https://api.github.com/users/a-ilango/events{/privacy}","received_events_url":"https://api.github.com/users/a-ilango/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/4187/commits","review_comments_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/4187/comments","review_comment_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/issues/4187/comments","statuses_url":"https://api.github.com/repos/ofiwg/libfabric/statuses/ca22aa75cf998a42e329afde9f4aecbd8c77c6fd","head":{"label":"gladkovdmitry17:rxm_conn","ref":"rxm_conn","sha":"ca22aa75cf998a42e329afde9f4aecbd8c77c6fd","user":{"login":"gladkovdmitry17","id":11650339,"node_id":"MDQ6VXNlcjExNjUwMzM5","avatar_url":"https://avatars1.githubusercontent.com/u/11650339?v=4","gravatar_id":"","url":"https://api.github.com/users/gladkovdmitry17","html_url":"https://github.com/gladkovdmitry17","followers_url":"https://api.github.com/users/gladkovdmitry17/followers","following_url":"https://api.github.com/users/gladkovdmitry17/following{/other_user}","gists_url":"https://api.github.com/users/gladkovdmitry17/gists{/gist_id}","starred_url":"https://api.github.com/users/gladkovdmitry17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gladkovdmitry17/subscriptions","organizations_url":"https://api.github.com/users/gladkovdmitry17/orgs","repos_url":"https://api.github.com/users/gladkovdmitry17/repos","events_url":"https://api.github.com/users/gladkovdmitry17/events{/privacy}","received_events_url":"https://api.github.com/users/gladkovdmitry17/received_events","type":"User","site_admin":false},"repo":{"id":80634217,"node_id":"MDEwOlJlcG9zaXRvcnk4MDYzNDIxNw==","name":"libfabric","full_name":"gladkovdmitry17/libfabric","owner":{"login":"gladkovdmitry17","id":11650339,"node_id":"MDQ6VXNlcjExNjUwMzM5","avatar_url":"https://avatars1.githubusercontent.com/u/11650339?v=4","gravatar_id":"","url":"https://api.github.com/users/gladkovdmitry17","html_url":"https://github.com/gladkovdmitry17","followers_url":"https://api.github.com/users/gladkovdmitry17/followers","following_url":"https://api.github.com/users/gladkovdmitry17/following{/other_user}","gists_url":"https://api.github.com/users/gladkovdmitry17/gists{/gist_id}","starred_url":"https://api.github.com/users/gladkovdmitry17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gladkovdmitry17/subscriptions","organizations_url":"https://api.github.com/users/gladkovdmitry17/orgs","repos_url":"https://api.github.com/users/gladkovdmitry17/repos","events_url":"https://api.github.com/users/gladkovdmitry17/events{/privacy}","received_events_url":"https://api.github.com/users/gladkovdmitry17/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gladkovdmitry17/libfabric","description":"Open Fabric Interfaces","fork":true,"url":"https://api.github.com/repos/gladkovdmitry17/libfabric","forks_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/forks","keys_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/teams","hooks_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/hooks","issue_events_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/issues/events{/number}","events_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/events","assignees_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/assignees{/user}","branches_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/branches{/branch}","tags_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/tags","blobs_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/statuses/{sha}","languages_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/languages","stargazers_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/stargazers","contributors_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/contributors","subscribers_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/subscribers","subscription_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/subscription","commits_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/contents/{+path}","compare_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/merges","archive_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/downloads","issues_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/issues{/number}","pulls_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/pulls{/number}","milestones_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/milestones{/number}","notifications_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/labels{/name}","releases_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/releases{/id}","deployments_url":"https://api.github.com/repos/gladkovdmitry17/libfabric/deployments","created_at":"2017-02-01T15:37:30Z","updated_at":"2018-06-14T11:46:14Z","pushed_at":"2018-06-14T13:28:21Z","git_url":"git://github.com/gladkovdmitry17/libfabric.git","ssh_url":"git@github.com:gladkovdmitry17/libfabric.git","clone_url":"https://github.com/gladkovdmitry17/libfabric.git","svn_url":"https://github.com/gladkovdmitry17/libfabric","homepage":"http://ofiwg.github.io/libfabric/","size":18509,"stargazers_count":0,"watchers_count":0,"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":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ofiwg:master","ref":"master","sha":"3c4d05cc5bd00b5340fa6476a97c2cbdabaf7725","user":{"login":"ofiwg","id":8459445,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0NTk0NDU=","avatar_url":"https://avatars1.githubusercontent.com/u/8459445?v=4","gravatar_id":"","url":"https://api.github.com/users/ofiwg","html_url":"https://github.com/ofiwg","followers_url":"https://api.github.com/users/ofiwg/followers","following_url":"https://api.github.com/users/ofiwg/following{/other_user}","gists_url":"https://api.github.com/users/ofiwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ofiwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofiwg/subscriptions","organizations_url":"https://api.github.com/users/ofiwg/orgs","repos_url":"https://api.github.com/users/ofiwg/repos","events_url":"https://api.github.com/users/ofiwg/events{/privacy}","received_events_url":"https://api.github.com/users/ofiwg/received_events","type":"Organization","site_admin":false},"repo":{"id":22996097,"node_id":"MDEwOlJlcG9zaXRvcnkyMjk5NjA5Nw==","name":"libfabric","full_name":"ofiwg/libfabric","owner":{"login":"ofiwg","id":8459445,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0NTk0NDU=","avatar_url":"https://avatars1.githubusercontent.com/u/8459445?v=4","gravatar_id":"","url":"https://api.github.com/users/ofiwg","html_url":"https://github.com/ofiwg","followers_url":"https://api.github.com/users/ofiwg/followers","following_url":"https://api.github.com/users/ofiwg/following{/other_user}","gists_url":"https://api.github.com/users/ofiwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ofiwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofiwg/subscriptions","organizations_url":"https://api.github.com/users/ofiwg/orgs","repos_url":"https://api.github.com/users/ofiwg/repos","events_url":"https://api.github.com/users/ofiwg/events{/privacy}","received_events_url":"https://api.github.com/users/ofiwg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ofiwg/libfabric","description":"Open Fabric Interfaces","fork":false,"url":"https://api.github.com/repos/ofiwg/libfabric","forks_url":"https://api.github.com/repos/ofiwg/libfabric/forks","keys_url":"https://api.github.com/repos/ofiwg/libfabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ofiwg/libfabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ofiwg/libfabric/teams","hooks_url":"https://api.github.com/repos/ofiwg/libfabric/hooks","issue_events_url":"https://api.github.com/repos/ofiwg/libfabric/issues/events{/number}","events_url":"https://api.github.com/repos/ofiwg/libfabric/events","assignees_url":"https://api.github.com/repos/ofiwg/libfabric/assignees{/user}","branches_url":"https://api.github.com/repos/ofiwg/libfabric/branches{/branch}","tags_url":"https://api.github.com/repos/ofiwg/libfabric/tags","blobs_url":"https://api.github.com/repos/ofiwg/libfabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ofiwg/libfabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ofiwg/libfabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/ofiwg/libfabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ofiwg/libfabric/statuses/{sha}","languages_url":"https://api.github.com/repos/ofiwg/libfabric/languages","stargazers_url":"https://api.github.com/repos/ofiwg/libfabric/stargazers","contributors_url":"https://api.github.com/repos/ofiwg/libfabric/contributors","subscribers_url":"https://api.github.com/repos/ofiwg/libfabric/subscribers","subscription_url":"https://api.github.com/repos/ofiwg/libfabric/subscription","commits_url":"https://api.github.com/repos/ofiwg/libfabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/ofiwg/libfabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/ofiwg/libfabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/ofiwg/libfabric/contents/{+path}","compare_url":"https://api.github.com/repos/ofiwg/libfabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ofiwg/libfabric/merges","archive_url":"https://api.github.com/repos/ofiwg/libfabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ofiwg/libfabric/downloads","issues_url":"https://api.github.com/repos/ofiwg/libfabric/issues{/number}","pulls_url":"https://api.github.com/repos/ofiwg/libfabric/pulls{/number}","milestones_url":"https://api.github.com/repos/ofiwg/libfabric/milestones{/number}","notifications_url":"https://api.github.com/repos/ofiwg/libfabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ofiwg/libfabric/labels{/name}","releases_url":"https://api.github.com/repos/ofiwg/libfabric/releases{/id}","deployments_url":"https://api.github.com/repos/ofiwg/libfabric/deployments","created_at":"2014-08-15T16:45:53Z","updated_at":"2018-06-14T17:23:44Z","pushed_at":"2018-06-14T17:23:41Z","git_url":"git://github.com/ofiwg/libfabric.git","ssh_url":"git@github.com:ofiwg/libfabric.git","clone_url":"https://github.com/ofiwg/libfabric.git","svn_url":"https://github.com/ofiwg/libfabric","homepage":"http://libfabric.org/","size":18532,"stargazers_count":149,"watchers_count":149,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":139,"mirror_url":null,"archived":false,"open_issues_count":118,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":139,"open_issues":118,"watchers":149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/4187"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/4187"},"issue":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/4187"},"comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/4187/comments"},"review_comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/4187/comments"},"review_comment":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/4187/commits"},"statuses":{"href":"https://api.github.com/repos/ofiwg/libfabric/statuses/ca22aa75cf998a42e329afde9f4aecbd8c77c6fd"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"shefty"}}