[ovs-dev] [PATCH] memory: Avoid 100% CPU when there is nothing to report.

Ansis Atteka aatteka at nicira.com
Thu Apr 11 22:19:55 UTC 2013


On Thu, Apr 11, 2013 at 3:05 PM, Ben Pfaff <blp at nicira.com> wrote:

> Commit b9de4087685 (memory: Avoid an empty log message if there's nothing
> to log.) introduced a 100% CPU usage condition when there is nothing to
> log.  This fixes the problem.
>
> Reported-by: Ansis Atteka <aatteka at nicira.com>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  lib/memory.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/memory.c b/lib/memory.c
> index c26c743..1137390 100644
> --- a/lib/memory.c
> +++ b/lib/memory.c
> @@ -137,8 +137,10 @@ memory_report(const struct simap *usage)
>      ds_init(&s);
>      compose_report(usage, &s);
>
> -    if (want_report && s.length) {
> -        VLOG_INFO("%s", ds_cstr(&s));
> +    if (want_report) {
> +        if (s.length) {
> +            VLOG_INFO("%s", ds_cstr(&s));
> +        }
>          want_report = false;
>      }
>      if (n_conns) {
> --
> 1.7.2.5
>
> Acked-by: Ansis Atteka <aatteka at nicira.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130411/7d78a7a9/attachment-0003.html>


More information about the dev mailing list