From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-devel@nongnu.org, dave@treblig.org,
yc-core@yandex-team.ru, zeil@yandex-team.ru,
xeor@yandex-team.ru, kwolf@redhat.com, hreitz@redhat.com,
qemu-block@nongnu.org
Subject: Re: [PATCH] block-backend: per-device throttling of BLOCK_IO_ERROR reports
Date: Wed, 15 Nov 2023 14:46:15 +0100 [thread overview]
Message-ID: <87r0krnn88.fsf@pond.sub.org> (raw)
In-Reply-To: <20231107085842.602188-1-vsementsov@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Tue, 7 Nov 2023 11:58:42 +0300")
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
> From: Leonid Kaplan <xeor@yandex-team.ru>
>
> BLOCK_IO_ERROR events comes from guest, so we must throttle them.
Really? Can you describe how a guest can trigger these errors?
> We still want per-device throttling, so let's use device id as a key.
>
> Signed-off-by: Leonid Kaplan <xeor@yandex-team.ru>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> ---
> monitor/monitor.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/monitor/monitor.c b/monitor/monitor.c
> index 01ede1babd..ad0243e9d7 100644
> --- a/monitor/monitor.c
> +++ b/monitor/monitor.c
> @@ -309,6 +309,7 @@ int error_printf_unless_qmp(const char *fmt, ...)
> static MonitorQAPIEventConf monitor_qapi_event_conf[QAPI_EVENT__MAX] = {
> /* Limit guest-triggerable events to 1 per second */
> [QAPI_EVENT_RTC_CHANGE] = { 1000 * SCALE_MS },
> + [QAPI_EVENT_BLOCK_IO_ERROR] = { 1000 * SCALE_MS },
> [QAPI_EVENT_WATCHDOG] = { 1000 * SCALE_MS },
> [QAPI_EVENT_BALLOON_CHANGE] = { 1000 * SCALE_MS },
> [QAPI_EVENT_QUORUM_REPORT_BAD] = { 1000 * SCALE_MS },
> @@ -498,6 +499,10 @@ static unsigned int qapi_event_throttle_hash(const void *key)
> hash += g_str_hash(qdict_get_str(evstate->data, "qom-path"));
> }
>
> + if (evstate->event == QAPI_EVENT_BLOCK_IO_ERROR) {
> + hash += g_str_hash(qdict_get_str(evstate->data, "device"));
> + }
> +
> return hash;
> }
>
> @@ -525,6 +530,11 @@ static gboolean qapi_event_throttle_equal(const void *a, const void *b)
> qdict_get_str(evb->data, "qom-path"));
> }
>
> + if (eva->event == QAPI_EVENT_BLOCK_IO_ERROR) {
> + return !strcmp(qdict_get_str(eva->data, "device"),
> + qdict_get_str(evb->data, "device"));
> + }
> +
> return TRUE;
> }
Missing:
diff --git a/qapi/block-core.json b/qapi/block-core.json
index ca390c5700..32c2c2f030 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -5559,6 +5559,8 @@
# Note: If action is "stop", a STOP event will eventually follow the
# BLOCK_IO_ERROR event
#
+# Note: This event is rate-limited.
+#
# Since: 0.13
#
# Example:
next prev parent reply other threads:[~2023-11-15 13:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 8:58 [PATCH] block-backend: per-device throttling of BLOCK_IO_ERROR reports Vladimir Sementsov-Ogievskiy
2023-11-08 21:22 ` Eric Blake
2023-11-09 9:07 ` Vladimir Sementsov-Ogievskiy
2023-11-15 13:46 ` Markus Armbruster [this message]
2023-11-16 10:27 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r0krnn88.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
--cc=xeor@yandex-team.ru \
--cc=yc-core@yandex-team.ru \
--cc=zeil@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.