)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7413130a60bf0b7cd57b1d080be32642f8a8fe98","unresolved":false,"context_lines":[{"line_number":10,"context_line":"ensure pinned instances do not overcommit was not pagesize aware. This"},{"line_number":11,"context_line":"means if an instance without hugepages boots on a host with a large"},{"line_number":12,"context_line":"number of hugepages allocated, it may not get all of the memory"},{"line_number":13,"context_line":"allocated to it. Put in concrete terms, consider a host with 1 NUMA"},{"line_number":14,"context_line":"cell, 2 CPUs, 1G of 4k pages, and a single 1G page. If you boot a first"},{"line_number":15,"context_line":"instance with 1 CPU, CPU pinning, 1G of RAM, and no specific page size,"},{"line_number":16,"context_line":"the instance should boot successfully. An attempt to boot a second"},{"line_number":17,"context_line":"instance with the same configuration should fail because there is only"},{"line_number":18,"context_line":"the single 1G page available, however, this is not currently the case."},{"line_number":19,"context_line":"The reason this happens is because we currently have two tests: a first"},{"line_number":20,"context_line":"that checks total (not free!) host pages and a second that checks free"},{"line_number":21,"context_line":"memory but with no consideration for page size. The first check passes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9f560f44_449a9412","line":18,"range":{"start_line":13,"start_character":17,"end_line":18,"end_character":28},"updated":"2020-10-12 10:37:51.000000000","message":"So the first boot selects the 4k pages over the 1G page. It can as the user did not specified the page size, so nova can choose. I guess if the user did not specify the page size then the second boot is free to select the 1 piece of 1G page as well.\n\nI feel that I\u0027m missing something. \n\nWhat is the defined meaning of not having a page size specified:\n* nova free to chose whatever page size available\n* nova defaults to 4k pages if pagesize is not defined by the user\n\nDoes the fact that we have pinned CPUs in the instance changes the above definition?","commit_id":"2427326c5683ab4cfc4697e9c6d7f2cb080014df"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ff05427ced217fc8bafa32cb04dec0e30bff121b","unresolved":false,"context_lines":[{"line_number":10,"context_line":"ensure pinned instances do not overcommit was not pagesize aware. This"},{"line_number":11,"context_line":"means if an instance without hugepages boots on a host with a large"},{"line_number":12,"context_line":"number of hugepages allocated, it may not get all of the memory"},{"line_number":13,"context_line":"allocated to it. Put in concrete terms, consider a host with 1 NUMA"},{"line_number":14,"context_line":"cell, 2 CPUs, 1G of 4k pages, and a single 1G page. If you boot a first"},{"line_number":15,"context_line":"instance with 1 CPU, CPU pinning, 1G of RAM, and no specific page size,"},{"line_number":16,"context_line":"the instance should boot successfully. An attempt to boot a second"},{"line_number":17,"context_line":"instance with the same configuration should fail because there is only"},{"line_number":18,"context_line":"the single 1G page available, however, this is not currently the case."},{"line_number":19,"context_line":"The reason this happens is because we currently have two tests: a first"},{"line_number":20,"context_line":"that checks total (not free!) host pages and a second that checks free"},{"line_number":21,"context_line":"memory but with no consideration for page size. The first check passes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9f560f44_58eef420","line":18,"range":{"start_line":13,"start_character":17,"end_line":18,"end_character":28},"in_reply_to":"9f560f44_189abcc3","updated":"2020-10-12 11:10:59.000000000","message":"thanks. Based on this it is a fault to allow the second boot to use the 1G pages.","commit_id":"2427326c5683ab4cfc4697e9c6d7f2cb080014df"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ba04a3ffc13735ee3802ae98546eb2ea2200108a","unresolved":false,"context_lines":[{"line_number":10,"context_line":"ensure pinned instances do not overcommit was not pagesize aware. This"},{"line_number":11,"context_line":"means if an instance without hugepages boots on a host with a large"},{"line_number":12,"context_line":"number of hugepages allocated, it may not get all of the memory"},{"line_number":13,"context_line":"allocated to it. Put in concrete terms, consider a host with 1 NUMA"},{"line_number":14,"context_line":"cell, 2 CPUs, 1G of 4k pages, and a single 1G page. If you boot a first"},{"line_number":15,"context_line":"instance with 1 CPU, CPU pinning, 1G of RAM, and no specific page size,"},{"line_number":16,"context_line":"the instance should boot successfully. An attempt to boot a second"},{"line_number":17,"context_line":"instance with the same configuration should fail because there is only"},{"line_number":18,"context_line":"the single 1G page available, however, this is not currently the case."},{"line_number":19,"context_line":"The reason this happens is because we currently have two tests: a first"},{"line_number":20,"context_line":"that checks total (not free!) host pages and a second that checks free"},{"line_number":21,"context_line":"memory but with no consideration for page size. The first check passes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9f560f44_58527413","line":18,"range":{"start_line":13,"start_character":17,"end_line":18,"end_character":28},"in_reply_to":"9f560f44_449a9412","updated":"2020-10-12 10:47:43.000000000","message":"\u003e So the first boot selects the 4k pages over the 1G page.\n\nYup.\n\n \u003e It can as\n \u003e the user did not specified the page size, so nova can choose.\n\nSort of. It\u0027s not free to choose any page size. Rather, it will choose the smallest possible pagesize on that host. For x86 hosts, this is *always* 4k.\n\n \u003e I\n \u003e guess if the user did not specify the page size then the second\n \u003e boot is free to select the 1 piece of 1G page as well.\n\nNope. As above, it will always try to use the smallest possible page size on that host. On x86 at least, you must always have some amount of 4k pages. The kernel won\u0027t boot otherwise.\n\n \u003e I feel that I\u0027m missing something.\n \u003e \n \u003e What is the defined meaning of not having a page size specified:\n \u003e * nova free to chose whatever page size available\n \u003e * nova defaults to 4k pages if pagesize is not defined by the user\n\nThe latter. Nova defaults to the smallest pagesize on that host, which for x86 is 4k\n\n \u003e Does the fact that we have pinned CPUs in the instance changes the\n \u003e above definition?\n\nHaving pinned CPUs mean you can\u0027t overcommit. The instance will still use the smallest pagesize (4k on x86) but you can no longer overcommit on that inventory.","commit_id":"2427326c5683ab4cfc4697e9c6d7f2cb080014df"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e61825d7e5a93ac1bdd6b3193283a1a692a35722","unresolved":false,"context_lines":[{"line_number":10,"context_line":"ensure pinned instances do not overcommit was not pagesize aware. This"},{"line_number":11,"context_line":"means if an instance without hugepages boots on a host with a large"},{"line_number":12,"context_line":"number of hugepages allocated, it may not get all of the memory"},{"line_number":13,"context_line":"allocated to it. Put in concrete terms, consider a host with 1 NUMA"},{"line_number":14,"context_line":"cell, 2 CPUs, 1G of 4k pages, and a single 1G page. If you boot a first"},{"line_number":15,"context_line":"instance with 1 CPU, CPU pinning, 1G of RAM, and no specific page size,"},{"line_number":16,"context_line":"the instance should boot successfully. An attempt to boot a second"},{"line_number":17,"context_line":"instance with the same configuration should fail because there is only"},{"line_number":18,"context_line":"the single 1G page available, however, this is not currently the case."},{"line_number":19,"context_line":"The reason this happens is because we currently have two tests: a first"},{"line_number":20,"context_line":"that checks total (not free!) host pages and a second that checks free"},{"line_number":21,"context_line":"memory but with no consideration for page size. The first check passes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9f560f44_189abcc3","line":18,"range":{"start_line":13,"start_character":17,"end_line":18,"end_character":28},"in_reply_to":"9f560f44_449a9412","updated":"2020-10-12 10:48:53.000000000","message":"if a user does not specify a page size nova must use 4k small pages it may not use hugepages of any size.\n\nthere is technically ha hw:mem_page_size\u003dany that was ment to allow nova to use any page size that will fit but we never fully implmented that as far as i am aware. we just impletned hw:mem_page_size\u003dany to mean use small pages unless the image sets a page size","commit_id":"2427326c5683ab4cfc4697e9c6d7f2cb080014df"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"13e15a6cc9717211f744364e6b3111aa1cb8130b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"7d8381a9_57cd5673","updated":"2024-03-19 20:00:29.000000000","message":"i think this is still a valid  bug so i have rebased it in the ui\nto get new ci results.","commit_id":"f14c16af82ecc44cff07be8589fb020bd6625af2"}],"nova/tests/unit/virt/test_hardware.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"77a0fb2b1c1f5d42b9c0ed912c704ebb57eb1fc9","unresolved":false,"context_lines":[{"line_number":2059,"context_line":"        self.assertEqual(host_cell.id, fitted_cell.id)"},{"line_number":2060,"context_line":""},{"line_number":2061,"context_line":"        # host cell now only has 1023 MiB memory, all small pages"},{"line_number":2062,"context_line":"        host_cell.memory_usage \u003d 1"},{"line_number":2063,"context_line":"        host_cell.mempages[0].used \u003d 1"},{"line_number":2064,"context_line":""},{"line_number":2065,"context_line":"        # instance cell requests 1024 MiB memory again, all small pages -\u003e FAIL"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_31c85772","line":2062,"range":{"start_line":2062,"start_character":33,"end_line":2062,"end_character":34},"updated":"2020-04-02 14:33:32.000000000","message":"This would be 4 in \"real life\", if we somehow end up with an instance using a single 4K page, as you say on the next line, right?","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"2ec7226e877c65368923ad7b44e55517096192a6","unresolved":false,"context_lines":[{"line_number":2059,"context_line":"        self.assertEqual(host_cell.id, fitted_cell.id)"},{"line_number":2060,"context_line":""},{"line_number":2061,"context_line":"        # host cell now only has 1023 MiB memory, all small pages"},{"line_number":2062,"context_line":"        host_cell.memory_usage \u003d 1"},{"line_number":2063,"context_line":"        host_cell.mempages[0].used \u003d 1"},{"line_number":2064,"context_line":""},{"line_number":2065,"context_line":"        # instance cell requests 1024 MiB memory again, all small pages -\u003e FAIL"}],"source_content_type":"text/x-python","patch_set":5,"id":"ff570b3c_5c269118","line":2062,"range":{"start_line":2062,"start_character":33,"end_line":2062,"end_character":34},"in_reply_to":"df33271e_31c85772","updated":"2020-05-25 08:23:41.000000000","message":"the minium allocation we support in nova is 1MB so we will never have a guest with a single 4k page.","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"}],"nova/virt/hardware.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2aa3d0e70427dc69e03a0e81c2df9f340076b41b","unresolved":false,"context_lines":[{"line_number":1027,"context_line":"    else:"},{"line_number":1028,"context_line":"        # The instance provides a NUMA topology but does not define any"},{"line_number":1029,"context_line":"        # particular page size for its memory."},{"line_number":1030,"context_line":"        if host_cell.mempages:"},{"line_number":1031,"context_line":"            # The host supports explicit page sizes. Use a pagesize-aware"},{"line_number":1032,"context_line":"            # memory check using the smallest available page size."},{"line_number":1033,"context_line":"            pagesize \u003d _get_smallest_pagesize(host_cell)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfdaf3ff_3932ef11","line":1030,"range":{"start_line":1030,"start_character":7,"end_line":1030,"end_character":30},"updated":"2019-01-16 14:22:20.000000000","message":"if the host doesn\u0027t has any mem pages, then the cpu pinned instance will lose that check you removed.","commit_id":"2ac76c48fb91d2bc09f1962ef2ede9b1da970d25"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c35fafe537cea8483d8a03c7681df40fe30b50a0","unresolved":false,"context_lines":[{"line_number":1027,"context_line":"    else:"},{"line_number":1028,"context_line":"        # The instance provides a NUMA topology but does not define any"},{"line_number":1029,"context_line":"        # particular page size for its memory."},{"line_number":1030,"context_line":"        if host_cell.mempages:"},{"line_number":1031,"context_line":"            # The host supports explicit page sizes. Use a pagesize-aware"},{"line_number":1032,"context_line":"            # memory check using the smallest available page size."},{"line_number":1033,"context_line":"            pagesize \u003d _get_smallest_pagesize(host_cell)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfdaf3ff_af9c350e","line":1030,"range":{"start_line":1030,"start_character":7,"end_line":1030,"end_character":30},"in_reply_to":"bfdaf3ff_3932ef11","updated":"2019-01-17 17:23:43.000000000","message":"the host will always have mempages for at least the smallest page size in the libivt case.\n\nhyperv has a single unit test that implys pinning is supported \n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/tests/unit/virt/hyperv/test_vmops.py#n712\n\nbuy i dont think they support setting a guest mem_page_size.\n\nin any event if the host does not have mempage we take the else on line 1052 below","commit_id":"2ac76c48fb91d2bc09f1962ef2ede9b1da970d25"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b5e16cb26500192633fdfca127132fde243f6dd1","unresolved":false,"context_lines":[{"line_number":1027,"context_line":"    else:"},{"line_number":1028,"context_line":"        # The instance provides a NUMA topology but does not define any"},{"line_number":1029,"context_line":"        # particular page size for its memory."},{"line_number":1030,"context_line":"        if host_cell.mempages:"},{"line_number":1031,"context_line":"            # The host supports explicit page sizes. Use a pagesize-aware"},{"line_number":1032,"context_line":"            # memory check using the smallest available page size."},{"line_number":1033,"context_line":"            pagesize \u003d _get_smallest_pagesize(host_cell)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_43c02a51","line":1030,"range":{"start_line":1030,"start_character":7,"end_line":1030,"end_character":30},"in_reply_to":"bfdaf3ff_af9c350e","updated":"2020-03-20 10:47:46.000000000","message":"Done","commit_id":"2ac76c48fb91d2bc09f1962ef2ede9b1da970d25"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c35fafe537cea8483d8a03c7681df40fe30b50a0","unresolved":false,"context_lines":[{"line_number":1049,"context_line":"                           \u0027total\u0027: host_cell.memory,"},{"line_number":1050,"context_line":"                           \u0027pagesize\u0027: pagesize})"},{"line_number":1051,"context_line":"                return"},{"line_number":1052,"context_line":"        else:"},{"line_number":1053,"context_line":"            # The host does not support explicit page sizes. Ignore pagesizes"},{"line_number":1054,"context_line":"            # completely."},{"line_number":1055,"context_line":"            # NOTE(stephenfin): Do not allow an instance to overcommit against"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfdaf3ff_da5cd5ee","line":1052,"updated":"2019-01-17 17:23:43.000000000","message":"this branch will be taken if the host does not have mempages reported. e.g. hyperv?","commit_id":"2ac76c48fb91d2bc09f1962ef2ede9b1da970d25"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c35fafe537cea8483d8a03c7681df40fe30b50a0","unresolved":false,"context_lines":[{"line_number":1056,"context_line":"            # itself on any NUMA cell, i.e. with \u0027ram_allocation_ratio \u003d 2.0\u0027"},{"line_number":1057,"context_line":"            # on a host with 1GB RAM, we should allow two 1GB instances but not"},{"line_number":1058,"context_line":"            # one 2GB instance."},{"line_number":1059,"context_line":"            if instance_cell.memory \u003e host_cell.memory:"},{"line_number":1060,"context_line":"                LOG.debug(\u0027Not enough host cell memory to fit instance cell. \u0027"},{"line_number":1061,"context_line":"                          \u0027Required: %(required)d, actual: %(actual)d\u0027,"},{"line_number":1062,"context_line":"                          {\u0027required\u0027: instance_cell.memory,"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfdaf3ff_dadff537","line":1059,"range":{"start_line":1059,"start_character":12,"end_line":1059,"end_character":55},"updated":"2019-01-17 17:23:43.000000000","message":"in which case i guess the same test should be done for now to determn if we shoudl use host_cell.memory or host_cell.available_memory based on cpu pinnig as we are doing on 1039\n\ni think checking host.memory is more correct for pinned instances but host.available_memory would be required in this case to not change existing behavior.","commit_id":"2ac76c48fb91d2bc09f1962ef2ede9b1da970d25"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"173616cf431e663e52ab73b48aa6d3f9a7c06be1","unresolved":false,"context_lines":[{"line_number":1013,"context_line":"                   \u0027num_cpu_reserved\u0027: num_cpu_reserved})"},{"line_number":1014,"context_line":"        return"},{"line_number":1015,"context_line":""},{"line_number":1016,"context_line":"    if host_cell.avail_memory \u003c instance_cell.memory:"},{"line_number":1017,"context_line":"        LOG.debug(\u0027Not enough available memory to schedule instance. \u0027"},{"line_number":1018,"context_line":"                  \u0027Oversubscription is not possible with pinned instances. \u0027"},{"line_number":1019,"context_line":"                  \u0027Required: %(required)s, available: %(available)s, \u0027"},{"line_number":1020,"context_line":"                  \u0027total: %(total)s. \u0027,"},{"line_number":1021,"context_line":"                  {\u0027required\u0027: instance_cell.memory,"},{"line_number":1022,"context_line":"                   \u0027available\u0027: host_cell.avail_memory,"},{"line_number":1023,"context_line":"                   \u0027total\u0027: host_cell.memory})"},{"line_number":1024,"context_line":"        return"},{"line_number":1025,"context_line":""},{"line_number":1026,"context_line":"    # Try to pack the instance cell onto cores"},{"line_number":1027,"context_line":"    numa_cell \u003d _pack_instance_onto_cores("}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_c6028609","side":"PARENT","line":1024,"range":{"start_line":1016,"start_character":4,"end_line":1024,"end_character":14},"updated":"2020-03-27 15:44:35.000000000","message":"i guess this si also an imporvement","commit_id":"4167a3043d52017b4ad757cc922d3f537f46be08"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"8ab1eaba43b2ae7fef675f833cb9a2905bb028e5","unresolved":false,"context_lines":[{"line_number":1064,"context_line":"        if host_cell.mempages:"},{"line_number":1065,"context_line":"            # The host supports explicit page sizes. Use a pagesize-aware"},{"line_number":1066,"context_line":"            # memory check using the smallest available page size."},{"line_number":1067,"context_line":"            pagesize \u003d _get_smallest_pagesize(host_cell)"},{"line_number":1068,"context_line":"            LOG.debug(\u0027No specific pagesize requested for instance, \u0027"},{"line_number":1069,"context_line":"                      \u0027selected pagesize: %d\u0027, pagesize)"},{"line_number":1070,"context_line":"            # we want to allow overcommit in this case as we\u0027re not using"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_e3f33d72","line":1067,"range":{"start_line":1067,"start_character":12,"end_line":1067,"end_character":56},"updated":"2020-03-27 14:55:04.000000000","message":"this in 99.9% of cases will return 4k pages.\n\n4k pages can be swapped to disk so even if you affinities the memory to a numa node because we do not set the locked property unless its a realtime instnce it can be swapped out to disk which is why we support oversubstibiton of memroy with pinning.","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1423bc13aa4fb53778c4c74e6205e5aeeea9b09a","unresolved":false,"context_lines":[{"line_number":1064,"context_line":"        if host_cell.mempages:"},{"line_number":1065,"context_line":"            # The host supports explicit page sizes. Use a pagesize-aware"},{"line_number":1066,"context_line":"            # memory check using the smallest available page size."},{"line_number":1067,"context_line":"            pagesize \u003d _get_smallest_pagesize(host_cell)"},{"line_number":1068,"context_line":"            LOG.debug(\u0027No specific pagesize requested for instance, \u0027"},{"line_number":1069,"context_line":"                      \u0027selected pagesize: %d\u0027, pagesize)"},{"line_number":1070,"context_line":"            # we want to allow overcommit in this case as we\u0027re not using"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_a37c95b5","line":1067,"range":{"start_line":1067,"start_character":12,"end_line":1067,"end_character":56},"in_reply_to":"df33271e_e3f33d72","updated":"2020-03-27 15:16:38.000000000","message":"Again, we *do not* support it. The check in [1] proves that.\n\n  Oversubscription is not possible with pinned instances.\n\nWhat am I missing here?\n\n[1] https://review.opendev.org/#/c/631053/5/nova/virt/hardware.py@a1016","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"77a0fb2b1c1f5d42b9c0ed912c704ebb57eb1fc9","unresolved":false,"context_lines":[{"line_number":1071,"context_line":"            # hugepages *except* if using CPU pinning, which for legacy reasons"},{"line_number":1072,"context_line":"            # does not allow overcommit"},{"line_number":1073,"context_line":"            use_free \u003d instance_cell.cpu_pinning_requested"},{"line_number":1074,"context_line":"            if not host_cell.can_fit_pagesize(pagesize,"},{"line_number":1075,"context_line":"                                              instance_cell.memory * units.Ki,"},{"line_number":1076,"context_line":"                                              use_free\u003duse_free):"},{"line_number":1077,"context_line":"                LOG.debug(\u0027Not enough available memory to schedule instance \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_4ef57656","line":1074,"updated":"2020-04-02 14:33:32.000000000","message":"This is the first check.","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"86eb1b772f5838333e2e059f337e9cd6cffb7956","unresolved":false,"context_lines":[{"line_number":1073,"context_line":"            use_free \u003d instance_cell.cpu_pinning_requested"},{"line_number":1074,"context_line":"            if not host_cell.can_fit_pagesize(pagesize,"},{"line_number":1075,"context_line":"                                              instance_cell.memory * units.Ki,"},{"line_number":1076,"context_line":"                                              use_free\u003duse_free):"},{"line_number":1077,"context_line":"                LOG.debug(\u0027Not enough available memory to schedule instance \u0027"},{"line_number":1078,"context_line":"                          \u0027with pagesize %(pagesize)d. Required: \u0027"},{"line_number":1079,"context_line":"                          \u0027%(required)s, available: %(available)s, total: \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_3e31790c","line":1076,"updated":"2020-03-18 00:00:59.000000000","message":"I have to say - I\u0027m having trouble with the logic. Like, obviously we can\u0027t overcommit pinned CPUs, but I don\u0027t get the automatic pinned CPUs \u003d no memory overcommit link.","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b5e16cb26500192633fdfca127132fde243f6dd1","unresolved":false,"context_lines":[{"line_number":1073,"context_line":"            use_free \u003d instance_cell.cpu_pinning_requested"},{"line_number":1074,"context_line":"            if not host_cell.can_fit_pagesize(pagesize,"},{"line_number":1075,"context_line":"                                              instance_cell.memory * units.Ki,"},{"line_number":1076,"context_line":"                                              use_free\u003duse_free):"},{"line_number":1077,"context_line":"                LOG.debug(\u0027Not enough available memory to schedule instance \u0027"},{"line_number":1078,"context_line":"                          \u0027with pagesize %(pagesize)d. Required: \u0027"},{"line_number":1079,"context_line":"                          \u0027%(required)s, available: %(available)s, total: \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_9a3c07c9","line":1076,"in_reply_to":"1fa4df85_3e31790c","updated":"2020-03-20 10:47:46.000000000","message":"I\u0027m not saying the logic is definitely correct (though the idea of wanting dedicated CPUs but *not* dedicated memory strikes me as odd), but this is the logic we had already - it\u0027s the block I\u0027m removing above [1]. Unfortunately that logic only works currently if there are no hugepages on the host. If there are, things break, which I\u0027m trying to fix here.\n\n[1] https://review.opendev.org/#/c/631053/5/nova/virt/hardware.py@a1016","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"4ce913aa51d978bd2731c367b45325189d8a89f2","unresolved":false,"context_lines":[{"line_number":1073,"context_line":"            use_free \u003d instance_cell.cpu_pinning_requested"},{"line_number":1074,"context_line":"            if not host_cell.can_fit_pagesize(pagesize,"},{"line_number":1075,"context_line":"                                              instance_cell.memory * units.Ki,"},{"line_number":1076,"context_line":"                                              use_free\u003duse_free):"},{"line_number":1077,"context_line":"                LOG.debug(\u0027Not enough available memory to schedule instance \u0027"},{"line_number":1078,"context_line":"                          \u0027with pagesize %(pagesize)d. Required: \u0027"},{"line_number":1079,"context_line":"                          \u0027%(required)s, available: %(available)s, total: \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_c471f5e0","line":1076,"in_reply_to":"1fa4df85_9a3c07c9","updated":"2020-03-26 16:35:46.000000000","message":"use of hw:mem_page_size disabel overcommit\nusing cpu pinning does not.\nhaving staid that if you use cpu pinnign you should always\nset hw:mem_page_size to something small, large it does not matter but it should be set to a value or else we wotn do numa aware memory checking.\n\nso cpu pinning alone is not a correct way to prevent over commit but it is not the most evil apporch either.\n\nstrictly sepaking this is a backward incomaptable change in behavior and the admin has not request over commit to be disabled but it mig be the lesser of two evils.\n\nnuma in placment shoudl fix this properly next cycle.","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"173616cf431e663e52ab73b48aa6d3f9a7c06be1","unresolved":false,"context_lines":[{"line_number":1073,"context_line":"            use_free \u003d instance_cell.cpu_pinning_requested"},{"line_number":1074,"context_line":"            if not host_cell.can_fit_pagesize(pagesize,"},{"line_number":1075,"context_line":"                                              instance_cell.memory * units.Ki,"},{"line_number":1076,"context_line":"                                              use_free\u003duse_free):"},{"line_number":1077,"context_line":"                LOG.debug(\u0027Not enough available memory to schedule instance \u0027"},{"line_number":1078,"context_line":"                          \u0027with pagesize %(pagesize)d. Required: \u0027"},{"line_number":1079,"context_line":"                          \u0027%(required)s, available: %(available)s, total: \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_a3813492","line":1076,"in_reply_to":"df33271e_0313c00e","updated":"2020-03-27 15:44:35.000000000","message":"ok you are correct that later change would prevent over subsibtion but only when pining is used. e.g. when you just do hw:numa_nodes\u003d1 or if you use pmem devices we would still allow over subsription but if you use hw:cpu_policy\u003ddedicated or hw:mem_page_size\u003dlarge we woudl not.\n\ni knew there was at least 1 case where we allowed memory oversubsription but had a numa toplogy.  i tought it was pinning but i guess not.\n\ni am pretty sure that was not intended in the original spec but looking back at the code it appears that it has been this way for a long time.\n\nif we have never support oversubsrition then any operator that enabeld cpu pinning should also have enabled hugepages if they hosts supported it as that was the only disadvantate to useign hugepages that i taught was present.\n\nif we can over subsribe memeory with pinned instance hugepage is allways better.","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"8ab1eaba43b2ae7fef675f833cb9a2905bb028e5","unresolved":false,"context_lines":[{"line_number":1073,"context_line":"            use_free \u003d instance_cell.cpu_pinning_requested"},{"line_number":1074,"context_line":"            if not host_cell.can_fit_pagesize(pagesize,"},{"line_number":1075,"context_line":"                                              instance_cell.memory * units.Ki,"},{"line_number":1076,"context_line":"                                              use_free\u003duse_free):"},{"line_number":1077,"context_line":"                LOG.debug(\u0027Not enough available memory to schedule instance \u0027"},{"line_number":1078,"context_line":"                          \u0027with pagesize %(pagesize)d. Required: \u0027"},{"line_number":1079,"context_line":"                          \u0027%(required)s, available: %(available)s, total: \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_836d1134","line":1076,"in_reply_to":"df33271e_43102902","updated":"2020-03-27 14:55:04.000000000","message":"stephen the reason you need to set hw:mem_page_size when doing pinning has nothing to do with hugepages.\n\nit has to do with how we track memory. and how instance with shared cpus work.\n\nto safely be able to mix vms with pCPUs and vCPUS on the same host all insntance must have hw:mem_page_size set. if they dont then the pinned instance which have there memory pinned to the same numa node as there cpus can be killed as a result of a oom event on the host.\n\nseting hw:mem_page_size to small or large causes use to pin the memory of the guest and track that in the resouce tracker. if we dont do that then we wont correctly track the memory usage of the shared instnaces and or the pinned instances properly.\n\nso if you are mixing floating and pinned vms on the same host it is absolutely required.\n\nalso this branch will only ever look at the non hugepage memroy. so if 50% of the memory is allcoated to hugepages it will make no differnece the pagezise we will be checking here will be just the 4k memory.","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1423bc13aa4fb53778c4c74e6205e5aeeea9b09a","unresolved":false,"context_lines":[{"line_number":1073,"context_line":"            use_free \u003d instance_cell.cpu_pinning_requested"},{"line_number":1074,"context_line":"            if not host_cell.can_fit_pagesize(pagesize,"},{"line_number":1075,"context_line":"                                              instance_cell.memory * units.Ki,"},{"line_number":1076,"context_line":"                                              use_free\u003duse_free):"},{"line_number":1077,"context_line":"                LOG.debug(\u0027Not enough available memory to schedule instance \u0027"},{"line_number":1078,"context_line":"                          \u0027with pagesize %(pagesize)d. Required: \u0027"},{"line_number":1079,"context_line":"                          \u0027%(required)s, available: %(available)s, total: \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_0313c00e","line":1076,"in_reply_to":"df33271e_836d1134","updated":"2020-03-27 15:16:38.000000000","message":"\u003e stephen the reason you need to set hw:mem_page_size when doing\n \u003e pinning has nothing to do with hugepages.\n \u003e \n \u003e it has to do with how we track memory. and how instance with shared\n \u003e cpus work.\n \u003e \n \u003e to safely be able to mix vms with pCPUs and vCPUS on the same host\n \u003e all insntance must have hw:mem_page_size set. if they dont then the\n \u003e pinned instance which have there memory pinned to the same numa\n \u003e node as there cpus can be killed as a result of a oom event on the\n \u003e host.\n\nUnless you\u0027re using hugepages though, all pages can be swapped to disk so I\u0027m not sure why having memory restricted to a single NUMA node would make \u0027hw:mem_page_size\u0027 compulsory. It might make it *more likely* that you\u0027ll have OOM events, but that\u0027s only because the instances that are stuck to one NUMA node doesn\u0027t have a chance to fall over to  memory from another. Theoretically you\u0027re dicing with OOM every time you run with overcommit.\n\n \u003e seting hw:mem_page_size to small or large causes use to pin the\n \u003e memory of the guest and track that in the resouce tracker. if we\n \u003e dont do that then we wont correctly track the memory usage of the\n \u003e shared instnaces and or the pinned instances properly.\n\nAgain, I don\u0027t know why this would be a critical issue if we didn\u0027t have hugepage-based instances since we always do a non-pagesize aware memory check for every instance (via placement). You\u0027re correct that our memory-page tracking wouldn\u0027t be able to track the usage by non-pagesize-aware instances, but again, those instances could always just run on another core.\n\n \u003e so if you are mixing floating and pinned vms on the same host it is\n \u003e absolutely required.\n \u003e \n \u003e also this branch will only ever look at the non hugepage memroy. so\n \u003e if 50% of the memory is allcoated to hugepages it will make no\n \u003e differnece the pagezise we will be checking here will be just the\n \u003e 4k memory.\n\nYes, but later in this code, we have a check to prevent overcommit - it\u0027s [1] - and that *does* include hugepage memory, so that 50% will be included. If we had already allocated the non-hugepage memory, that check would pass because hey, 50% of the memory is \"unused\". That\u0027s the whole point of this change :)\n\n[1] https://review.opendev.org/#/c/631053/5/nova/virt/hardware.py@a1016","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"5e19ce04fd0911710c4b893c2ac36df619318981","unresolved":false,"context_lines":[{"line_number":1073,"context_line":"            use_free \u003d instance_cell.cpu_pinning_requested"},{"line_number":1074,"context_line":"            if not host_cell.can_fit_pagesize(pagesize,"},{"line_number":1075,"context_line":"                                              instance_cell.memory * units.Ki,"},{"line_number":1076,"context_line":"                                              use_free\u003duse_free):"},{"line_number":1077,"context_line":"                LOG.debug(\u0027Not enough available memory to schedule instance \u0027"},{"line_number":1078,"context_line":"                          \u0027with pagesize %(pagesize)d. Required: \u0027"},{"line_number":1079,"context_line":"                          \u0027%(required)s, available: %(available)s, total: \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_43102902","line":1076,"in_reply_to":"df33271e_c471f5e0","updated":"2020-03-27 14:35:44.000000000","message":"\u003e use of hw:mem_page_size disabel overcommit\n \u003e using cpu pinning does not.\n\nThat\u0027s not true.\n\nhttps://github.com/openstack/nova/blob/20.1.0/nova/virt/hardware.py#L1016-L1024\n\n \u003e having staid that if you use cpu pinnign you should always\n \u003e set hw:mem_page_size to something small, large it does not matter\n \u003e but it should be set to a value or else we wotn do numa aware\n \u003e memory checking.\n\nThat\u0027s useful but not necessary unless you also have instances using hugepages on the host. Mixing pagesize-aware instances and non-pagesize-aware instances does cause issues.\n\n \u003e so cpu pinning alone is not a correct way to prevent over commit\n \u003e but it is not the most evil apporch either.\n\nAs above, it is correct.\n\n \u003e strictly sepaking this is a backward incomaptable change in\n \u003e behavior and the admin has not request over commit to be disabled\n \u003e but it mig be the lesser of two evils.\n\nThis is not really true. Previously, if a host had e.g. 50% of its memory allocated to hugepages, an admin might be able to boot one or more pinned but non-pagesize aware instances that, combined, consumed more than 50% of the host memory. However, not all of this memory was actually allocated so this was broken behavior. It\u0027s only backwards incompatible in so far as instances now get what they\u0027re actually asking for.\n\n \u003e numa in placment shoudl fix this properly next cycle.\n\nWe\u0027ve been saying that for a few years now :)","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"77a0fb2b1c1f5d42b9c0ed912c704ebb57eb1fc9","unresolved":false,"context_lines":[{"line_number":1150,"context_line":""},{"line_number":1151,"context_line":"    if instance_cell.cpu_pinning_requested:"},{"line_number":1152,"context_line":"        LOG.debug(\u0027Pinning has been requested\u0027)"},{"line_number":1153,"context_line":"        new_instance_cell \u003d _numa_fit_instance_cell_with_pinning("},{"line_number":1154,"context_line":"            host_cell, instance_cell, cpuset_reserved)"},{"line_number":1155,"context_line":"        if not new_instance_cell:"},{"line_number":1156,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_f1c70f95","line":1153,"updated":"2020-04-02 14:33:32.000000000","message":"This is the second check.","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"173616cf431e663e52ab73b48aa6d3f9a7c06be1","unresolved":false,"context_lines":[{"line_number":1150,"context_line":""},{"line_number":1151,"context_line":"    if instance_cell.cpu_pinning_requested:"},{"line_number":1152,"context_line":"        LOG.debug(\u0027Pinning has been requested\u0027)"},{"line_number":1153,"context_line":"        new_instance_cell \u003d _numa_fit_instance_cell_with_pinning("},{"line_number":1154,"context_line":"            host_cell, instance_cell, cpuset_reserved)"},{"line_number":1155,"context_line":"        if not new_instance_cell:"},{"line_number":1156,"context_line":"            return"},{"line_number":1157,"context_line":"        new_instance_cell.pagesize \u003d instance_cell.pagesize"}],"source_content_type":"text/x-python","patch_set":5,"id":"df33271e_e3317c0d","line":1154,"range":{"start_line":1153,"start_character":6,"end_line":1154,"end_character":54},"updated":"2020-03-27 15:44:35.000000000","message":"we do call that function here too.","commit_id":"dd61b35a7aa5bf89e018fc3f77f8f98571c5b858"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"11029c9964f07d2fa980070a5923b3e4b4432d18","unresolved":false,"context_lines":[{"line_number":1114,"context_line":"                        {\u0027required\u0027: instance_cell.memory,"},{"line_number":1115,"context_line":"                         \u0027available\u0027: host_cell.avail_memory,"},{"line_number":1116,"context_line":"                         \u0027total\u0027: host_cell.memory})"},{"line_number":1117,"context_line":"                    return"},{"line_number":1118,"context_line":"            else:"},{"line_number":1119,"context_line":"                if host_cell.memory \u003c instance_cell.memory:"},{"line_number":1120,"context_line":"                    LOG.debug("}],"source_content_type":"text/x-python","patch_set":6,"id":"9f560f44_8efd7d3d","line":1117,"updated":"2020-09-16 12:14:13.000000000","message":"pep8: error: Return value expected","commit_id":"0af0f36300eab647d9dc44fc1f809b8cfd49ad9f"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"11029c9964f07d2fa980070a5923b3e4b4432d18","unresolved":false,"context_lines":[{"line_number":1122,"context_line":"                        \u0027Required: %(required)d, actual: %(total)d\u0027,"},{"line_number":1123,"context_line":"                        {\u0027required\u0027: instance_cell.memory,"},{"line_number":1124,"context_line":"                         \u0027total\u0027: host_cell.memory})"},{"line_number":1125,"context_line":"                    return"},{"line_number":1126,"context_line":""},{"line_number":1127,"context_line":"    # NOTE(stephenfin): As with memory, do not allow an instance to overcommit"},{"line_number":1128,"context_line":"    # against itself on any NUMA cell"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f560f44_eefa3941","line":1125,"updated":"2020-09-16 12:14:13.000000000","message":"pep8: error: Return value expected","commit_id":"0af0f36300eab647d9dc44fc1f809b8cfd49ad9f"}]}
