)]}'
{"id":"openstack%2Fplacement~675416","triplet_id":"openstack%2Fplacement~master~Idb98611f549b628d273c43f07d137fcf9c73314c","project":"openstack/placement","branch":"master","topic":"optimize_consolidate_copy","hashtags":[],"change_id":"Idb98611f549b628d273c43f07d137fcf9c73314c","subject":"Copy AllocationRequestResource only when necessary","status":"MERGED","created":"2019-08-08 17:12:44.000000000","updated":"2019-08-10 01:08:26.000000000","submitted":"2019-08-10 01:08:26.000000000","submitter":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"total_comment_count":5,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"675416-1565399306408-067e4e06","meta_rev_id":"f7487e8bda6f8bfd42b3e6cd79c9f08ccb92d60e","_number":675416,"virtual_id_number":675416,"owner":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"all":[{"value":0,"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":0,"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":0,"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},{"value":2,"date":"2019-08-10 01:08:25.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Fails","-1":"Doesn\u0027t seem to work"," 0":"No score","+1":"Works for me","+2":"Verified"},"description":"","default_value":0,"optional":true},"Code-Review":{"approved":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"all":[{"value":0,"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":2,"date":"2019-08-09 13:41:12.000000000","_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":2,"date":"2019-08-09 13:51:48.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Do not merge","-1":"This patch needs further work before it can be merged"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me (core reviewer)"},"description":"","default_value":0,"optional":true},"Workflow":{"approved":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"all":[{"value":0,"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":0,"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":1,"date":"2019-08-09 13:51:48.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-1":"Work in progress"," 0":"Ready for reviews","+1":"Approved"},"description":"","default_value":0,"optional":true},"Review-Priority":{"all":[{"value":0,"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":0,"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":0,"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{" 0":"Default Priority","+1":"Contributor Review Promise","+2":"Core Review Promise"},"description":"","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2019-08-09 13:41:12.000000000","updated_by":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"reviewer":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"state":"REVIEWER"},{"updated":"2019-08-09 13:51:48.000000000","updated_by":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"reviewer":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"state":"REVIEWER"},{"updated":"2019-08-10 01:08:25.000000000","updated_by":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"reviewer":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"state":"REVIEWER"}],"messages":[{"id":"1675fc550ec089f9af409bc9d783369eda99a7b2","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-08-08 17:12:44.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"a972739c7e2fb5a9390fe022446811aa9d8701b9","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-08-08 17:24:25.000000000","message":"Uploaded patch set 2.","accounts_in_message":[],"_revision_number":2},{"id":"17d43b4888030068b3de2eeb2d2fc3ebfe1a90bb","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-08 17:47:24.000000000","message":"Patch Set 2: Code-Review+1\n\nProfiling indicates that this is a win and the tests pass, so that\u0027s great.\n\nI\u0027ll come back and give it a real review (to make sure it is sufficiently clear to other folk) tomorrow when I\u0027ve got a fresh head.","accounts_in_message":[],"_revision_number":2},{"id":"38f60265702db9dec84a1996d168174e8686462d","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-08 23:16:29.000000000","message":"Patch Set 2: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade-py3 https://logs.opendev.org/16/675416/2/check/grenade-py3/68cb86f/ : SUCCESS in 57m 40s\n- tempest-integrated-placement https://logs.opendev.org/16/675416/2/check/tempest-integrated-placement/f38645d/ : SUCCESS in 1h 19m 30s\n- openstack-tox-docs https://logs.opendev.org/16/675416/2/check/openstack-tox-docs/913cc60/html/ : SUCCESS in 5m 07s\n- openstack-tox-cover https://logs.opendev.org/16/675416/2/check/openstack-tox-cover/b8d1f6e/cover/ : SUCCESS in 12m 43s\n- openstack-tox-lower-constraints https://logs.opendev.org/16/675416/2/check/openstack-tox-lower-constraints/e23dbd1/ : SUCCESS in 5m 18s\n- openstack-tox-pep8 https://logs.opendev.org/16/675416/2/check/openstack-tox-pep8/59a3268/ : SUCCESS in 5m 25s\n- openstack-tox-py27 https://logs.opendev.org/16/675416/2/check/openstack-tox-py27/41ce55b/ : SUCCESS in 5m 58s\n- openstack-tox-py36 https://logs.opendev.org/16/675416/2/check/openstack-tox-py36/248afca/ : SUCCESS in 4m 11s\n- openstack-tox-py37 https://logs.opendev.org/16/675416/2/check/openstack-tox-py37/04140bb/ : SUCCESS in 6m 09s\n- openstack-tox-functional https://logs.opendev.org/16/675416/2/check/openstack-tox-functional/33a6a70/ : SUCCESS in 7m 39s\n- openstack-tox-functional-py36 https://logs.opendev.org/16/675416/2/check/openstack-tox-functional-py36/24dc173/ : SUCCESS in 4m 38s\n- openstack-tox-functional-py37 https://logs.opendev.org/16/675416/2/check/openstack-tox-functional-py37/1c18f03/ : SUCCESS in 6m 44s\n- placement-nova-tox-functional-py37 https://logs.opendev.org/16/675416/2/check/placement-nova-tox-functional-py37/e89920f/ : SUCCESS in 12m 49s\n- placement-nested-perfload https://logs.opendev.org/16/675416/2/check/placement-nested-perfload/d3ab9cc/ : SUCCESS in 23m 33s (non-voting)\n- placement-perfload https://logs.opendev.org/16/675416/2/check/placement-perfload/364c411/ : SUCCESS in 12m 47s (non-voting)\n- tempest-ipv6-only https://logs.opendev.org/16/675416/2/check/tempest-ipv6-only/9b41dc2/ : SUCCESS in 1h 13m 32s","accounts_in_message":[],"_revision_number":2},{"id":"127356122a54ba74e30d25caba4b5f8012b3fb12","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-09 10:52:25.000000000","message":"Patch Set 2: Code-Review-1\n\n(2 comments)\n\nI\u0027ll admit to some lack of coffee slowness, but I\u0027m pretty sure there\u0027s a bad docstring noted within.\n\ncode seems good, did some local messing about to make myself feel okay with it","accounts_in_message":[],"_revision_number":2},{"id":"624bac58c22460dc43e78a4937c333c980046f11","author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"date":"2019-08-09 13:33:05.000000000","message":"Patch Set 2:\n\n(1 comment)\n\nLGTM except the docstring already noted by Chris.","accounts_in_message":[],"_revision_number":2},{"id":"a992b5c6156fddef6116fdb03f862a1572bc32d4","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-08-09 13:39:03.000000000","message":"Patch Set 3: Published edit on patch set 2.","accounts_in_message":[],"_revision_number":3},{"id":"8221568d9bdfbe947d9ae909d01fc79e7092bc65","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-08-09 13:39:50.000000000","message":"Patch Set 2:\n\n(2 comments)","accounts_in_message":[],"_revision_number":2},{"id":"6d22d5958499fb20d6722ef8b33f700c786424d3","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-09 13:41:12.000000000","message":"Patch Set 3: Code-Review+2\n\nwoot","accounts_in_message":[],"_revision_number":3},{"id":"959a4bd439379c967517fb06e8ae0afc34fb4242","author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"date":"2019-08-09 13:51:48.000000000","message":"Patch Set 3: Code-Review+2 Workflow+1","accounts_in_message":[],"_revision_number":3},{"id":"40e48be157d1ef6f0bef8b876ffddcdf1b0ec8d9","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-09 18:28:46.000000000","message":"Patch Set 3: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade-py3 https://logs.opendev.org/16/675416/3/check/grenade-py3/eb1b9fa/ : SUCCESS in 1h 01m 48s\n- tempest-integrated-placement https://logs.opendev.org/16/675416/3/check/tempest-integrated-placement/b3c6a2f/ : SUCCESS in 1h 16m 24s\n- openstack-tox-docs https://logs.opendev.org/16/675416/3/check/openstack-tox-docs/3f1de8d/html/ : SUCCESS in 7m 13s\n- openstack-tox-cover https://logs.opendev.org/16/675416/3/check/openstack-tox-cover/1b0e62b/cover/ : SUCCESS in 7m 19s\n- openstack-tox-lower-constraints https://logs.opendev.org/16/675416/3/check/openstack-tox-lower-constraints/04eac51/ : SUCCESS in 5m 00s\n- openstack-tox-pep8 https://logs.opendev.org/16/675416/3/check/openstack-tox-pep8/43700f7/ : SUCCESS in 4m 28s\n- openstack-tox-py27 https://logs.opendev.org/16/675416/3/check/openstack-tox-py27/2df80bc/ : SUCCESS in 4m 20s\n- openstack-tox-py36 https://logs.opendev.org/16/675416/3/check/openstack-tox-py36/9f1876e/ : SUCCESS in 8m 14s\n- openstack-tox-py37 https://logs.opendev.org/16/675416/3/check/openstack-tox-py37/61ea5ec/ : SUCCESS in 6m 39s\n- openstack-tox-functional https://logs.opendev.org/16/675416/3/check/openstack-tox-functional/4f5395f/ : SUCCESS in 7m 04s\n- openstack-tox-functional-py36 https://logs.opendev.org/16/675416/3/check/openstack-tox-functional-py36/77291b6/ : SUCCESS in 5m 15s\n- openstack-tox-functional-py37 https://logs.opendev.org/16/675416/3/check/openstack-tox-functional-py37/f248169/ : SUCCESS in 7m 22s\n- placement-nova-tox-functional-py37 https://logs.opendev.org/16/675416/3/check/placement-nova-tox-functional-py37/0ff9738/ : SUCCESS in 10m 30s\n- placement-nested-perfload https://logs.opendev.org/16/675416/3/check/placement-nested-perfload/05aeb16/ : SUCCESS in 31m 10s (non-voting)\n- placement-perfload https://logs.opendev.org/16/675416/3/check/placement-perfload/f8ba9dc/ : SUCCESS in 12m 09s (non-voting)\n- tempest-ipv6-only https://logs.opendev.org/16/675416/3/check/tempest-ipv6-only/8521d63/ : SUCCESS in 1h 38m 25s","accounts_in_message":[],"_revision_number":3},{"id":"803f3c02392752bcd4fbeb0aa82d7127b4aae9fe","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-09 18:29:28.000000000","message":"Patch Set 3: -Verified\n\nStarting gate jobs.","accounts_in_message":[],"_revision_number":3},{"id":"b47825e9e03538fd9af365e2f2e396aad531a895","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-09 20:07:38.000000000","message":"Patch Set 3:\n\nStarting gate jobs.","accounts_in_message":[],"_revision_number":3},{"id":"e8ad75d8a0c678126c00bb355e89d365aa4a18cc","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-10 01:08:25.000000000","message":"Patch Set 3: Verified+2\n\nBuild succeeded (gate pipeline).\n\n- grenade-py3 https://logs.opendev.org/16/675416/3/gate/grenade-py3/61c82da/ : SUCCESS in 1h 02m 51s\n- tempest-integrated-placement https://logs.opendev.org/16/675416/3/gate/tempest-integrated-placement/cc52de0/ : SUCCESS in 1h 28m 50s\n- openstack-tox-docs https://logs.opendev.org/16/675416/3/gate/openstack-tox-docs/3b5d466/html/ : SUCCESS in 4m 28s\n- openstack-tox-lower-constraints https://logs.opendev.org/16/675416/3/gate/openstack-tox-lower-constraints/f5905fa/ : SUCCESS in 8m 00s\n- openstack-tox-pep8 https://logs.opendev.org/16/675416/3/gate/openstack-tox-pep8/ebea34c/ : SUCCESS in 4m 11s\n- openstack-tox-py27 https://logs.opendev.org/16/675416/3/gate/openstack-tox-py27/db1ea45/ : SUCCESS in 5m 45s\n- openstack-tox-py36 https://logs.opendev.org/16/675416/3/gate/openstack-tox-py36/2bd26d9/ : SUCCESS in 6m 18s\n- openstack-tox-py37 https://logs.opendev.org/16/675416/3/gate/openstack-tox-py37/414c68f/ : SUCCESS in 5m 42s\n- openstack-tox-functional https://logs.opendev.org/16/675416/3/gate/openstack-tox-functional/1dfc68b/ : SUCCESS in 5m 17s\n- openstack-tox-functional-py36 https://logs.opendev.org/16/675416/3/gate/openstack-tox-functional-py36/55a97c1/ : SUCCESS in 4m 55s\n- openstack-tox-functional-py37 https://logs.opendev.org/16/675416/3/gate/openstack-tox-functional-py37/84b9cc1/ : SUCCESS in 5m 19s\n- placement-nova-tox-functional-py37 https://logs.opendev.org/16/675416/3/gate/placement-nova-tox-functional-py37/1f42c2e/ : SUCCESS in 14m 02s\n- tempest-ipv6-only https://logs.opendev.org/16/675416/3/gate/tempest-ipv6-only/690903f/ : SUCCESS in 1h 03m 33s","accounts_in_message":[],"_revision_number":3},{"id":"20266bc10e94181c9b7f8d5df3252b9543062090","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-10 01:08:26.000000000","message":"Change has been successfully merged by Zuul","accounts_in_message":[],"_revision_number":3}],"current_revision_number":3,"current_revision":"e96237050a921bc466f7cf2fcc6263024db0444a","revisions":{"f3571f755b77850b378b2f834d7c6ffebdd4013a":{"kind":"REWORK","_number":1,"created":"2019-08-08 17:12:44.000000000","uploader":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"ref":"refs/changes/16/675416/1","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/16/675416/1","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/16/675416/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/16/675416/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/16/675416/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/16/675416/1"}}},"commit":{"parents":[{"commit":"0d3020cd64bbe976b5e641c1c53555700b36d3f8","subject":"Merge \"Add apache benchmark (ab) to end of perfload jobs\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/0d3020cd64bbe976b5e641c1c53555700b36d3f8"}]}],"author":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-08-08 17:05:07.000000000","tz":-300},"committer":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-08-08 17:05:07.000000000","tz":-300},"subject":"Copy AllocationRequestResource only when necessary","message":"Copy AllocationRequestResource only when necessary\n\nProfiling revealed that copying AllocationRequestResource in\n_consolidate_allocation_requests was expensive.\n\nAs an optimization, this patch adds logic to only do that copy when it\u0027s\nnecessary.\n\nAnd it\u0027s only necessary for an ARR whose resource class was requested\nfrom multiple groups, when group_policy\u003dnone. In that case, we\u0027re\nconstructing multiple results with the same ARR. For example, consider a\nhost with two PFs with VF inventory. A request like:\n\n ?resources1\u003dVF:1\n \u0026resources2\u003dVF:1\n \u0026group_policy\u003dnone\n\n...will yield results like:\n\n(1) PF1{VF:1},PF2{VF:1}\n(2) PF1{VF:2}\n(3) PF2{VF:2}\n\nThe AllocationRequestResource representing PF1{VF:1} gets used in both\nresult (1) and result (2). When producing result (2), we add the\nAllocationRequestResource.amountZ together. If we were reusing the same\nARR instance from result (1), result (1) would end up looking like:\n\n(1) PF1{VF:2},PF2{VF:1}\n\n...which is wrong. So we have to do the copy.\n\nWith group_policy\u003disolate, or if we\u0027ve only requested the resource class\nfrom one group, we\u0027re only using that ARR once in the results, so we can\njust use it without copying.\n\nChange-Id: Idb98611f549b628d273c43f07d137fcf9c73314c\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/f3571f755b77850b378b2f834d7c6ffebdd4013a"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/f3571f755b77850b378b2f834d7c6ffebdd4013a"}]},"branch":"refs/heads/master"},"7029006ea0b9ca5836562b9832c2e57594cfb0bd":{"kind":"REWORK","_number":2,"created":"2019-08-08 17:24:25.000000000","uploader":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"ref":"refs/changes/16/675416/2","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/16/675416/2","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/16/675416/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/16/675416/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/16/675416/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/16/675416/2"}}},"commit":{"parents":[{"commit":"0d3020cd64bbe976b5e641c1c53555700b36d3f8","subject":"Merge \"Add apache benchmark (ab) to end of perfload jobs\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/0d3020cd64bbe976b5e641c1c53555700b36d3f8"}]}],"author":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-08-08 17:05:07.000000000","tz":-300},"committer":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-08-08 17:24:22.000000000","tz":-300},"subject":"Copy AllocationRequestResource only when necessary","message":"Copy AllocationRequestResource only when necessary\n\nProfiling revealed that copying AllocationRequestResource in\n_consolidate_allocation_requests was expensive.\n\nAs an optimization, this patch adds logic to only do that copy when it\u0027s\nnecessary.\n\nAnd it\u0027s only necessary for an ARR whose resource class was requested\nfrom multiple groups, when group_policy\u003dnone. In that case, we\u0027re\nconstructing multiple results with the same ARR. For example, consider a\nhost with two PFs with VF inventory. A request like:\n\n ?resources1\u003dVF:1\n \u0026resources2\u003dVF:1\n \u0026group_policy\u003dnone\n\n...will yield results like:\n\n(1) PF1{VF:1},PF2{VF:1}\n(2) PF1{VF:2}\n(3) PF2{VF:2}\n\nThe AllocationRequestResource representing PF1{VF:1} gets used in both\nresult (1) and result (2). When producing result (2), we add the\nAllocationRequestResource.amountZ together. If we were reusing the same\nARR instance from result (1), result (1) would end up looking like:\n\n(1) PF1{VF:2},PF2{VF:1}\n\n...which is wrong. So we have to do the copy.\n\nWith group_policy\u003disolate, or if we\u0027ve only requested the resource class\nfrom one group, we\u0027re only using that ARR once in the results, so we can\njust use it without copying.\n\nChange-Id: Idb98611f549b628d273c43f07d137fcf9c73314c\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/7029006ea0b9ca5836562b9832c2e57594cfb0bd"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/7029006ea0b9ca5836562b9832c2e57594cfb0bd"}]},"branch":"refs/heads/master"},"e96237050a921bc466f7cf2fcc6263024db0444a":{"kind":"REWORK","_number":3,"created":"2019-08-09 13:39:03.000000000","uploader":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"ref":"refs/changes/16/675416/3","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/16/675416/3","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/16/675416/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/16/675416/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/16/675416/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/16/675416/3"}}},"commit":{"parents":[{"commit":"0d3020cd64bbe976b5e641c1c53555700b36d3f8","subject":"Merge \"Add apache benchmark (ab) to end of perfload jobs\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/0d3020cd64bbe976b5e641c1c53555700b36d3f8"}]}],"author":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-08-08 17:05:07.000000000","tz":-300},"committer":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-08-09 13:38:47.000000000","tz":0},"subject":"Copy AllocationRequestResource only when necessary","message":"Copy AllocationRequestResource only when necessary\n\nProfiling revealed that copying AllocationRequestResource in\n_consolidate_allocation_requests was expensive.\n\nAs an optimization, this patch adds logic to only do that copy when it\u0027s\nnecessary.\n\nAnd it\u0027s only necessary for an ARR whose resource class was requested\nfrom multiple groups, when group_policy\u003dnone. In that case, we\u0027re\nconstructing multiple results with the same ARR. For example, consider a\nhost with two PFs with VF inventory. A request like:\n\n ?resources1\u003dVF:1\n \u0026resources2\u003dVF:1\n \u0026group_policy\u003dnone\n\n...will yield results like:\n\n(1) PF1{VF:1},PF2{VF:1}\n(2) PF1{VF:2}\n(3) PF2{VF:2}\n\nThe AllocationRequestResource representing PF1{VF:1} gets used in both\nresult (1) and result (2). When producing result (2), we add the\nAllocationRequestResource.amountZ together. If we were reusing the same\nARR instance from result (1), result (1) would end up looking like:\n\n(1) PF1{VF:2},PF2{VF:1}\n\n...which is wrong. So we have to do the copy.\n\nWith group_policy\u003disolate, or if we\u0027ve only requested the resource class\nfrom one group, we\u0027re only using that ARR once in the results, so we can\njust use it without copying.\n\nChange-Id: Idb98611f549b628d273c43f07d137fcf9c73314c\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/e96237050a921bc466f7cf2fcc6263024db0444a"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/e96237050a921bc466f7cf2fcc6263024db0444a"}]},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[],"submit_requirements":[]}
