)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"113b8e549bc25cef5bb5ea29862e89852362f75b","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zhangchunlong1@huawei.com \u003czhangchunlong1@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-03-26 16:36:30 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"creating ordinary numa vm fails with large_page_vm"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"creating ordinary vm may fails with large page vm and ordinary vm on the"},{"line_number":10,"context_line":"same numa node."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa963961_cc865013","line":7,"updated":"2015-03-26 16:19:18.000000000","message":"please, explain what you are fixing","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"113b8e549bc25cef5bb5ea29862e89852362f75b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"creating ordinary numa vm fails with large_page_vm"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"creating ordinary vm may fails with large page vm and ordinary vm on the"},{"line_number":10,"context_line":"same numa node."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"the following scene can reproduce the problem:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa963961_ac7c2c21","line":9,"updated":"2015-03-26 16:19:18.000000000","message":"explain how you fix","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"113b8e549bc25cef5bb5ea29862e89852362f75b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"creating ordinary vm may fails with large page vm and ordinary vm on the"},{"line_number":10,"context_line":"same numa node."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"the following scene can reproduce the problem:"},{"line_number":13,"context_line":"1. Assumpt that a host with two numa nodes are used to create vm, and the"},{"line_number":14,"context_line":"memory of each numa node consists of 5GB huge page and 5GB ordinary page."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa963961_4caa4072","line":12,"updated":"2015-03-26 16:19:18.000000000","message":"no need, or as example but better to keep that in the bug report","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"7686b27d0f8ca560d0efaabd53b7bb47c2193741","unresolved":false,"context_lines":[{"line_number":9,"context_line":"creating ordinary vm may fails with large page vm and ordinary vm on the"},{"line_number":10,"context_line":"same numa node."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"the following scene can reproduce the problem:"},{"line_number":13,"context_line":"1. Assumpt that a host with two numa nodes are used to create vm, and the"},{"line_number":14,"context_line":"memory of each numa node consists of 5GB huge page and 5GB ordinary page."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa963961_6bc71813","line":12,"in_reply_to":"fa963961_4caa4072","updated":"2015-03-28 10:38:56.000000000","message":"ok, thanks for your advice","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"}],"nova/compute/claims.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"113b8e549bc25cef5bb5ea29862e89852362f75b","unresolved":false,"context_lines":[{"line_number":182,"context_line":"                    avail_pagesize \u003d [page.size_kb for page in"},{"line_number":183,"context_line":"                                      host_cell.mempages]"},{"line_number":184,"context_line":"                    avail_pagesize.sort()"},{"line_number":185,"context_line":"                    smallest \u003d avail_pagesize[0]"},{"line_number":186,"context_line":"                    for page in host_cell.mempages:"},{"line_number":187,"context_line":"                        if page.size_kb !\u003d smallest:"},{"line_number":188,"context_line":"                            used_huge_mem +\u003d page.used * page.size_kb / units.Ki"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa963961_ccaf7093","line":185,"updated":"2015-03-26 16:19:18.000000000","message":"Again here you do not need to do that compute, after to have identified the smallest you can use that object to retrieve the real free ram memory","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"}],"nova/objects/numa.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"9168e017be41eb8b0e79a3b5661a8a5090129a05","unresolved":false,"context_lines":[{"line_number":134,"context_line":"class NUMAPagesTopology(base.NovaObject,"},{"line_number":135,"context_line":"                        base.NovaObjectDictCompat):"},{"line_number":136,"context_line":"    # Version 1.0: Initial version"},{"line_number":137,"context_line":"    # Version 1.1: add the total_kb property"},{"line_number":138,"context_line":"    VERSION \u003d \u00271.1\u0027"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    fields \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa041b7_bcbb250e","line":137,"updated":"2015-04-02 07:07:00.000000000","message":"No need to bump version here, the method is not remotable.","commit_id":"bc447377063744d0b4a5b269e0986493eadcdc0d"}],"nova/scheduler/filters/ram_filter.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"113b8e549bc25cef5bb5ea29862e89852362f75b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            for host_cell in host_topology.cells:"},{"line_number":62,"context_line":"                avail_pagesize \u003d [page.size_kb for page in host_cell.mempages]"},{"line_number":63,"context_line":"                avail_pagesize.sort()"},{"line_number":64,"context_line":"                smallest \u003d avail_pagesize[0]"},{"line_number":65,"context_line":"                for page in host_cell.mempages:"},{"line_number":66,"context_line":"                    if page.size_kb !\u003d smallest:"},{"line_number":67,"context_line":"                        total_huge_page +\u003d page.total * page.size_kb / units.Ki"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa963961_6c1aa419","line":64,"updated":"2015-03-26 16:19:18.000000000","message":"smallest is actually what you need that will return to you the free_ram_mb. No need to compute free_huge_mem","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"fe852a833a7927bee164e81266d11d1ea68e902f","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            for host_cell in host_topology.cells:"},{"line_number":62,"context_line":"                avail_pagesize \u003d [page.size_kb for page in host_cell.mempages]"},{"line_number":63,"context_line":"                avail_pagesize.sort()"},{"line_number":64,"context_line":"                smallest \u003d avail_pagesize[0]"},{"line_number":65,"context_line":"                for page in host_cell.mempages:"},{"line_number":66,"context_line":"                    if page.size_kb !\u003d smallest:"},{"line_number":67,"context_line":"                        total_huge_page +\u003d page.total * page.size_kb / units.Ki"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9b358b_85d7bdec","line":64,"in_reply_to":"da9b358b_46b9e4e8","updated":"2015-03-31 09:08:38.000000000","message":"If we use this method, there may be a problem. \nI notice that the number of small pages is not updated in the\nprocess of update_available_resource if there are some\nordinary numa vms and just update the memory in the corresponding numa cell.\n \nthe following code is a part of update_available_resource.\nif instancecell.pagesize and instancecell.pagesize \u003e 0:\n                        newcell.mempages \u003d   _numa_pagesize_usage_from_cell(\n                            hostcell, instancecell, sign)\n\nIn addition, I think that the current update_available_resource solution is ok, \nbecause the memory used by non-numa ordinary vms also is small pages, but these memory is not belonged to any numa cell.","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"c1d4109d5a3f2f91ac9fa254d1c812ad561400b5","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            for host_cell in host_topology.cells:"},{"line_number":62,"context_line":"                avail_pagesize \u003d [page.size_kb for page in host_cell.mempages]"},{"line_number":63,"context_line":"                avail_pagesize.sort()"},{"line_number":64,"context_line":"                smallest \u003d avail_pagesize[0]"},{"line_number":65,"context_line":"                for page in host_cell.mempages:"},{"line_number":66,"context_line":"                    if page.size_kb !\u003d smallest:"},{"line_number":67,"context_line":"                        total_huge_page +\u003d page.total * page.size_kb / units.Ki"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa041b7_1a2c6d49","line":64,"in_reply_to":"da9b358b_85d7bdec","updated":"2015-04-01 15:45:23.000000000","message":"It is right ! and it is clearly a bug. I have reported it here https://bugs.launchpad.net/nova/+bug/1439262 and i will try to quickly provide a fix. I guess it will be to remove the way we currently handle SMALL_MEMPAGES. so your algorithm seems good even if we can probably try to handle some of this logic in objects/numa.py","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"7686b27d0f8ca560d0efaabd53b7bb47c2193741","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            for host_cell in host_topology.cells:"},{"line_number":62,"context_line":"                avail_pagesize \u003d [page.size_kb for page in host_cell.mempages]"},{"line_number":63,"context_line":"                avail_pagesize.sort()"},{"line_number":64,"context_line":"                smallest \u003d avail_pagesize[0]"},{"line_number":65,"context_line":"                for page in host_cell.mempages:"},{"line_number":66,"context_line":"                    if page.size_kb !\u003d smallest:"},{"line_number":67,"context_line":"                        total_huge_page +\u003d page.total * page.size_kb / units.Ki"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa963961_8d3ca994","line":64,"in_reply_to":"fa963961_6c1aa419","updated":"2015-03-28 10:38:56.000000000","message":"IMO, the total mem consists of four parts, we can use A, B, C,D to stand for these parts.\nA is the huge mem used; B is the small mem used; C is the free huge mem; D is the free small mem;\nthe current status can be described by the following formula:\n\nused_ram_mb \u003d A + B\nfree_ram_mb \u003d total_mem - (A + B)\nusable_ram \u003d memory_mb_limit - (A + B)\n\nI think that the creating ordinary numa vm only can use the D part, it can not use the C part.\nSo, to the creating ordinary numa vm is usable_ram shoud be  memory_mb_limit - (A + B +C)","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3fe1a369b75ab32ecb6072a9d9e759622abef61a","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            for host_cell in host_topology.cells:"},{"line_number":62,"context_line":"                avail_pagesize \u003d [page.size_kb for page in host_cell.mempages]"},{"line_number":63,"context_line":"                avail_pagesize.sort()"},{"line_number":64,"context_line":"                smallest \u003d avail_pagesize[0]"},{"line_number":65,"context_line":"                for page in host_cell.mempages:"},{"line_number":66,"context_line":"                    if page.size_kb !\u003d smallest:"},{"line_number":67,"context_line":"                        total_huge_page +\u003d page.total * page.size_kb / units.Ki"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9b358b_46b9e4e8","line":64,"in_reply_to":"fa963961_8d3ca994","updated":"2015-03-30 11:58:18.000000000","message":"used_ram_mb is used with small pages. What i\u0027m trying to explain is that. host_topology.cells provides a list of objects NUMAPageTopology. One of these objects is used to handle small pages. This object provides an attribute \u0027total\u0027 which returns the number of small pages, an other attribute is \u0027used\u0027 which returns the number of small pages used.\n\nYou probably want to add a new method in objects/numa.py:NUMAPagesTopology to calculate the \u0027used_kb\u0027 then you should be able to convert it in MiB.\n\n   class NUMAPagesTopology(...):\n     ...\n     @property\n     def used_kb(self):\n       return self.used * self.size_kb\n\n     @property\n     def total_kb(self):\n       return self.total * self.size_kb\n\n  ...\n   total_usable_ram_mb \u003d smallest.used_kb * units.Ki\n   used_ram_mb \u003d smallest.used_kb * units.Ki","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"c1d4109d5a3f2f91ac9fa254d1c812ad561400b5","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                smallest \u003d avail_pagesize[0]"},{"line_number":65,"context_line":"                for page in host_cell.mempages:"},{"line_number":66,"context_line":"                    if page.size_kb !\u003d smallest:"},{"line_number":67,"context_line":"                        total_huge_page +\u003d page.total * page.size_kb / units.Ki"},{"line_number":68,"context_line":"                        free_huge_mem +\u003d ("},{"line_number":69,"context_line":"                            page.total - page.used) * page.size_kb / units.Ki"},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baa041b7_fa93094e","line":67,"updated":"2015-04-01 15:45:23.000000000","message":"Can you add a method \u0027total_kb\u0027 in the object NUMAPageTopology","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"c1d4109d5a3f2f91ac9fa254d1c812ad561400b5","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                    if page.size_kb !\u003d smallest:"},{"line_number":67,"context_line":"                        total_huge_page +\u003d page.total * page.size_kb / units.Ki"},{"line_number":68,"context_line":"                        free_huge_mem +\u003d ("},{"line_number":69,"context_line":"                            page.total - page.used) * page.size_kb / units.Ki"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        total_usable_ram_mb -\u003d total_huge_page"},{"line_number":72,"context_line":"        memory_mb_limit \u003d total_usable_ram_mb * ram_allocation_ratio"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa041b7_ba10e1a9","line":69,"updated":"2015-04-01 15:45:23.000000000","message":"s/page.total - page.used * page.size_kb/page.free_kb","commit_id":"2a537d66c5ceb180e31bda1d8275cae121c69bda"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"9168e017be41eb8b0e79a3b5661a8a5090129a05","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        total_huge_page \u003d 0"},{"line_number":65,"context_line":"        free_huge_mem \u003d 0"},{"line_number":66,"context_line":"        if host_topology:"},{"line_number":67,"context_line":"            for host_cell in host_topology.cells:"},{"line_number":68,"context_line":"                mempages \u003d sorted(host_cell.mempages, key\u003dlambda p: p.size_kb)"},{"line_number":69,"context_line":"                if len(mempages) \u003e 0:"},{"line_number":70,"context_line":"                    mempages.pop(0)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa041b7_3c14b5f3","line":67,"updated":"2015-04-02 07:07:00.000000000","message":"Can we set this logic in NUMACell topology with a test associated.\n\n  cell.mempages_total_kb, cell.mempages_free_kb","commit_id":"bc447377063744d0b4a5b269e0986493eadcdc0d"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"fca067de146278c4d4bd29364ae09af1b6c3edec","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        total_huge_page \u003d 0"},{"line_number":65,"context_line":"        free_huge_mem \u003d 0"},{"line_number":66,"context_line":"        if host_topology:"},{"line_number":67,"context_line":"            for host_cell in host_topology.cells:"},{"line_number":68,"context_line":"                mempages \u003d sorted(host_cell.mempages, key\u003dlambda p: p.size_kb)"},{"line_number":69,"context_line":"                if len(mempages) \u003e 0:"},{"line_number":70,"context_line":"                    mempages.pop(0)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa041b7_df06db1f","line":67,"in_reply_to":"baa041b7_3c14b5f3","updated":"2015-04-02 08:18:20.000000000","message":"OK?I look at it","commit_id":"bc447377063744d0b4a5b269e0986493eadcdc0d"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"bdd1abfb641a5d4fd28da604d53332d8b05ea3a9","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        total_huge_page \u003d 0"},{"line_number":65,"context_line":"        free_huge_mem \u003d 0"},{"line_number":66,"context_line":"        if host_topology:"},{"line_number":67,"context_line":"            for host_cell in host_topology.cells:"},{"line_number":68,"context_line":"                mempages \u003d sorted(host_cell.mempages, key\u003dlambda p: p.size_kb)"},{"line_number":69,"context_line":"                if len(mempages) \u003e 0:"},{"line_number":70,"context_line":"                    mempages.pop(0)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa041b7_a4bbf1c3","line":67,"in_reply_to":"baa041b7_df06db1f","updated":"2015-04-02 19:52:46.000000000","message":"The point is to avoid duplicate code-logic (you are doing pretty same work in claim). An other solution is to provide a new method to perform this operation. I guess hardware.py can be a good place to add it.","commit_id":"bc447377063744d0b4a5b269e0986493eadcdc0d"}]}
