{"action":"created","issue":{"url":"https://api.github.com/repos/netty/netty/issues/3834","labels_url":"https://api.github.com/repos/netty/netty/issues/3834/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/3834/comments","events_url":"https://api.github.com/repos/netty/netty/issues/3834/events","html_url":"https://github.com/netty/netty/pull/3834","id":81282341,"number":3834,"title":"[#3654] Synchronize on PoolSubpage head when allocate / free PoolSubp…","user":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/netty/netty/labels/improvement","name":"improvement","color":"0052cc"}],"state":"closed","locked":false,"assignee":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/netty/netty/milestones/116","html_url":"https://github.com/netty/netty/milestones/4.0.29.Final","labels_url":"https://api.github.com/repos/netty/netty/milestones/116/labels","id":1091077,"number":116,"title":"4.0.29.Final","description":"","creator":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"open_issues":65,"closed_issues":30,"state":"open","created_at":"2015-04-30T13:26:30Z","updated_at":"2015-05-27T14:57:19Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-05-27T05:17:59Z","updated_at":"2015-05-27T14:59:21Z","closed_at":"2015-05-27T08:34:14Z","pull_request":{"url":"https://api.github.com/repos/netty/netty/pulls/3834","html_url":"https://github.com/netty/netty/pull/3834","diff_url":"https://github.com/netty/netty/pull/3834.diff","patch_url":"https://github.com/netty/netty/pull/3834.patch"},"body":"…ages\r\n\r\nMotivation:\r\n\r\nCurrently we hold a lock on the PoolArena when we allocate / free PoolSubpages, which is wasteful as this also affects \"normal\" allocations. The same is true vice-verse.\r\n\r\nModifications:\r\n\r\nEnsure we synchronize on the head of the PoolSubPages pool. This is done per size and so it is possible to concurrently allocate / deallocate PoolSubPages with different sizes, and also normal allocations.\r\n\r\nResult:\r\n\r\nLess condition and so faster allocation/deallocation.\r\n\r\nBefore this commit:\r\nxxx:~/wrk $ ./wrk -H 'Connection: keep-alive' -d 120 -c 256 -t 16 -s scripts/pipeline-many.lua  http://xxx:8080/plaintext\r\nRunning 2m test @ http://xxx:8080/plaintext\r\n  16 threads and 256 connections\r\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\r\n    Latency    17.61ms   29.52ms 689.73ms   97.27%\r\n    Req/Sec   278.93k    41.97k  351.04k    84.83%\r\n  530527460 requests in 2.00m, 71.64GB read\r\nRequests/sec: 4422226.13\r\nTransfer/sec:    611.52MB\r\n\r\nAfter this commit:\r\nxxx:~/wrk $ ./wrk -H 'Connection: keep-alive' -d 120 -c 256 -t 16 -s scripts/pipeline-many.lua  http://xxx:8080/plaintext\r\nRunning 2m test @ http://xxx:8080/plaintext\r\n  16 threads and 256 connections\r\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\r\n    Latency    15.85ms   24.50ms 681.61ms   97.42%\r\n    Req/Sec   287.14k    38.39k  360.33k    85.88%\r\n  547902773 requests in 2.00m, 73.99GB read\r\nRequests/sec: 4567066.11\r\nTransfer/sec:    631.55MB\r\n\r\nThis is reproducable every time."},"comment":{"url":"https://api.github.com/repos/netty/netty/issues/comments/105945063","html_url":"https://github.com/netty/netty/pull/3834#issuecomment-105945063","issue_url":"https://api.github.com/repos/netty/netty/issues/3834","id":105945063,"user":{"login":"nmittler","id":6493296,"avatar_url":"https://avatars.githubusercontent.com/u/6493296?v=3","gravatar_id":"","url":"https://api.github.com/users/nmittler","html_url":"https://github.com/nmittler","followers_url":"https://api.github.com/users/nmittler/followers","following_url":"https://api.github.com/users/nmittler/following{/other_user}","gists_url":"https://api.github.com/users/nmittler/gists{/gist_id}","starred_url":"https://api.github.com/users/nmittler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmittler/subscriptions","organizations_url":"https://api.github.com/users/nmittler/orgs","repos_url":"https://api.github.com/users/nmittler/repos","events_url":"https://api.github.com/users/nmittler/events{/privacy}","received_events_url":"https://api.github.com/users/nmittler/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T14:59:21Z","updated_at":"2015-05-27T14:59:21Z","body":"Sweetness! :)"}}