Bug 190961

Summary: pvclock_gtod_notify invoked frequently leads to extra cpu load
Product: Virtualization Reporter: Chen Yu (yu.c.chen)
Component: kvmAssignee: virtualization_kvm
Status: RESOLVED PATCH_ALREADY_AVAILABLE    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.9 Subsystem:
Regression: No Bisected commit-id:
Bug Depends on:    
Bug Blocks: 178231    

Description Chen Yu 2016-12-23 08:39:21 UTC
This thread is created for tracking purpose
Currently the notifier of pvclock_gtod_notify() get invoked
frequently due to the periodic update_wall_time(). This might
slow down the system a little bit as there might be redundant
execution code path and unnecessary lock contention
in update_pvclock_gtod(), which was found when I was doing
suspend/resume speed testings. As pvclock_gtod_notify()
should be invoked only when clocksource has changed, according to
Commit 16e8d74d2da9 ("KVM: x86: notifier for clocksource changes")
, either we can add a new notifier for clocksource switch,
or we can simply bypass the following code in pvclock_gtod_notify()
earlier if there is no clocksource switch.

https://patchwork.kernel.org/patch/9487257/