Bug 1496 - performance: Useless assignment instructions cause Unixbench full core performance degradation on X86_64 architecture
Summary: performance: Useless assignment instructions cause Unixbench full core perfor...
Status: CONFIRMED
Alias: None
Product: ANCK 4.19 Dev
Classification: ANCK
Component: X86 (show other bugs) X86
Version: unspecified
Hardware: x86_64 Linux
: P3-Medium S5-enhancement
Target Milestone: ---
Assignee: wuyihao66
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-23 09:23 UTC by guohui
Modified: 2022-10-13 10:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description guohui uniontech_group 2022-06-23 09:23:34 UTC
Description of problem:
The instructions assigned to the parameters of the vcpu_is_preempted function 
in the X86 architecture physical machine are redundant instructions, 
which cause the multi-core performance of Unixbench to drop by 
about 400 to 500 points.
The C function is as follows:
static bool vcpu_is_preempted(long vcpu);

The parameter assignments in the function osq_lock 
that call the function vcpu_is_preempted are as follows:
mov 0x14(%rax),%edi
sub $0x1,%edi

The parameter assignment instruction in the function mutex_spin_on_owner 
that calls the function vcpu_is_preempted is as follows:
mov 0x3c(%rsi),%edi

The above instructions are unnecessary 
in the X86 Native operating environment, 
causing high cache-misses and degrading performance.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Enter the Unixbench directory
2. ./Run -c 128 // 128 is the number of X86 physical machine cores
3. After removing the above command, run it again: ./Run -c 128

Actual results:
The score in step 3 is 400 to 500 more points than the score in step 2

Expected results:
Steps 2 and 3 have similar scores

Additional info:
N/A
Comment 1 guohui uniontech_group 2022-10-13 10:42:53 UTC
config CONFIG_PARAVIRT_SPINLOCKS must be turn on.