Commit c71799c1 authored by Heiko Carstens's avatar Heiko Carstens Committed by Avi Kivity

KVM: s390: Improve pgste accesses

There is no need to use interlocked updates when the rcp
lock is held. Therefore the simple bitops variants can be
used. This should improve performance.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarCarsten Otte <cotte@de.ibm.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent f603f073
...@@ -553,12 +553,12 @@ static inline void ptep_rcp_copy(pte_t *ptep) ...@@ -553,12 +553,12 @@ static inline void ptep_rcp_copy(pte_t *ptep)
skey = page_get_storage_key(page_to_phys(page)); skey = page_get_storage_key(page_to_phys(page));
if (skey & _PAGE_CHANGED) if (skey & _PAGE_CHANGED)
set_bit(RCP_GC_BIT, pgste); set_bit_simple(RCP_GC_BIT, pgste);
if (skey & _PAGE_REFERENCED) if (skey & _PAGE_REFERENCED)
set_bit(RCP_GR_BIT, pgste); set_bit_simple(RCP_GR_BIT, pgste);
if (test_and_clear_bit(RCP_HC_BIT, pgste)) if (test_and_clear_bit_simple(RCP_HC_BIT, pgste))
SetPageDirty(page); SetPageDirty(page);
if (test_and_clear_bit(RCP_HR_BIT, pgste)) if (test_and_clear_bit_simple(RCP_HR_BIT, pgste))
SetPageReferenced(page); SetPageReferenced(page);
#endif #endif
} }
...@@ -732,8 +732,8 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, ...@@ -732,8 +732,8 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
young = ((page_get_storage_key(physpage) & _PAGE_REFERENCED) != 0); young = ((page_get_storage_key(physpage) & _PAGE_REFERENCED) != 0);
rcp_lock(ptep); rcp_lock(ptep);
if (young) if (young)
set_bit(RCP_GR_BIT, pgste); set_bit_simple(RCP_GR_BIT, pgste);
young |= test_and_clear_bit(RCP_HR_BIT, pgste); young |= test_and_clear_bit_simple(RCP_HR_BIT, pgste);
rcp_unlock(ptep); rcp_unlock(ptep);
return young; return young;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment