mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically
Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly for dirty page rate limit. Add dirtylimit.c to implement dirtyrate calculation periodly, which will be used for dirty page rate limit. Add dirtylimit.h to export util functions for dirty page rate limit implementation. Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn> Reviewed-by: Peter Xu <peterx@redhat.com> Message-Id: <5d0d641bffcb9b1c4cc3e323b6dfecb36050d948.1656177590.git.huangy81@chinatelecom.cn> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
8244166dec
commit
cc2b33eab0
4 changed files with 143 additions and 1 deletions
22
include/sysemu/dirtylimit.h
Normal file
22
include/sysemu/dirtylimit.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Dirty page rate limit common functions
|
||||
*
|
||||
* Copyright (c) 2022 CHINA TELECOM CO.,LTD.
|
||||
*
|
||||
* Authors:
|
||||
* Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
#ifndef QEMU_DIRTYRLIMIT_H
|
||||
#define QEMU_DIRTYRLIMIT_H
|
||||
|
||||
#define DIRTYLIMIT_CALC_TIME_MS 1000 /* 1000ms */
|
||||
|
||||
int64_t vcpu_dirty_rate_get(int cpu_index);
|
||||
void vcpu_dirty_rate_stat_start(void);
|
||||
void vcpu_dirty_rate_stat_stop(void);
|
||||
void vcpu_dirty_rate_stat_initialize(void);
|
||||
void vcpu_dirty_rate_stat_finalize(void);
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue