Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
xen.4507
xsa206-0002-xenstored-Log-when-the-write-transa...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xsa206-0002-xenstored-Log-when-the-write-transaction-rate-limit.patch of Package xen.4507
References: bsc#1030144 XSA-206 From a529dbd09cc72528d48f46d7d2d703e6b60ef74b Mon Sep 17 00:00:00 2001 From: Juergen Gross <jgross@suse.com> Date: Wed, 15 Mar 2017 13:10:11 +0100 Subject: [PATCH 2/2] xenstored: Log when the write transaction rate limit bites Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Juergen Gross <jgross@suse.com> --- tools/xenstore/xenstored_core.c | 1 + tools/xenstore/xenstored_domain.c | 25 +++++++++++++++++++++++++ tools/xenstore/xenstored_domain.h | 2 ++ 3 files changed, 28 insertions(+) Index: xen-4.4.4-testing/tools/xenstore/xenstored_core.c =================================================================== --- xen-4.4.4-testing.orig/tools/xenstore/xenstored_core.c +++ xen-4.4.4-testing/tools/xenstore/xenstored_core.c @@ -347,6 +347,7 @@ static void initialize_fds(int sock, int POLLIN|POLLPRI); wrl_gettime_now(&now); + wrl_log_periodic(now); list_for_each_entry(conn, &connections, list) { if (conn->domain) { Index: xen-4.4.4-testing/tools/xenstore/xenstored_domain.c =================================================================== --- xen-4.4.4-testing.orig/tools/xenstore/xenstored_domain.c +++ xen-4.4.4-testing/tools/xenstore/xenstored_domain.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include <stdarg.h> #include <time.h> +#include <syslog.h> #include <xenctrl.h> #include "utils.h" @@ -80,6 +81,7 @@ struct domain /* write rate limit */ wrl_creditt wrl_credit; /* [ -wrl_config_writecost, +_dburst ] */ struct wrl_timestampt wrl_timestamp; + bool wrl_delay_logged; }; static LIST_HEAD(domains); @@ -747,6 +749,7 @@ long wrl_ntransactions; static long wrl_ndomains; static wrl_creditt wrl_reserve; /* [-wrl_config_newdoms_dburst, +_gburst ] */ +static time_t wrl_log_last_warning; /* 0: no previous warning */ void wrl_gettime_now(struct wrl_timestampt *now_wt) { @@ -896,6 +899,9 @@ void wrl_check_timeout(struct domain *do wakeup); } +#define WRL_LOG(now, ...) \ + (syslog(LOG_WARNING, "write rate limit: " __VA_ARGS__)) + void wrl_apply_debit_actual(struct domain *domain) { struct wrl_timestampt now; @@ -911,6 +917,25 @@ void wrl_apply_debit_actual(struct domai trace("wrl: domain %u credit=%ld (reserve=%ld)\n", domain->domid, (long)domain->wrl_credit, (long)wrl_reserve); + + if (domain->wrl_credit < 0) { + if (!domain->wrl_delay_logged++) { + WRL_LOG(now, "domain %ld is affected", + (long)domain->domid); + } else if (!wrl_log_last_warning) { + WRL_LOG(now, "rate limiting restarts"); + } + wrl_log_last_warning = now.sec; + } +} + +void wrl_log_periodic(struct wrl_timestampt now) +{ + if (wrl_log_last_warning && + (now.sec - wrl_log_last_warning) > WRL_LOGEVERY) { + WRL_LOG(now, "not in force recently"); + wrl_log_last_warning = 0; + } } void wrl_apply_debit_direct(struct connection *conn) Index: xen-4.4.4-testing/tools/xenstore/xenstored_domain.h =================================================================== --- xen-4.4.4-testing.orig/tools/xenstore/xenstored_domain.h +++ xen-4.4.4-testing/tools/xenstore/xenstored_domain.h @@ -73,6 +73,7 @@ int domain_watch(struct connection *conn #define WRL_DBURST 10 #define WRL_GBURST 1000 #define WRL_NEWDOMS 5 +#define WRL_LOGEVERY 120 /* seconds */ struct wrl_timestampt { time_t sec; @@ -88,6 +89,7 @@ void wrl_credit_update(struct domain *do void wrl_check_timeout(struct domain *domain, struct wrl_timestampt now, int *ptimeout); +void wrl_log_periodic(struct wrl_timestampt now); void wrl_apply_debit_direct(struct connection *conn); void wrl_apply_debit_trans_commit(struct connection *conn);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor