)]}'
{"nova/scheduler/filters/numa_topology_filter.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"d20d8e74d5e690cf192f040da85e8f4d186a8175","unresolved":false,"context_lines":[{"line_number":24,"context_line":"class NUMATopologyFilter(filters.BaseHostFilter):"},{"line_number":25,"context_line":"    \"\"\"Filter on requested NUMA topology.\"\"\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def _satisfies_cpu_policy(self, host_state, extra_specs):"},{"line_number":28,"context_line":"        \"\"\"Check that the host_state provided satisfies any available"},{"line_number":29,"context_line":"        CPU policy requirements."},{"line_number":30,"context_line":"        \"\"\""},{"line_number":31,"context_line":"        host_topology, _ \u003d hardware.host_topology_and_format_from_host("},{"line_number":32,"context_line":"            host_state)"},{"line_number":33,"context_line":"        cpu_policy \u003d extra_specs.get(\u0027hw:cpu_policy\u0027)"},{"line_number":34,"context_line":"        cpu_threads_policy \u003d extra_specs.get(\u0027hw:cpu_threads_policy\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"        if host_topology:"},{"line_number":37,"context_line":"            if (cpu_policy \u003d\u003d cpu_policies.DEDICATED and"},{"line_number":38,"context_line":"                cpu_threads_policy \u003d\u003d thread_policies.AVOID):"},{"line_number":39,"context_line":"                # NOTE(sfinucan) It may be possible that some NUMA cells on"},{"line_number":40,"context_line":"                #   this host are HT-enabled while others are not. We could"},{"line_number":41,"context_line":"                #   theoretically schedule on this host and just avoid these"},{"line_number":42,"context_line":"                #   cells. However, this is complicated edge case with a low"},{"line_number":43,"context_line":"                #   ROI - HT on any cell will result in this host not passing."},{"line_number":44,"context_line":"                for cell in host_topology.cells:"},{"line_number":45,"context_line":"                    # the presence of siblings indicates hyperthreading (HT)"},{"line_number":46,"context_line":"                    if cell.siblings:"},{"line_number":47,"context_line":"                        LOG.debug(\"%(host_state)s fails CPU policy \""},{"line_number":48,"context_line":"                                  \"requirements. Host has hyperthreading \""},{"line_number":49,"context_line":"                                  \"enabled but \u0027avoid\u0027 threads policy was \""},{"line_number":50,"context_line":"                                  \"requested.\", {\u0027host_state\u0027: host_state})"},{"line_number":51,"context_line":"                        return False"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        return True"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @filters.compat_legacy_props"},{"line_number":56,"context_line":"    def host_passes(self, host_state, filter_properties):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a8ffd7b_e641c30c","line":53,"range":{"start_line":27,"start_character":4,"end_line":53,"end_character":19},"updated":"2015-11-25 14:26:49.000000000","message":"Why would we inline this here? Seems like we could do this nicely in hardware.numa_fit_instance_to_host\n\n  if (instance_topology.cpu_threads_policy \u003d\u003d thread_policies.AVOID and\n      any(cell.siblings for cell in host_topology.cells)):\n         LOG.(...)\n         return","commit_id":"6e03dce1e99cc45a4c86c8684106c4392f5424d4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"2625a8457c25ecb35922ad6422eb87cf3e140958","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                                  \"requested.\", {\u0027host_state\u0027: host_state})"},{"line_number":51,"context_line":"                        return False"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        return True"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @filters.compat_legacy_props"},{"line_number":56,"context_line":"    def host_passes(self, host_state, filter_properties):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a8ffd7b_05270fb7","line":53,"in_reply_to":"9a8ffd7b_e641c30c","updated":"2015-11-25 16:24:22.000000000","message":"Per my understanding, this kind of \"static analysis\" of hosts is exactly what filter should be used for. A host can either have hyperthreading or it cannot and we can determine this easily (as we\u0027ve done here) as part of the filtering process, It\u0027s wasteful to attempt to do this any later because you incur the overhead of everything that happens between filtering and executing \u0027hardware.numa_fit_instance_to_host\u0027, which is quite a lot.\n\nThis doesn\u0027t really matter for this, seeing as the \u0027avoid\u0027 policy is going away, but I use a similar tactic in the \u0027prefer\u0027 policy for the same reasons.","commit_id":"6e03dce1e99cc45a4c86c8684106c4392f5424d4"}]}
