mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00

The throttle group support use a cooperative round robin scheduling algorithm. The principles of the algorithm are simple: - Each BDS of the group is used as a token in a circular way. - The active BDS computes if a wait must be done and arms the right timer. - If a wait must be done the token timer will be armed so the token will become the next active BDS. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: f0082a86f3ac01c46170f7eafe2101a92e8fde39.1433779731.git.berto@igalia.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
43 lines
1.5 KiB
C
43 lines
1.5 KiB
C
/*
|
|
* QEMU block throttling group infrastructure
|
|
*
|
|
* Copyright (C) Nodalink, EURL. 2014
|
|
* Copyright (C) Igalia, S.L. 2015
|
|
*
|
|
* Authors:
|
|
* Benoît Canet <benoit.canet@nodalink.com>
|
|
* Alberto Garcia <berto@igalia.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; either version 2 or
|
|
* (at your option) version 3 of the License.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef THROTTLE_GROUPS_H
|
|
#define THROTTLE_GROUPS_H
|
|
|
|
#include "qemu/throttle.h"
|
|
#include "block/block_int.h"
|
|
|
|
const char *throttle_group_get_name(BlockDriverState *bs);
|
|
|
|
void throttle_group_config(BlockDriverState *bs, ThrottleConfig *cfg);
|
|
void throttle_group_get_config(BlockDriverState *bs, ThrottleConfig *cfg);
|
|
|
|
void throttle_group_register_bs(BlockDriverState *bs, const char *groupname);
|
|
void throttle_group_unregister_bs(BlockDriverState *bs);
|
|
|
|
void coroutine_fn throttle_group_co_io_limits_intercept(BlockDriverState *bs,
|
|
unsigned int bytes,
|
|
bool is_write);
|
|
|
|
#endif
|