)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":891,"context_line":"            # \u0027cpu_dedicated_set\u0027 and \u0027cpu_shared_set\u0027 configuration"},{"line_number":892,"context_line":"            if (instance.numa_topology and"},{"line_number":893,"context_line":"                    instance.numa_topology.cpu_pinning_requested and"},{"line_number":894,"context_line":"                    instance.numa_topology.cpu_sharing_requested):"},{"line_number":895,"context_line":"                if (not CONF.compute.cpu_dedicated_set or"},{"line_number":896,"context_line":"                        not CONF.compute.cpu_shared_set):"},{"line_number":897,"context_line":"                    msg \u003d _(\"This host has instance requesting both pinned \""}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_d5ad969b","line":894,"range":{"start_line":894,"start_character":43,"end_line":894,"end_character":64},"updated":"2020-03-18 18:01:38.000000000","message":"Rather than doing this, I think we should just get rid of the \u0027cpu_pinning_requested\u0027 helper entirely. It really doesn\u0027t make sense anymore now that this is no longer a simple boolean thing (does it have pinning or does it not) We could either replicate the check it was doing here or add a \u0027cpu_policy\u0027 property on the \u0027InstanceNUMATopology\u0027 object that returns the value rather than a boolean.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":891,"context_line":"            # \u0027cpu_dedicated_set\u0027 and \u0027cpu_shared_set\u0027 configuration"},{"line_number":892,"context_line":"            if (instance.numa_topology and"},{"line_number":893,"context_line":"                    instance.numa_topology.cpu_pinning_requested and"},{"line_number":894,"context_line":"                    instance.numa_topology.cpu_sharing_requested):"},{"line_number":895,"context_line":"                if (not CONF.compute.cpu_dedicated_set or"},{"line_number":896,"context_line":"                        not CONF.compute.cpu_shared_set):"},{"line_number":897,"context_line":"                    msg \u003d _(\"This host has instance requesting both pinned \""}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_146327de","line":894,"range":{"start_line":894,"start_character":43,"end_line":894,"end_character":64},"in_reply_to":"1fa4df85_d5ad969b","updated":"2020-03-19 11:30:49.000000000","message":"Good idea. Will be done.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"aef8439e86e2c314a3069ea670fe23484efe9ed8","unresolved":false,"context_lines":[{"line_number":914,"context_line":"            # also check to make sure the operator hasn\u0027t accidentally"},{"line_number":915,"context_line":"            # dropped some cores that instances are currently using"},{"line_number":916,"context_line":"            available_dedicated_cpus \u003d (hardware.get_vcpu_pin_set() or"},{"line_number":917,"context_line":"                                        hardware.get_cpu_dedicated_set())"},{"line_number":918,"context_line":"            pinned_cpus \u003d instance.numa_topology.cpu_pinning"},{"line_number":919,"context_line":"            if available_dedicated_cpus and ("},{"line_number":920,"context_line":"                    pinned_cpus - available_dedicated_cpus):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_43ba4b0a","line":917,"updated":"2020-03-19 01:51:41.000000000","message":"So I guess we need to do something similar check for the shared cpus. Ensure we have correct shared cpu sets in for the existing instance.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":914,"context_line":"            # also check to make sure the operator hasn\u0027t accidentally"},{"line_number":915,"context_line":"            # dropped some cores that instances are currently using"},{"line_number":916,"context_line":"            available_dedicated_cpus \u003d (hardware.get_vcpu_pin_set() or"},{"line_number":917,"context_line":"                                        hardware.get_cpu_dedicated_set())"},{"line_number":918,"context_line":"            pinned_cpus \u003d instance.numa_topology.cpu_pinning"},{"line_number":919,"context_line":"            if available_dedicated_cpus and ("},{"line_number":920,"context_line":"                    pinned_cpus - available_dedicated_cpus):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_f4d44b49","line":917,"in_reply_to":"1fa4df85_43ba4b0a","updated":"2020-03-19 11:30:49.000000000","message":"Check to ensure the available \"shared_cpu_set\" CPU number is greater than the instance requested shared CPUs, and we cannot check if the actual usage of shared CPUs is used up, right?","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"}],"nova/objects/fields.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"d16ba804de9c5bdc5e551f5e92fa0fb8883d0937","unresolved":false,"context_lines":[{"line_number":274,"context_line":"    SHARED \u003d \"shared\""},{"line_number":275,"context_line":"    MIXED \u003d \"mixed\""},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    ALL \u003d (DEDICATED, SHARED, MIXED)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":""},{"line_number":280,"context_line":":xa"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_831fe36e","line":277,"range":{"start_line":277,"start_character":4,"end_line":277,"end_character":36},"updated":"2020-03-19 02:45:45.000000000","message":"I remember we can\u0027t change a field of an object.\n\nBut as we said, we won\u0027t allow the mixed instance before the upgrade finished. So it should be ok. Good to have Dan help to check this.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4d8e4b600ada93e252658fbddac97a309c81d43","unresolved":false,"context_lines":[{"line_number":274,"context_line":"    SHARED \u003d \"shared\""},{"line_number":275,"context_line":"    MIXED \u003d \"mixed\""},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    ALL \u003d (DEDICATED, SHARED, MIXED)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":""},{"line_number":280,"context_line":":xa"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_5a3e9029","line":277,"range":{"start_line":277,"start_character":4,"end_line":277,"end_character":36},"in_reply_to":"1fa4df85_831fe36e","updated":"2020-03-24 14:07:27.000000000","message":"We can add to a field like this, but you *must* bump the object version, and implement obj_make_compatible for the new version to fail (or convert) if the backport goes before that version.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"b02c95d5387e59c20f81f58547178725636de809","unresolved":false,"context_lines":[{"line_number":274,"context_line":"    SHARED \u003d \"shared\""},{"line_number":275,"context_line":"    MIXED \u003d \"mixed\""},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    ALL \u003d (DEDICATED, SHARED, MIXED)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":""},{"line_number":280,"context_line":":xa"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_6d0f4e2e","line":277,"range":{"start_line":277,"start_character":4,"end_line":277,"end_character":36},"in_reply_to":"df33271e_5a3e9029","updated":"2020-03-25 05:08:32.000000000","message":"Find an example in commit \u0027c9353775317cd76bd24f24589cdd51257040175f\u0027.\n\nSo you mean I need to bump the version of objects that used \u0027CPUAllocationPolicy\u0027 as a field, as well as the parent object of this object.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":277,"context_line":"    ALL \u003d (DEDICATED, SHARED, MIXED)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":""},{"line_number":280,"context_line":":xa"},{"line_number":281,"context_line":"class CPUThreadAllocationPolicy(BaseNovaEnum):"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    # prefer (default): The host may or may not have hyperthreads. This"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_958f1e2d","line":280,"range":{"start_line":280,"start_character":0,"end_line":280,"end_character":3},"updated":"2020-03-18 18:01:38.000000000","message":"whoops","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":277,"context_line":"    ALL \u003d (DEDICATED, SHARED, MIXED)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":""},{"line_number":280,"context_line":":xa"},{"line_number":281,"context_line":"class CPUThreadAllocationPolicy(BaseNovaEnum):"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    # prefer (default): The host may or may not have hyperthreads. This"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_d45fcfe2","line":280,"range":{"start_line":280,"start_character":0,"end_line":280,"end_character":3},"in_reply_to":"1fa4df85_958f1e2d","updated":"2020-03-19 11:30:49.000000000","message":"Done","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"}],"nova/objects/instance_numa.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        return list(map(set, zip(*[iter(cpu_list)] * threads)))"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    @property"},{"line_number":97,"context_line":"    def cpu_pinning_requested(self):"},{"line_number":98,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.DEDICATED,"},{"line_number":99,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    @property"},{"line_number":102,"context_line":"    def cpu_sharing_requested(self):"},{"line_number":103,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.SHARED,"},{"line_number":104,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def pin(self, vcpu, pcpu):"},{"line_number":107,"context_line":"        if vcpu not in self.cpuset:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_b5e6dae7","line":104,"range":{"start_line":96,"start_character":0,"end_line":104,"end_character":72},"updated":"2020-03-18 18:01:38.000000000","message":"As noted elsewhere, I think we should just remove these in favor of something like:\n\n  @property\n  def cpu_policy(self):\n      return self.cells[0].cpu_policy\n\nMight want to add a sanity check to make sure they\u0027re all the same since they should be.\n\nThe other option is to add a new \u0027cpu_policy\u0027 field to this object and deprecate the child one. Adding the field on the cell instead of the topology was a mistake that we could correct now. That\u0027s more work though","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        return list(map(set, zip(*[iter(cpu_list)] * threads)))"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    @property"},{"line_number":97,"context_line":"    def cpu_pinning_requested(self):"},{"line_number":98,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.DEDICATED,"},{"line_number":99,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    @property"},{"line_number":102,"context_line":"    def cpu_sharing_requested(self):"},{"line_number":103,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.SHARED,"},{"line_number":104,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def pin(self, vcpu, pcpu):"},{"line_number":107,"context_line":"        if vcpu not in self.cpuset:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_f439aba2","line":104,"range":{"start_line":96,"start_character":0,"end_line":104,"end_character":72},"in_reply_to":"1fa4df85_b5e6dae7","updated":"2020-03-19 11:30:49.000000000","message":"If we want to remove the existing \u0027cpu_pinning_requested\u0027 field, should I follow some steps, such as mark this field as \u0027deprecated\u0027 in U release and finally make it removed in next release. Or I just removed them directly.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"a6f84863853b1e37eeb395901726122d54887bea","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        return list(map(set, zip(*[iter(cpu_list)] * threads)))"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    @property"},{"line_number":97,"context_line":"    def cpu_pinning_requested(self):"},{"line_number":98,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.DEDICATED,"},{"line_number":99,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    @property"},{"line_number":102,"context_line":"    def cpu_sharing_requested(self):"},{"line_number":103,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.SHARED,"},{"line_number":104,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def pin(self, vcpu, pcpu):"},{"line_number":107,"context_line":"        if vcpu not in self.cpuset:"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_a41236b0","line":104,"range":{"start_line":96,"start_character":0,"end_line":104,"end_character":72},"in_reply_to":"1fa4df85_e24c889f","updated":"2020-03-23 13:12:42.000000000","message":"@stephen, I want to reopen this discussion. I understand and don\u0027t object the intention to remove the cpu_policy and the cpu_pinning_requeseted properties from instance NUMA cell object. But for adding the \u0027cpu_policy\u0027 property to instance NUMA topology object, I have some different opinion. \n\nBut after I tried to add the \u0027InstanceNUMATopology.cpu_policy\u0027 field to replace the \u0027cpu_pinning_requested\u0027, then everywhere that used the original \u0027cpu_pinning_requested\u0027 has to be changed with a bunch of \n\u0027if instance_topology.cpu_policy in (field.CPUAllocationPolicy.DEDICATED and field.CPUAllocationPolicy.MIXED) \u0027\n\nor \u0027if instance_topology.cpu_policy in (field.CPUAllocationPolicy.SHARED and field.CPUAllocationPolicy.MIXED) \u0027\n\nwhile using \u0027if instance_topology.cpu_pinning_requested\u0027\nor \u0027if instance_topology.cpu_sharing_requested\u0027 is more concise.\n\nThe meaning of \u0027cpu_pinning_requested\u0027 and \u0027cpu_sharing_requested\u0027 is also very clear to understand.\n\u0027cpu_pinning_requested\u0027 means if the instance requested any pinning CPU. and \u0027cpu_pinning_requested\u0027 refers to if instance requests any sharing CPUs.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"5607ecba0ecdfff4552f0d33f9371add6e7908bc","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        return list(map(set, zip(*[iter(cpu_list)] * threads)))"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    @property"},{"line_number":97,"context_line":"    def cpu_pinning_requested(self):"},{"line_number":98,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.DEDICATED,"},{"line_number":99,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    @property"},{"line_number":102,"context_line":"    def cpu_sharing_requested(self):"},{"line_number":103,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.SHARED,"},{"line_number":104,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def pin(self, vcpu, pcpu):"},{"line_number":107,"context_line":"        if vcpu not in self.cpuset:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_3a1ab3cb","line":104,"range":{"start_line":96,"start_character":0,"end_line":104,"end_character":72},"in_reply_to":"1fa4df85_e24c889f","updated":"2020-03-20 11:33:10.000000000","message":"Done","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1be8676b8a3e778b8c415e9916e9a6b8ffba276d","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        return list(map(set, zip(*[iter(cpu_list)] * threads)))"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    @property"},{"line_number":97,"context_line":"    def cpu_pinning_requested(self):"},{"line_number":98,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.DEDICATED,"},{"line_number":99,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    @property"},{"line_number":102,"context_line":"    def cpu_sharing_requested(self):"},{"line_number":103,"context_line":"        return self.cpu_policy in [obj_fields.CPUAllocationPolicy.SHARED,"},{"line_number":104,"context_line":"                                   obj_fields.CPUAllocationPolicy.MIXED]"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def pin(self, vcpu, pcpu):"},{"line_number":107,"context_line":"        if vcpu not in self.cpuset:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_e24c889f","line":104,"range":{"start_line":96,"start_character":0,"end_line":104,"end_character":72},"in_reply_to":"1fa4df85_f439aba2","updated":"2020-03-19 14:18:47.000000000","message":"This doesn\u0027t get transferred over the wire so you can just remove it outright here","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"}],"nova/scheduler/utils.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        # We don\u0027t need to worry about handling \u0027SHARED\u0027 - that will result in"},{"line_number":270,"context_line":"        # VCPUs which we include by default"},{"line_number":271,"context_line":"        if cpu_policy in [obj_fields.CPUAllocationPolicy.DEDICATED,"},{"line_number":272,"context_line":"                          obj_fields.CPUAllocationPolicy.MIXED]:"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"            if cpu_policy is obj_fields.CPUAllocationPolicy.MIXED:"},{"line_number":275,"context_line":"                cpus \u003d len(hardware.get_pinned_cpu_constraint(flavor))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_f578d2f8","line":272,"updated":"2020-03-18 18:01:38.000000000","message":"nit: wrapping:\n\n  if cpu_policy in (\n      obj_fields.CPUAllocationPolicy.DEDICATED,\n      obj_fields.CPUAllocationPolicy.MIXED,\n  ):\n\n?","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":272,"context_line":"                          obj_fields.CPUAllocationPolicy.MIXED]:"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"            if cpu_policy is obj_fields.CPUAllocationPolicy.MIXED:"},{"line_number":275,"context_line":"                cpus \u003d len(hardware.get_pinned_cpu_constraint(flavor))"},{"line_number":276,"context_line":"                # \u0027mixed\u0027 instance also requests some VCPU resource"},{"line_number":277,"context_line":"                self._add_resource(None, orc.VCPU, flavor.vcpus - cpus)"},{"line_number":278,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_551c46c0","line":275,"updated":"2020-03-18 18:01:38.000000000","message":"It took me a while to figure out why you weren\u0027t setting \u0027cpu_pinning_requested\u0027 here, even though I wrote the code /o\\ I understand now that it\u0027s because that would trigger a fallback that translates for PCPU-\u003eVCPU resources to handle hosts that don\u0027t have \u0027cpu_dedicated_set\u0027 or \u0027cpu_shared_set\u0027 configured. We clearly don\u0027t want that here so this is the correct thing to do.\n\nWith that said, could we add a note saying why we do the translation below. It would also be good to rename the \u0027cpu_pinning_requested\u0027 variable to something else. Perhaps \u0027use_fallback_pcpu_query\u0027? That should be a separate commit but it would make this much easier to understand","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4f1565c827f072db43c657edc9fc8d2d432a2b89","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        if cpu_policy in (obj_fields.CPUAllocationPolicy.DEDICATED,"},{"line_number":272,"context_line":"                          obj_fields.CPUAllocationPolicy.MIXED):"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"            if cpu_policy is obj_fields.CPUAllocationPolicy.MIXED:"},{"line_number":275,"context_line":"                cpus \u003d len(hardware.get_dedicated_cpu_constraint(flavor,"},{"line_number":276,"context_line":"                                                                 image))"},{"line_number":277,"context_line":"                # \u0027mixed\u0027 instance also requests some VCPU resource"}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_cba80f21","line":274,"range":{"start_line":274,"start_character":26,"end_line":274,"end_character":28},"updated":"2020-03-24 17:07:00.000000000","message":"\u003d\u003d (\u0027is\u0027 is to compare types)","commit_id":"bd89162b336eaab228dc5c374f308410a5e77904"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":13292,"context_line":"        image \u003d {\u0027id\u0027: uuids.image_id, \u0027status\u0027: \u0027active\u0027}"},{"line_number":13293,"context_line":"        for v in obj_fields.CPUAllocationPolicy.ALL:"},{"line_number":13294,"context_line":"            image[\u0027properties\u0027] \u003d {\u0027hw_cpu_policy\u0027: v}"},{"line_number":13295,"context_line":"            # \u0027mixed\u0027 CPU policy requires a valid\u0027hw:cpu_pinning\u0027 defined"},{"line_number":13296,"context_line":"            if v \u003d\u003d obj_fields.CPUAllocationPolicy.MIXED:"},{"line_number":13297,"context_line":"                self.assertRaises(exception.PinnedCPUNotFoundOrInvalid,"},{"line_number":13298,"context_line":"                                 self.compute_api._validate_flavor_image,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_d58596d0","line":13295,"range":{"start_line":13295,"start_character":48,"end_line":13295,"end_character":49},"updated":"2020-03-18 18:01:38.000000000","message":"nit: space after this","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":13292,"context_line":"        image \u003d {\u0027id\u0027: uuids.image_id, \u0027status\u0027: \u0027active\u0027}"},{"line_number":13293,"context_line":"        for v in obj_fields.CPUAllocationPolicy.ALL:"},{"line_number":13294,"context_line":"            image[\u0027properties\u0027] \u003d {\u0027hw_cpu_policy\u0027: v}"},{"line_number":13295,"context_line":"            # \u0027mixed\u0027 CPU policy requires a valid\u0027hw:cpu_pinning\u0027 defined"},{"line_number":13296,"context_line":"            if v \u003d\u003d obj_fields.CPUAllocationPolicy.MIXED:"},{"line_number":13297,"context_line":"                self.assertRaises(exception.PinnedCPUNotFoundOrInvalid,"},{"line_number":13298,"context_line":"                                 self.compute_api._validate_flavor_image,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_b45c93ed","line":13295,"range":{"start_line":13295,"start_character":48,"end_line":13295,"end_character":49},"in_reply_to":"1fa4df85_d58596d0","updated":"2020-03-19 11:30:49.000000000","message":"Done","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":13298,"context_line":"                                 self.compute_api._validate_flavor_image,"},{"line_number":13299,"context_line":"                                 self.context, image[\u0027id\u0027], image,"},{"line_number":13300,"context_line":"                                 self.instance_type, None)"},{"line_number":13301,"context_line":"                continue"},{"line_number":13302,"context_line":"            self.compute_api._validate_flavor_image("},{"line_number":13303,"context_line":"                self.context, image[\u0027id\u0027], image, self.instance_type, None)"},{"line_number":13304,"context_line":"        image[\u0027properties\u0027] \u003d {\u0027hw_cpu_policy\u0027: \u0027bar\u0027}"},{"line_number":13305,"context_line":"        self.assertRaises(exception.InvalidRequest,"},{"line_number":13306,"context_line":"                          self.compute_api._validate_flavor_image,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_35766a08","line":13303,"range":{"start_line":13301,"start_character":0,"end_line":13303,"end_character":75},"updated":"2020-03-18 18:01:38.000000000","message":"This is a case where a clear if-else would be better, IMO:\n\n  else:\n      self.compute_api._validate_flavor_image(\n          self.context, image[\u0027id\u0027], image, self.instance_type, None,\n      )","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":13298,"context_line":"                                 self.compute_api._validate_flavor_image,"},{"line_number":13299,"context_line":"                                 self.context, image[\u0027id\u0027], image,"},{"line_number":13300,"context_line":"                                 self.instance_type, None)"},{"line_number":13301,"context_line":"                continue"},{"line_number":13302,"context_line":"            self.compute_api._validate_flavor_image("},{"line_number":13303,"context_line":"                self.context, image[\u0027id\u0027], image, self.instance_type, None)"},{"line_number":13304,"context_line":"        image[\u0027properties\u0027] \u003d {\u0027hw_cpu_policy\u0027: \u0027bar\u0027}"},{"line_number":13305,"context_line":"        self.assertRaises(exception.InvalidRequest,"},{"line_number":13306,"context_line":"                          self.compute_api._validate_flavor_image,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_146d6797","line":13303,"range":{"start_line":13301,"start_character":0,"end_line":13303,"end_character":75},"in_reply_to":"1fa4df85_35766a08","updated":"2020-03-19 11:30:49.000000000","message":"Agree.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"}],"nova/tests/unit/objects/test_objects.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4d8e4b600ada93e252658fbddac97a309c81d43","unresolved":false,"context_lines":[{"line_number":1064,"context_line":"    \u0027HyperVLiveMigrateData\u0027: \u00271.4-e265780e6acfa631476c8170e8d6fce0\u0027,"},{"line_number":1065,"context_line":"    \u0027IDEDeviceBus\u0027: \u00271.0-29d4c9f27ac44197f01b6ac1b7e16502\u0027,"},{"line_number":1066,"context_line":"    \u0027ImageMeta\u0027: \u00271.8-642d1b2eb3e880a367f37d72dd76162d\u0027,"},{"line_number":1067,"context_line":"    \u0027ImageMetaProps\u0027: \u00271.25-b9f136cd10a2b5ffb3ae44332f2f687d\u0027,"},{"line_number":1068,"context_line":"    \u0027Instance\u0027: \u00272.7-d187aec68cad2e4d8b8a03a68e4739ce\u0027,"},{"line_number":1069,"context_line":"    \u0027InstanceAction\u0027: \u00271.2-9a5abc87fdd3af46f45731960651efb5\u0027,"},{"line_number":1070,"context_line":"    \u0027InstanceActionEvent\u0027: \u00271.3-c749e1b3589e7117c81cb2aa6ac438d5\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_da13c0b7","line":1067,"updated":"2020-03-24 14:07:27.000000000","message":"This is NEVER okay. See comments about the field change.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"b02c95d5387e59c20f81f58547178725636de809","unresolved":false,"context_lines":[{"line_number":1064,"context_line":"    \u0027HyperVLiveMigrateData\u0027: \u00271.4-e265780e6acfa631476c8170e8d6fce0\u0027,"},{"line_number":1065,"context_line":"    \u0027IDEDeviceBus\u0027: \u00271.0-29d4c9f27ac44197f01b6ac1b7e16502\u0027,"},{"line_number":1066,"context_line":"    \u0027ImageMeta\u0027: \u00271.8-642d1b2eb3e880a367f37d72dd76162d\u0027,"},{"line_number":1067,"context_line":"    \u0027ImageMetaProps\u0027: \u00271.25-b9f136cd10a2b5ffb3ae44332f2f687d\u0027,"},{"line_number":1068,"context_line":"    \u0027Instance\u0027: \u00272.7-d187aec68cad2e4d8b8a03a68e4739ce\u0027,"},{"line_number":1069,"context_line":"    \u0027InstanceAction\u0027: \u00271.2-9a5abc87fdd3af46f45731960651efb5\u0027,"},{"line_number":1070,"context_line":"    \u0027InstanceActionEvent\u0027: \u00271.3-c749e1b3589e7117c81cb2aa6ac438d5\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_6dd90e82","line":1067,"in_reply_to":"df33271e_da13c0b7","updated":"2020-03-25 05:08:32.000000000","message":"ImageMetaProp used \u0027CPUAllocationPolicy\u0027 type object as a filed, I need to bump the object version of \u0027ImageMetaProp\u0027,\n\nBut after the above change, I still need to change this MD5 code accordingly, right?","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4d8e4b600ada93e252658fbddac97a309c81d43","unresolved":false,"context_lines":[{"line_number":1080,"context_line":"    \u0027InstanceList\u0027: \u00272.6-238f125650c25d6d12722340d726f723\u0027,"},{"line_number":1081,"context_line":"    \u0027InstanceMapping\u0027: \u00271.2-3bd375e65c8eb9c45498d2f87b882e03\u0027,"},{"line_number":1082,"context_line":"    \u0027InstanceMappingList\u0027: \u00271.3-d34b6ebb076d542ae0f8b440534118da\u0027,"},{"line_number":1083,"context_line":"    \u0027InstanceNUMACell\u0027: \u00271.4-ef61bb1c916ec856e02be67aea2b1989\u0027,"},{"line_number":1084,"context_line":"    \u0027InstanceNUMATopology\u0027: \u00271.3-ec0030cb0402a49c96da7051c037082a\u0027,"},{"line_number":1085,"context_line":"    \u0027InstancePCIRequest\u0027: \u00271.3-f6d324f1c337fad4f34892ed5f484c9a\u0027,"},{"line_number":1086,"context_line":"    \u0027InstancePCIRequests\u0027: \u00271.1-65e38083177726d806684cb1cc0136d2\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_ba187cd3","line":1083,"updated":"2020-03-24 14:07:27.000000000","message":"Same here.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"b02c95d5387e59c20f81f58547178725636de809","unresolved":false,"context_lines":[{"line_number":1080,"context_line":"    \u0027InstanceList\u0027: \u00272.6-238f125650c25d6d12722340d726f723\u0027,"},{"line_number":1081,"context_line":"    \u0027InstanceMapping\u0027: \u00271.2-3bd375e65c8eb9c45498d2f87b882e03\u0027,"},{"line_number":1082,"context_line":"    \u0027InstanceMappingList\u0027: \u00271.3-d34b6ebb076d542ae0f8b440534118da\u0027,"},{"line_number":1083,"context_line":"    \u0027InstanceNUMACell\u0027: \u00271.4-ef61bb1c916ec856e02be67aea2b1989\u0027,"},{"line_number":1084,"context_line":"    \u0027InstanceNUMATopology\u0027: \u00271.3-ec0030cb0402a49c96da7051c037082a\u0027,"},{"line_number":1085,"context_line":"    \u0027InstancePCIRequest\u0027: \u00271.3-f6d324f1c337fad4f34892ed5f484c9a\u0027,"},{"line_number":1086,"context_line":"    \u0027InstancePCIRequests\u0027: \u00271.1-65e38083177726d806684cb1cc0136d2\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_cde65a45","line":1083,"in_reply_to":"df33271e_ba187cd3","updated":"2020-03-25 05:08:32.000000000","message":"Same understanding as above. Need your confirm.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"}],"nova/virt/hardware.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":1129,"context_line":"    req_dedicated_cpus \u003d 0"},{"line_number":1130,"context_line":"    req_shared_cpus \u003d 0"},{"line_number":1131,"context_line":"    rsv_dedicated_cpus \u003d 0"},{"line_number":1132,"context_line":"    rsv_shared_cpus \u003d 0"},{"line_number":1133,"context_line":"    if instance_cell.cpu_policy \u003d\u003d fields.CPUAllocationPolicy.DEDICATED:"},{"line_number":1134,"context_line":"        req_dedicated_cpus \u003d len(instance_cell.cpuset)"},{"line_number":1135,"context_line":"        rsv_dedicated_cpus \u003d cpuset_reserved"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_f5ef7284","line":1132,"updated":"2020-03-18 18:01:38.000000000","message":"I\u0027ve confused both of us here due to [1]. There\u0027s no such thing as a reserved shared CPU. The only time reserved CPUs will be populated is if the \u0027isolate\u0027 emulator thread policy is in effect, and it\u0027s not possible to use that unless you\u0027ve also got a \u0027dedicated\u0027 CPU policy (there\u0027s a check in this file). As such, you can drop this...\n\n[1] https://review.opendev.org/#/c/713354/1/nova/virt/hardware.py@a1143","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":1129,"context_line":"    req_dedicated_cpus \u003d 0"},{"line_number":1130,"context_line":"    req_shared_cpus \u003d 0"},{"line_number":1131,"context_line":"    rsv_dedicated_cpus \u003d 0"},{"line_number":1132,"context_line":"    rsv_shared_cpus \u003d 0"},{"line_number":1133,"context_line":"    if instance_cell.cpu_policy \u003d\u003d fields.CPUAllocationPolicy.DEDICATED:"},{"line_number":1134,"context_line":"        req_dedicated_cpus \u003d len(instance_cell.cpuset)"},{"line_number":1135,"context_line":"        rsv_dedicated_cpus \u003d cpuset_reserved"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_7555c24f","line":1132,"range":{"start_line":1132,"start_character":0,"end_line":1132,"end_character":23},"updated":"2020-03-18 18:01:38.000000000","message":"I\u0027ve confused both of us here.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":1129,"context_line":"    req_dedicated_cpus \u003d 0"},{"line_number":1130,"context_line":"    req_shared_cpus \u003d 0"},{"line_number":1131,"context_line":"    rsv_dedicated_cpus \u003d 0"},{"line_number":1132,"context_line":"    rsv_shared_cpus \u003d 0"},{"line_number":1133,"context_line":"    if instance_cell.cpu_policy \u003d\u003d fields.CPUAllocationPolicy.DEDICATED:"},{"line_number":1134,"context_line":"        req_dedicated_cpus \u003d len(instance_cell.cpuset)"},{"line_number":1135,"context_line":"        rsv_dedicated_cpus \u003d cpuset_reserved"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_34fd03b1","line":1132,"range":{"start_line":1132,"start_character":0,"end_line":1132,"end_character":23},"in_reply_to":"1fa4df85_7555c24f","updated":"2020-03-19 11:30:49.000000000","message":"Replied in your following comment.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":1129,"context_line":"    req_dedicated_cpus \u003d 0"},{"line_number":1130,"context_line":"    req_shared_cpus \u003d 0"},{"line_number":1131,"context_line":"    rsv_dedicated_cpus \u003d 0"},{"line_number":1132,"context_line":"    rsv_shared_cpus \u003d 0"},{"line_number":1133,"context_line":"    if instance_cell.cpu_policy \u003d\u003d fields.CPUAllocationPolicy.DEDICATED:"},{"line_number":1134,"context_line":"        req_dedicated_cpus \u003d len(instance_cell.cpuset)"},{"line_number":1135,"context_line":"        rsv_dedicated_cpus \u003d cpuset_reserved"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_341663f3","line":1132,"in_reply_to":"1fa4df85_f5ef7284","updated":"2020-03-19 11:30:49.000000000","message":"I am not sure if the \u0027shared\u0027 instance would have \u0027reserved\u0027 CPUs, now I got your confirmative answer.\n\nI\u0027ll remove rev_shared_cpus.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"                  })"},{"line_number":1154,"context_line":"        return"},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"    if req_shared_cpus + rsv_shared_cpus\u003e len(host_cell.cpuset):"},{"line_number":1157,"context_line":"        LOG.debug(\u0027Not enough host cell CPUs to fit instance cell; \u0027"},{"line_number":1158,"context_line":"                  \u0027required: %(required)d + %(reserved)d as overhead, \u0027"},{"line_number":1159,"context_line":"                  \u0027actual: %(actual)d\u0027, {"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_d5ecb690","line":1156,"range":{"start_line":1156,"start_character":23,"end_line":1156,"end_character":40},"updated":"2020-03-18 18:01:38.000000000","message":"..and this...","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"                  })"},{"line_number":1154,"context_line":"        return"},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"    if req_shared_cpus + rsv_shared_cpus\u003e len(host_cell.cpuset):"},{"line_number":1157,"context_line":"        LOG.debug(\u0027Not enough host cell CPUs to fit instance cell; \u0027"},{"line_number":1158,"context_line":"                  \u0027required: %(required)d + %(reserved)d as overhead, \u0027"},{"line_number":1159,"context_line":"                  \u0027actual: %(actual)d\u0027, {"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_d4d26f34","line":1156,"range":{"start_line":1156,"start_character":23,"end_line":1156,"end_character":40},"in_reply_to":"1fa4df85_d5ecb690","updated":"2020-03-19 11:30:49.000000000","message":"Done","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"    if req_shared_cpus + rsv_shared_cpus\u003e len(host_cell.cpuset):"},{"line_number":1157,"context_line":"        LOG.debug(\u0027Not enough host cell CPUs to fit instance cell; \u0027"},{"line_number":1158,"context_line":"                  \u0027required: %(required)d + %(reserved)d as overhead, \u0027"},{"line_number":1159,"context_line":"                  \u0027actual: %(actual)d\u0027, {"},{"line_number":1160,"context_line":"                      \u0027required\u0027: req_shared_cpus,"},{"line_number":1161,"context_line":"                      \u0027actual\u0027: len(host_cell.cpuset),"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_55f8c647","line":1158,"range":{"start_line":1158,"start_character":41,"end_line":1158,"end_character":56},"updated":"2020-03-18 18:01:38.000000000","message":"...and this. In fact, this cleanup would make a good separate patch.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"    if req_shared_cpus + rsv_shared_cpus\u003e len(host_cell.cpuset):"},{"line_number":1157,"context_line":"        LOG.debug(\u0027Not enough host cell CPUs to fit instance cell; \u0027"},{"line_number":1158,"context_line":"                  \u0027required: %(required)d + %(reserved)d as overhead, \u0027"},{"line_number":1159,"context_line":"                  \u0027actual: %(actual)d\u0027, {"},{"line_number":1160,"context_line":"                      \u0027required\u0027: req_shared_cpus,"},{"line_number":1161,"context_line":"                      \u0027actual\u0027: len(host_cell.cpuset),"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_f4d52b1c","line":1158,"range":{"start_line":1158,"start_character":41,"end_line":1158,"end_character":56},"in_reply_to":"1fa4df85_55f8c647","updated":"2020-03-19 11:30:49.000000000","message":"Let me make it separate.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":1700,"context_line":""},{"line_number":1701,"context_line":""},{"line_number":1702,"context_line":"def get_pinned_cpu_constraint(flavor):"},{"line_number":1703,"context_line":"    # type: (objects.Flavor) -\u003e cpuset"},{"line_number":1704,"context_line":"    pinned_cpus \u003d flavor.get(\u0027extra_specs\u0027, {}).get(\u0027hw:pinned_cpus\u0027)"},{"line_number":1705,"context_line":"    if not pinned_cpus:"},{"line_number":1706,"context_line":"        raise exception.PinnedCPUNotFoundOrInvalid()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_15c1eee4","line":1703,"range":{"start_line":1703,"start_character":0,"end_line":1703,"end_character":38},"updated":"2020-03-18 18:01:38.000000000","message":"You can use real type annotations now, since this is Python 3 only code. I think it would be:\n\n  def get_pinned_cpu_constraint(\n      flavor: \u0027objects.Flavor\u0027,\n  ) -\u003e ty.Set[int]:\n\ni.e. flavor is of type \u0027objects.Flavor\u0027 (you need the quotes to delay interpretation) and it returns a set of ints. You\u0027ll also need to add this import at the top of the file:\n\n  import typing as ty","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":1700,"context_line":""},{"line_number":1701,"context_line":""},{"line_number":1702,"context_line":"def get_pinned_cpu_constraint(flavor):"},{"line_number":1703,"context_line":"    # type: (objects.Flavor) -\u003e cpuset"},{"line_number":1704,"context_line":"    pinned_cpus \u003d flavor.get(\u0027extra_specs\u0027, {}).get(\u0027hw:pinned_cpus\u0027)"},{"line_number":1705,"context_line":"    if not pinned_cpus:"},{"line_number":1706,"context_line":"        raise exception.PinnedCPUNotFoundOrInvalid()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_5488bfc4","line":1703,"range":{"start_line":1703,"start_character":0,"end_line":1703,"end_character":38},"in_reply_to":"1fa4df85_15c1eee4","updated":"2020-03-19 11:30:49.000000000","message":"Done","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":1717,"context_line":""},{"line_number":1718,"context_line":"def numa_set_pinned_cpu(numa_topology, cpuset_pinned):"},{"line_number":1719,"context_line":"    for cell in numa_topology.cells:"},{"line_number":1720,"context_line":"        cpuset \u003d cpuset_pinned \u0026 cell.cpuset"},{"line_number":1721,"context_line":"        # \u0027InstanceNUMACell.cpu_pinning\u0027 is a dictionary holding the instance"},{"line_number":1722,"context_line":"        # CPU pinning information, with instance CPU in key and host CPU in"},{"line_number":1723,"context_line":"        # value, after nova-scheduler make the choice of running which instance"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_d5483688","line":1720,"range":{"start_line":1720,"start_character":17,"end_line":1720,"end_character":44},"updated":"2020-03-18 18:01:38.000000000","message":"this would make more sense reversed","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1be8676b8a3e778b8c415e9916e9a6b8ffba276d","unresolved":false,"context_lines":[{"line_number":1717,"context_line":""},{"line_number":1718,"context_line":"def numa_set_pinned_cpu(numa_topology, cpuset_pinned):"},{"line_number":1719,"context_line":"    for cell in numa_topology.cells:"},{"line_number":1720,"context_line":"        cpuset \u003d cpuset_pinned \u0026 cell.cpuset"},{"line_number":1721,"context_line":"        # \u0027InstanceNUMACell.cpu_pinning\u0027 is a dictionary holding the instance"},{"line_number":1722,"context_line":"        # CPU pinning information, with instance CPU in key and host CPU in"},{"line_number":1723,"context_line":"        # value, after nova-scheduler make the choice of running which instance"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_ed2eb941","line":1720,"range":{"start_line":1720,"start_character":17,"end_line":1720,"end_character":44},"in_reply_to":"1fa4df85_14ab271d","updated":"2020-03-19 14:18:47.000000000","message":"correct","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":1717,"context_line":""},{"line_number":1718,"context_line":"def numa_set_pinned_cpu(numa_topology, cpuset_pinned):"},{"line_number":1719,"context_line":"    for cell in numa_topology.cells:"},{"line_number":1720,"context_line":"        cpuset \u003d cpuset_pinned \u0026 cell.cpuset"},{"line_number":1721,"context_line":"        # \u0027InstanceNUMACell.cpu_pinning\u0027 is a dictionary holding the instance"},{"line_number":1722,"context_line":"        # CPU pinning information, with instance CPU in key and host CPU in"},{"line_number":1723,"context_line":"        # value, after nova-scheduler make the choice of running which instance"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_14ab271d","line":1720,"range":{"start_line":1720,"start_character":17,"end_line":1720,"end_character":44},"in_reply_to":"1fa4df85_d5483688","updated":"2020-03-19 11:30:49.000000000","message":"I think you mean\ncpuset \u003d cell.cpuset \u0026 cpuset_pinned","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":1718,"context_line":"def numa_set_pinned_cpu(numa_topology, cpuset_pinned):"},{"line_number":1719,"context_line":"    for cell in numa_topology.cells:"},{"line_number":1720,"context_line":"        cpuset \u003d cpuset_pinned \u0026 cell.cpuset"},{"line_number":1721,"context_line":"        # \u0027InstanceNUMACell.cpu_pinning\u0027 is a dictionary holding the instance"},{"line_number":1722,"context_line":"        # CPU pinning information, with instance CPU in key and host CPU in"},{"line_number":1723,"context_line":"        # value, after nova-scheduler make the choice of running which instance"},{"line_number":1724,"context_line":"        # on which host. Here the host CPU is initialized with a value \u0027-1\u0027,"},{"line_number":1725,"context_line":"        # which means no host CPU is determined for purpose of being occupied"},{"line_number":1726,"context_line":"        # exclusively with the instance CPU."},{"line_number":1727,"context_line":"        if cpuset:"},{"line_number":1728,"context_line":"            cpu_pinning \u003d {cpu: -1 for cpu in cpuset}"},{"line_number":1729,"context_line":"            cell.cpu_pinning \u003d cpu_pinning"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_95715ee1","line":1726,"range":{"start_line":1721,"start_character":0,"end_line":1726,"end_character":44},"updated":"2020-03-18 18:01:38.000000000","message":"Called it! I said in an earlier patch that you were probably setting this to -1 and I was correct :) My same question of whether we\u0027d be better off adding a new \u0027pcpuset\u0027 property still stands (reply on the other path)","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":1718,"context_line":"def numa_set_pinned_cpu(numa_topology, cpuset_pinned):"},{"line_number":1719,"context_line":"    for cell in numa_topology.cells:"},{"line_number":1720,"context_line":"        cpuset \u003d cpuset_pinned \u0026 cell.cpuset"},{"line_number":1721,"context_line":"        # \u0027InstanceNUMACell.cpu_pinning\u0027 is a dictionary holding the instance"},{"line_number":1722,"context_line":"        # CPU pinning information, with instance CPU in key and host CPU in"},{"line_number":1723,"context_line":"        # value, after nova-scheduler make the choice of running which instance"},{"line_number":1724,"context_line":"        # on which host. Here the host CPU is initialized with a value \u0027-1\u0027,"},{"line_number":1725,"context_line":"        # which means no host CPU is determined for purpose of being occupied"},{"line_number":1726,"context_line":"        # exclusively with the instance CPU."},{"line_number":1727,"context_line":"        if cpuset:"},{"line_number":1728,"context_line":"            cpu_pinning \u003d {cpu: -1 for cpu in cpuset}"},{"line_number":1729,"context_line":"            cell.cpu_pinning \u003d cpu_pinning"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_f4c0cbe2","line":1726,"range":{"start_line":1721,"start_character":0,"end_line":1726,"end_character":44},"in_reply_to":"1fa4df85_95715ee1","updated":"2020-03-19 11:30:49.000000000","message":"I am working on researching the work for the \u0027pcpuset\u0027 approach.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":1984,"context_line":"        # A realtime CPU must be a dedicated CPU which will be pinned on host CPUs"},{"line_number":1985,"context_line":"        if is_realtime_enabled(flavor):"},{"line_number":1986,"context_line":"            rt_cpus \u003d vcpus_realtime_topology(flavor, image_meta)"},{"line_number":1987,"context_line":"            if not rt_cpus.issubset(cpuset_pinned):"},{"line_number":1988,"context_line":"                raise exception.RealtimeCPUNotInPinningCPUList("},{"line_number":1989,"context_line":"                    rt_cpus\u003drt_cpus,"},{"line_number":1990,"context_line":"                    pinned_cpus\u003dcpuset_pinned)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_352e6aa5","line":1987,"range":{"start_line":1987,"start_character":0,"end_line":1987,"end_character":51},"updated":"2020-03-18 18:01:38.000000000","message":"I had this disussion with sean-k-mooney Monday. If a user is using realtime, is there any reason to support three types of CPU: realtime+dedicated, non-realtime+dedicated, and non-realtime+shared? I was thinking perhaps we could say you only need to set \u0027cpu_realtime_mask\u0027 in that case and we\u0027d treat it as an alias of \u0027pinned_cpus\u0027. Thoughts?","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"5607ecba0ecdfff4552f0d33f9371add6e7908bc","unresolved":false,"context_lines":[{"line_number":1984,"context_line":"        # A realtime CPU must be a dedicated CPU which will be pinned on host CPUs"},{"line_number":1985,"context_line":"        if is_realtime_enabled(flavor):"},{"line_number":1986,"context_line":"            rt_cpus \u003d vcpus_realtime_topology(flavor, image_meta)"},{"line_number":1987,"context_line":"            if not rt_cpus.issubset(cpuset_pinned):"},{"line_number":1988,"context_line":"                raise exception.RealtimeCPUNotInPinningCPUList("},{"line_number":1989,"context_line":"                    rt_cpus\u003drt_cpus,"},{"line_number":1990,"context_line":"                    pinned_cpus\u003dcpuset_pinned)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_39d96556","line":1987,"range":{"start_line":1987,"start_character":0,"end_line":1987,"end_character":51},"in_reply_to":"1fa4df85_2da9317b","updated":"2020-03-20 11:33:10.000000000","message":"\u003e \u003e So, for a user using realtime, here, for a mixed instance, it\n \u003e \u003e presents two types of CPU: realtime+dedicated+shared,\n \u003e \u003e realtime+shared.\n \u003e \n \u003e What do you mean realtime+dedicated+shared and realtime+shared?\n \u003e Shared/floating CPUs can\u0027t be realtime. I\u0027m saying for mixed\n \u003e instances without realtime, there are two types of CPU - shared and\n \u003e dedicated - and for mixed instances with realtime there should\n \u003e still only be two types of CPU - shared and dedicated+realtime.\n \u003e Does that make sense?\n \u003e \n\n \u003e realtime+shared isn\u0027t a thing. We don\u0027t allow it and I don\u0027t think\n \u003e we want to (it doesn\u0027t make sense - how can you guarantee real-time\n \u003e characteristics from an unpinned process?). This is forbidden for\n \u003e \u0027shared\u0027 instances [1] and we should forbid it for \u0027shared\u0027 CPUs of\n \u003e \u0027mixed\u0027 instances.\n \u003e \n\nNow I understand you now. Actually we are on same page.\n\nI\u0027d like to let a realtime and mixed policy instance have two types CPUs, the \u0027shared\u0027 and the realtime(also dedicated) ones.\n\nThat could be done by what you suggested.\n\n\n\n \u003e On that note, how about we use \u0027cpu_dedicated_mask\u0027 instead of\n \u003e \u0027pinned_cpus\u0027? Seems similar to the existing extra spec.\n\nHow about using \u0027dedicated_cpus\u0027 to take place \u0027pinned_cpus\u0027?  The name of \u0027cpu_dedicated_mask\u0027 is close to \u0027cpu_realtime_mask\u0027, I really don\u0027t want user to think it might follow the usage of \u0027cpu_realtime_mask\u0027. I hope we can specify the dedicated cpu in a way such as \u0027dedicatd_cpus\u003d1,2,4-10,^4\u0027. \u0027cpu_realtime_mask\u0027 only accepts a string starting with \u0027^\u0027, such as \u0027cpu_realtime_cpu\u003d^0-1\u0027.\n\nAnother thing, if we decided to changes the name of \u0027pinned_cpus\u0027 to something else, should we make a commit as a update for our spec? because we said in that spec, we planned to the term \u0027pinned_cpus\u0027 for dedicated cpu list.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":1984,"context_line":"        # A realtime CPU must be a dedicated CPU which will be pinned on host CPUs"},{"line_number":1985,"context_line":"        if is_realtime_enabled(flavor):"},{"line_number":1986,"context_line":"            rt_cpus \u003d vcpus_realtime_topology(flavor, image_meta)"},{"line_number":1987,"context_line":"            if not rt_cpus.issubset(cpuset_pinned):"},{"line_number":1988,"context_line":"                raise exception.RealtimeCPUNotInPinningCPUList("},{"line_number":1989,"context_line":"                    rt_cpus\u003drt_cpus,"},{"line_number":1990,"context_line":"                    pinned_cpus\u003dcpuset_pinned)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_f6652eb6","line":1987,"range":{"start_line":1987,"start_character":0,"end_line":1987,"end_character":51},"in_reply_to":"1fa4df85_352e6aa5","updated":"2020-03-19 11:30:49.000000000","message":"\u003e I had this disussion with sean-k-mooney Monday. If a user is using\n \u003e realtime, is there any reason to support three types of CPU:\n \u003e realtime+dedicated, non-realtime+dedicated, and non-realtime+shared?\n\nI probably not keep up with your thought well. I suppose a mixed policy instance must contain some dedicated CPU and some shared CPU, you cannot say a mixed instance has no dedicated CPU or shared CPU.\nSo, for a user using realtime, here, for a mixed instance, it presents two types of CPU: realtime+dedicated+shared, realtime+shared. \n\n \u003e I was thinking perhaps we could say you only need to set\n \u003e \u0027cpu_realtime_mask\u0027 in that case and we\u0027d treat it as an alias of\n \u003e \u0027pinned_cpus\u0027. Thoughts?\n\nIf we make \u0027pinned_cpus\u0027 as an alias of \u0027cpu_realtime_mask\u0027 for a mixed instance when \u0027cpu_realtime_mask\u0027 exists, that means we only support the \u0027realtime+shared\u0027 CPU type for a realtime instance use case, because all dedicated CPUs are realtime CPUs.\n\nActually I don\u0027t know any of the scenario which uses some realtime virtual CPUs for guaranteed latency, and some exclusively used host CPUs for, maybe, high speed, and some shared CPUs for increasing VM density. \nI do see some scenario for demanding shared CPUs and dedicated CPUs, or demanding the shared CPUs and realtime CPUs. Such as voice processing, and network package processing.\n\nI am good to take \u0027pinned_cpus\u0027 as an alias of \u0027cpu_realtime_mask\u0027 and take value from it for realtime use case.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1be8676b8a3e778b8c415e9916e9a6b8ffba276d","unresolved":false,"context_lines":[{"line_number":1984,"context_line":"        # A realtime CPU must be a dedicated CPU which will be pinned on host CPUs"},{"line_number":1985,"context_line":"        if is_realtime_enabled(flavor):"},{"line_number":1986,"context_line":"            rt_cpus \u003d vcpus_realtime_topology(flavor, image_meta)"},{"line_number":1987,"context_line":"            if not rt_cpus.issubset(cpuset_pinned):"},{"line_number":1988,"context_line":"                raise exception.RealtimeCPUNotInPinningCPUList("},{"line_number":1989,"context_line":"                    rt_cpus\u003drt_cpus,"},{"line_number":1990,"context_line":"                    pinned_cpus\u003dcpuset_pinned)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_2da9317b","line":1987,"range":{"start_line":1987,"start_character":0,"end_line":1987,"end_character":51},"in_reply_to":"1fa4df85_f6652eb6","updated":"2020-03-19 14:18:47.000000000","message":"\u003e \u003e I had this disussion with sean-k-mooney Monday. If a user is\n \u003e using\n \u003e \u003e realtime, is there any reason to support three types of CPU:\n \u003e \u003e realtime+dedicated, non-realtime+dedicated, and non-realtime+shared?\n \u003e \n \u003e I probably not keep up with your thought well. I suppose a mixed\n \u003e policy instance must contain some dedicated CPU and some shared\n \u003e CPU, you cannot say a mixed instance has no dedicated CPU or shared\n \u003e CPU.\n\nCorrect.\n\n \u003e So, for a user using realtime, here, for a mixed instance, it\n \u003e presents two types of CPU: realtime+dedicated+shared,\n \u003e realtime+shared.\n\nWhat do you mean realtime+dedicated+shared and realtime+shared? Shared/floating CPUs can\u0027t be realtime. I\u0027m saying for mixed instances without realtime, there are two types of CPU - shared and dedicated - and for mixed instances with realtime there should still only be two types of CPU - shared and dedicated+realtime. Does that make sense?\n\n\n \u003e \u003e I was thinking perhaps we could say you only need to set\n \u003e \u003e \u0027cpu_realtime_mask\u0027 in that case and we\u0027d treat it as an alias of\n \u003e \u003e \u0027pinned_cpus\u0027. Thoughts?\n \u003e \n \u003e If we make \u0027pinned_cpus\u0027 as an alias of \u0027cpu_realtime_mask\u0027 for a\n \u003e mixed instance when \u0027cpu_realtime_mask\u0027 exists, that means we only\n \u003e support the \u0027realtime+shared\u0027 CPU type for a realtime instance use\n \u003e case, because all dedicated CPUs are realtime CPUs.\n\nrealtime+shared isn\u0027t a thing. We don\u0027t allow it and I don\u0027t think we want to (it doesn\u0027t make sense - how can you guarantee real-time characteristics from an unpinned process?). This is forbidden for \u0027shared\u0027 instances [1] and we should forbid it for \u0027shared\u0027 CPUs of \u0027mixed\u0027 instances.\n\n[1] https://github.com/openstack/nova/blob/20.1.0/nova/virt/hardware.py#L1869-L1870\n\n \u003e Actually I don\u0027t know any of the scenario which uses some realtime\n \u003e virtual CPUs for guaranteed latency, and some exclusively used host\n \u003e CPUs for, maybe, high speed, and some shared CPUs for increasing VM\n \u003e density.\n \u003e I do see some scenario for demanding shared CPUs and dedicated\n \u003e CPUs, or demanding the shared CPUs and realtime CPUs. Such as voice\n \u003e processing, and network package processing.\n \u003e \n \u003e I am good to take \u0027pinned_cpus\u0027 as an alias of \u0027cpu_realtime_mask\u0027\n \u003e and take value from it for realtime use case.\n\nOkay, so it seems we\u0027re in agreement.\n\nOn that note, how about we use \u0027cpu_dedicated_mask\u0027 instead of \u0027pinned_cpus\u0027? Seems similar to the existing extra spec.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f92c28798cdbf69d3e173caf97196d8caf16502","unresolved":false,"context_lines":[{"line_number":2296,"context_line":"            if instance_cell.cpuset_reserved:"},{"line_number":2297,"context_line":"                pinned_cpus |\u003d instance_cell.cpuset_reserved"},{"line_number":2298,"context_line":""},{"line_number":2299,"context_line":"            unpinned_cpus \u003d (len(instance_cell.cpuset) -"},{"line_number":2300,"context_line":"                             len(instance_cell.cpu_pinning))"},{"line_number":2301,"context_line":"            shared_cpus_usage +\u003d sign * unpinned_cpus"},{"line_number":2302,"context_line":""},{"line_number":2303,"context_line":"            if free:"},{"line_number":2304,"context_line":"                if (instance_cell.cpu_thread_policy \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_f519b287","line":2301,"range":{"start_line":2299,"start_character":0,"end_line":2301,"end_character":53},"updated":"2020-03-18 18:01:38.000000000","message":"It took me a while to figure out what this was doing. I think it would be good to merge this and the \u0027if not\u0027 above. Something like this might work.\n\n  unpinned_cpus \u003d (len(instance_cell.cpuset) -\n                   len(instance_cell.cpu_pinning))\n  shared_cpus_usage +\u003d sign * unpinned_cpus\n\n  if not instance_cell.cpu_pinning_requested:\n      continue\n\nwhich would cover both cases, right?","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"},{"author":{"_account_id":30209,"name":"Huaqiang","email":"huaqiang.wang@intel.com","username":"Huaqiang.Wang"},"change_message_id":"ef293c730f5a081bb0a8e2fcc2b0d30870db02d1","unresolved":false,"context_lines":[{"line_number":2296,"context_line":"            if instance_cell.cpuset_reserved:"},{"line_number":2297,"context_line":"                pinned_cpus |\u003d instance_cell.cpuset_reserved"},{"line_number":2298,"context_line":""},{"line_number":2299,"context_line":"            unpinned_cpus \u003d (len(instance_cell.cpuset) -"},{"line_number":2300,"context_line":"                             len(instance_cell.cpu_pinning))"},{"line_number":2301,"context_line":"            shared_cpus_usage +\u003d sign * unpinned_cpus"},{"line_number":2302,"context_line":""},{"line_number":2303,"context_line":"            if free:"},{"line_number":2304,"context_line":"                if (instance_cell.cpu_thread_policy \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_d6c7d211","line":2301,"range":{"start_line":2299,"start_character":0,"end_line":2301,"end_character":53},"in_reply_to":"1fa4df85_f519b287","updated":"2020-03-19 11:30:49.000000000","message":"No.\nproblem is we need to check \u0027instance_cell.cpu_pinning_requested\u0027 before we can perform a len() operation.","commit_id":"7b7c688ff58e8c3ee94fdf94be3151743d5c6d57"}]}
