{"action":"created","comment":{"url":"https://api.github.com/repos/google/ktsan/pulls/comments/38119416","id":38119416,"diff_hunk":"@@ -329,7 +348,15 @@ void ktsan_memblock_free(void *addr, unsigned long size)\n void ktsan_mtx_pre_lock(void *addr, bool write, bool try)\n {\n \tENTER(false, true);\n-\tkt_mtx_pre_lock(thr, pc, (uptr_t)addr, write, try);\n+\n+\tif (kt_thr_event_disable(thr, pc)) {\n+\t\tthr->irq_flags_before_mtx = kt_flags;\n+\t\t/* Set all disabled in kt_flags. */\n+\t\tkt_flags = arch_local_irq_save();","path":"mm/ktsan/ktsan.c","position":101,"original_position":101,"commit_id":"58f815aceeb36e7ec856dd970addc73b831e6f71","original_commit_id":"58f815aceeb36e7ec856dd970addc73b831e6f71","user":{"login":"dvyukov","id":1095328,"avatar_url":"https://avatars.githubusercontent.com/u/1095328?v=3","gravatar_id":"","url":"https://api.github.com/users/dvyukov","html_url":"https://github.com/dvyukov","followers_url":"https://api.github.com/users/dvyukov/followers","following_url":"https://api.github.com/users/dvyukov/following{/other_user}","gists_url":"https://api.github.com/users/dvyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/dvyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvyukov/subscriptions","organizations_url":"https://api.github.com/users/dvyukov/orgs","repos_url":"https://api.github.com/users/dvyukov/repos","events_url":"https://api.github.com/users/dvyukov/events{/privacy}","received_events_url":"https://api.github.com/users/dvyukov/received_events","type":"User","site_admin":false},"body":"PLease add a comment as to why we disable interrupts here.","created_at":"2015-08-27T17:02:14Z","updated_at":"2015-08-27T17:02:14Z","html_url":"https://github.com/google/ktsan/pull/25#discussion_r38119416","pull_request_url":"https://api.github.com/repos/google/ktsan/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/google/ktsan/pulls/comments/38119416"},"html":{"href":"https://github.com/google/ktsan/pull/25#discussion_r38119416"},"pull_request":{"href":"https://api.github.com/repos/google/ktsan/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/google/ktsan/pulls/25","id":43534238,"html_url":"https://github.com/google/ktsan/pull/25","diff_url":"https://github.com/google/ktsan/pull/25.diff","patch_url":"https://github.com/google/ktsan/pull/25.patch","issue_url":"https://api.github.com/repos/google/ktsan/issues/25","number":25,"state":"open","locked":false,"title":"Disable interrupts when inside mtx_lock or mtx_unlock","user":{"login":"xairy","id":4965052,"avatar_url":"https://avatars.githubusercontent.com/u/4965052?v=3","gravatar_id":"","url":"https://api.github.com/users/xairy","html_url":"https://github.com/xairy","followers_url":"https://api.github.com/users/xairy/followers","following_url":"https://api.github.com/users/xairy/following{/other_user}","gists_url":"https://api.github.com/users/xairy/gists{/gist_id}","starred_url":"https://api.github.com/users/xairy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xairy/subscriptions","organizations_url":"https://api.github.com/users/xairy/orgs","repos_url":"https://api.github.com/users/xairy/repos","events_url":"https://api.github.com/users/xairy/events{/privacy}","received_events_url":"https://api.github.com/users/xairy/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-27T15:54:42Z","updated_at":"2015-08-27T17:02:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e921a8205307279d0bb2a54416a334673231779b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/ktsan/pulls/25/commits","review_comments_url":"https://api.github.com/repos/google/ktsan/pulls/25/comments","review_comment_url":"https://api.github.com/repos/google/ktsan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/ktsan/issues/25/comments","statuses_url":"https://api.github.com/repos/google/ktsan/statuses/58f815aceeb36e7ec856dd970addc73b831e6f71","head":{"label":"google:tsan-dev","ref":"tsan-dev","sha":"58f815aceeb36e7ec856dd970addc73b831e6f71","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":22620547,"name":"ktsan","full_name":"google/ktsan","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/ktsan","description":"ThreadSanitizer for Linux kernel, a fast data race detector","fork":false,"url":"https://api.github.com/repos/google/ktsan","forks_url":"https://api.github.com/repos/google/ktsan/forks","keys_url":"https://api.github.com/repos/google/ktsan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/ktsan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/ktsan/teams","hooks_url":"https://api.github.com/repos/google/ktsan/hooks","issue_events_url":"https://api.github.com/repos/google/ktsan/issues/events{/number}","events_url":"https://api.github.com/repos/google/ktsan/events","assignees_url":"https://api.github.com/repos/google/ktsan/assignees{/user}","branches_url":"https://api.github.com/repos/google/ktsan/branches{/branch}","tags_url":"https://api.github.com/repos/google/ktsan/tags","blobs_url":"https://api.github.com/repos/google/ktsan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/ktsan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/ktsan/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/ktsan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/ktsan/statuses/{sha}","languages_url":"https://api.github.com/repos/google/ktsan/languages","stargazers_url":"https://api.github.com/repos/google/ktsan/stargazers","contributors_url":"https://api.github.com/repos/google/ktsan/contributors","subscribers_url":"https://api.github.com/repos/google/ktsan/subscribers","subscription_url":"https://api.github.com/repos/google/ktsan/subscription","commits_url":"https://api.github.com/repos/google/ktsan/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/ktsan/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/ktsan/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/ktsan/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/ktsan/contents/{+path}","compare_url":"https://api.github.com/repos/google/ktsan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/ktsan/merges","archive_url":"https://api.github.com/repos/google/ktsan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/ktsan/downloads","issues_url":"https://api.github.com/repos/google/ktsan/issues{/number}","pulls_url":"https://api.github.com/repos/google/ktsan/pulls{/number}","milestones_url":"https://api.github.com/repos/google/ktsan/milestones{/number}","notifications_url":"https://api.github.com/repos/google/ktsan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/ktsan/labels{/name}","releases_url":"https://api.github.com/repos/google/ktsan/releases{/id}","created_at":"2014-08-04T21:26:17Z","updated_at":"2015-08-21T06:26:10Z","pushed_at":"2015-08-27T15:54:43Z","git_url":"git://github.com/google/ktsan.git","ssh_url":"git@github.com:google/ktsan.git","clone_url":"https://github.com/google/ktsan.git","svn_url":"https://github.com/google/ktsan","homepage":"thread-sanitizer.googlecode.com","size":1221627,"stargazers_count":32,"watchers_count":32,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":1,"forks":10,"open_issues":1,"watchers":32,"default_branch":"tsan"}},"base":{"label":"google:tsan","ref":"tsan","sha":"b99fc6251da12f57b17508cf2e41212e26d7d4cc","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":22620547,"name":"ktsan","full_name":"google/ktsan","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/ktsan","description":"ThreadSanitizer for Linux kernel, a fast data race detector","fork":false,"url":"https://api.github.com/repos/google/ktsan","forks_url":"https://api.github.com/repos/google/ktsan/forks","keys_url":"https://api.github.com/repos/google/ktsan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/ktsan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/ktsan/teams","hooks_url":"https://api.github.com/repos/google/ktsan/hooks","issue_events_url":"https://api.github.com/repos/google/ktsan/issues/events{/number}","events_url":"https://api.github.com/repos/google/ktsan/events","assignees_url":"https://api.github.com/repos/google/ktsan/assignees{/user}","branches_url":"https://api.github.com/repos/google/ktsan/branches{/branch}","tags_url":"https://api.github.com/repos/google/ktsan/tags","blobs_url":"https://api.github.com/repos/google/ktsan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/ktsan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/ktsan/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/ktsan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/ktsan/statuses/{sha}","languages_url":"https://api.github.com/repos/google/ktsan/languages","stargazers_url":"https://api.github.com/repos/google/ktsan/stargazers","contributors_url":"https://api.github.com/repos/google/ktsan/contributors","subscribers_url":"https://api.github.com/repos/google/ktsan/subscribers","subscription_url":"https://api.github.com/repos/google/ktsan/subscription","commits_url":"https://api.github.com/repos/google/ktsan/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/ktsan/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/ktsan/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/ktsan/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/ktsan/contents/{+path}","compare_url":"https://api.github.com/repos/google/ktsan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/ktsan/merges","archive_url":"https://api.github.com/repos/google/ktsan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/ktsan/downloads","issues_url":"https://api.github.com/repos/google/ktsan/issues{/number}","pulls_url":"https://api.github.com/repos/google/ktsan/pulls{/number}","milestones_url":"https://api.github.com/repos/google/ktsan/milestones{/number}","notifications_url":"https://api.github.com/repos/google/ktsan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/ktsan/labels{/name}","releases_url":"https://api.github.com/repos/google/ktsan/releases{/id}","created_at":"2014-08-04T21:26:17Z","updated_at":"2015-08-21T06:26:10Z","pushed_at":"2015-08-27T15:54:43Z","git_url":"git://github.com/google/ktsan.git","ssh_url":"git@github.com:google/ktsan.git","clone_url":"https://github.com/google/ktsan.git","svn_url":"https://github.com/google/ktsan","homepage":"thread-sanitizer.googlecode.com","size":1221627,"stargazers_count":32,"watchers_count":32,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":1,"forks":10,"open_issues":1,"watchers":32,"default_branch":"tsan"}},"_links":{"self":{"href":"https://api.github.com/repos/google/ktsan/pulls/25"},"html":{"href":"https://github.com/google/ktsan/pull/25"},"issue":{"href":"https://api.github.com/repos/google/ktsan/issues/25"},"comments":{"href":"https://api.github.com/repos/google/ktsan/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/google/ktsan/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/google/ktsan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/ktsan/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/google/ktsan/statuses/58f815aceeb36e7ec856dd970addc73b831e6f71"}}}}