New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu_topology_test: Add test case to test cpu topology #2337
Conversation
252e902
to
6d9bf2e
Compare
911e248
to
685688b
Compare
@nanliu-r Updated, please help review. @Kuhn-Chen @PaulYuuu Please help review as well if you are available, thanks. |
685688b
to
34eea44
Compare
63760f2
to
5ea3681
Compare
Hi, guest refuses to start for this error when the host has 4 CPUs, please help to check this and do we need to boot guest with 240
|
5ea3681
to
d5c7172
Compare
Thanks @nanliu-r Updated to |
Hi, seems we can't always get the right list, sometimes guest refuses to start for this: please help to check this, thanks. |
Hi @nanliu-r Is this a Windows guest? |
d5c7172
to
5bd3a11
Compare
According to this statement, the smp should not be greater than the (vcpu_cores * vcpu_threads * vcpu_sockets). |
5bd3a11
to
2561706
Compare
Yes
Yes, this issue can reproduce with windows guest, and for rhel guest, I can met the issue seems we suggest to overcommit host CPU number five times in one VM .@PaulYuuu does your case need a special machine as your comments "On ppc,the most extreme case is smp = 10 * 8 * 10, which is larger than vCPU limitation(240/384), please limit vcpu_cores and vcpu_sockets." |
I think he means the extreme case from my previous code. |
2561706
to
52e3367
Compare
ae06322
to
b2fed6d
Compare
qemu/tests/cpu_topology_test.py
Outdated
vcpu_sockets = min(max(host_cpu * 5 // (vcpu_cores * vcpu_threads), 1), | ||
random.randint(1, 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some hosts have a lot of CPU, so there is a risk:
min(max(192 * 5 // (8 * 10), 1), random.randint(1, 10))
10
And then, smp = vcpu_maxcpus = 8 * 10 * 10
I think using fixed sockets (2) is okay for this test case.
IIUC, AMD CPUs do not support multiple threads except EYPC. @nanliu-r please help to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some hosts have a lot of CPU, so there is a risk:
min(max(192 * 5 // (8 * 10), 1), random.randint(1, 10)) 10And then,
smp = vcpu_maxcpus = 8 * 10 * 10
I think using fixed sockets (2) is okay for this test case.
@nanliu-r What do you think about this, to have a fixed sockets(2)?
Hi, I still can meet the issue "
|
This is the known issue of all AMD platforms. https://github.com/avocado-framework/avocado-vt/blob/666b5e5bb353272835c8d6bf618e11e8890fff3e/virttest/qemu_vm.py#L1532-L1540 |
@vivianQizhu Hi, since EPYC support multi-threads now can we do some changes in vt? Besides, I still can reproduce this error on intel machine with windows guest with probability (6/10)
|
b6a4148
to
b48a505
Compare
b48a505
to
8a48dee
Compare
@nanliu-r Any more comments? |
e93b2e6
to
f236198
Compare
if params['machine_type'] == 'pseries': | ||
vcpu_threads_list = [1, 2, 4, 8] | ||
params['vcpu_cores'] = vcpu_cores = random.randint(1, 10) | ||
host_cpu = cpu.online_count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get the vcpu_cores according to the host_cpu to avoid CPU overcommit?
I mean if the host_cpu is less than 10 we can decrease the range?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nanliu-r Sure, what do you expect? Same as host cores?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nanliu-r Sure, what do you expect? Same as host cores?
Sounds good for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about half of host_cpu considering of multiple threads?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nanliu-r What if host cpu core is 2? Will that be too small? Let's try with =host cpu and see if it works well first, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nanliu-r Update to vcpu_cores = random.randint(1, max(6, host_cpu//2))
. Please help review, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be vcpu_cores = random.randint(1, min(6, host_cpu//2))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nanliu-r No, you said, when host_cpu<12(hostcpu//2 < 6), it should be 6, when host_cpu >=12(host_cpu//2 > 6), it should be host_cpu//2, so it should be max(6, host_cpu//2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vivianQizhu vcpu_cores = random.randint(1, min(6, host_cpu//2))
This is what I want to say at first.
If we use max(6, host_cpu//2)
we maybe get a large maxcpus and we will hit the issue intel-iommu
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nanliu-r Okay, updated.
c5308b2
to
806d383
Compare
Signed-off-by: Qianqian Zhu <qizhu@redhat.com>
806d383
to
a1c1c56
Compare
Test pass on AMD and Intel. Thanks. Ack. |
Thanks @nanliu-r @PaulYuuu @Kuhn-Chen |
id: 1856239
Signed-off-by: Qianqian Zhu qizhu@redhat.com