File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -787,10 +787,15 @@ struct percpu_counter vm_committed_as ____cacheline_aligned_in_smp;
787
787
* balancing memory across competing virtual machines that are hosted.
788
788
* Several metrics drive this policy engine including the guest reported
789
789
* memory commitment.
790
+ *
791
+ * The time cost of this is very low for small platforms, and for big
792
+ * platform like a 2S/36C/72T Skylake server, in worst case where
793
+ * vm_committed_as's spinlock is under severe contention, the time cost
794
+ * could be about 30~40 microseconds.
790
795
*/
791
796
unsigned long vm_memory_committed (void )
792
797
{
793
- return percpu_counter_read_positive (& vm_committed_as );
798
+ return percpu_counter_sum_positive (& vm_committed_as );
794
799
}
795
800
EXPORT_SYMBOL_GPL (vm_memory_committed );
796
801
You can’t perform that action at this time.
0 commit comments