Adds HW_CPU_HYPERTHREADING standard trait

This patch adds a new standard trait: HW_CPU_HYPERTHREADING.

The resource provider decorated with this trait indicates that
the hyperthreading is enabled on the provider.

Partially Implements: blueprint cpu-resources

Change-Id: I762a7f11bd10f93855850d09751415d35e5b38e1
This commit is contained in:
dineshbhor 2018-06-11 23:42:51 -07:00
parent 8888c52877
commit 46ed096e9a
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# A few generalized capabilities of some RP
TRAITS = [
# The resource provider decorated with this trait indicates that
# hyperthreading is enabled on the provider.
# Operators of resource-constrained systems would be able to decorate a
# single NUMA node resource provider on a multi-socket system with this
# HW_CPU_HYPERTHREADING trait to “carve out” a part of the host system
# for guests that can tolerate hyperthread siblings providing CPU
# resources.
'HYPERTHREADING',
]

View File

@ -41,6 +41,7 @@ class TestSymbols(base.TestCase):
def test_get_traits_filter_by_prefix(self):
traits = ot.get_traits('HW_CPU')
self.assertIn("HW_CPU_X86_SSE42", traits)
self.assertIn("HW_CPU_HYPERTHREADING", traits)
self.assertIn(ot.HW_CPU_X86_AVX2, traits)
self.assertNotIn(ot.STORAGE_DISK_SSD, traits)
self.assertNotIn(ot.HW_NIC_SRIOV, traits)