xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org
Subject: [PATCH] fix kmemleak complaining about memory leaks when offlining/onlining vCPUS (v1).
Date: Wed,  5 Jun 2013 11:54:29 -0400	[thread overview]
Message-ID: <1370447678-22367-1-git-send-email-konrad.wilk@oracle.com> (raw)

When I fixed the online/offline vCPU mechanism to work again under
PVHVM guests, I saw this:


[  665.026885] kmemleak: 7 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

but due to not having enough time did not fix it. This patchset
fixes it by stashing the 'char *' of said interrupts line during their
creation. When they are torn down when a VCPU is offline we use said
per-cpu pointer to free it.

As part of it I also added some error checking and some default values.
Please look.

 arch/x86/xen/smp.c      | 91 ++++++++++++++++++++++++++++++++-----------------
 arch/x86/xen/spinlock.c |  5 +++
 arch/x86/xen/time.c     | 41 +++++++++++++++-------
 3 files changed, 92 insertions(+), 45 deletions(-)

Konrad Rzeszutek Wilk (9):
      xen/smp: Coalesce the free_irq calls in one function.
      xen/smp: Introduce a common structure to contain the IRQ name and interrupt line.
      xen/smp: Set the per-cpu IRQ number to a valid default.
      xen/smp: Don't leak interrupt name when offlining.
      xen/spinlock: Don't leak interrupt name when offlining.
      xen/time: Encapsulate the struct clock_event_device in another structure.
      xen/time: Don't leak interrupt name when offlining.
      xen/time: Check that the per_cpu data structure has data before freeing.
      xen/time: Free onlined per-cpu data structure if we want to online it again.

             reply	other threads:[~2013-06-05 15:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05 15:54 Konrad Rzeszutek Wilk [this message]
2013-06-05 15:54 ` [PATCH 1/9] xen/smp: Coalesce the free_irq calls in one function Konrad Rzeszutek Wilk
2013-06-05 15:54 ` [PATCH 2/9] xen/smp: Introduce a common structure to contain the IRQ name and interrupt line Konrad Rzeszutek Wilk
2013-06-06  7:16   ` Jan Beulich
     [not found]   ` <51B0537702000078000DBC74@nat28.tlf.novell.com>
2013-06-06 18:58     ` Konrad Rzeszutek Wilk
2013-06-05 15:54 ` [PATCH 3/9] xen/smp: Set the per-cpu IRQ number to a valid default Konrad Rzeszutek Wilk
2013-06-05 15:54 ` [PATCH 4/9] xen/smp: Don't leak interrupt name when offlining Konrad Rzeszutek Wilk
2013-06-05 15:54 ` [PATCH 5/9] xen/spinlock: " Konrad Rzeszutek Wilk
2013-06-05 15:54 ` [PATCH 6/9] xen/time: Encapsulate the struct clock_event_device in another structure Konrad Rzeszutek Wilk
2013-06-05 15:54 ` [PATCH 7/9] xen/time: Don't leak interrupt name when offlining Konrad Rzeszutek Wilk
2013-06-05 15:54 ` [PATCH 8/9] xen/time: Check that the per_cpu data structure has data before freeing Konrad Rzeszutek Wilk
2013-06-05 15:54 ` [PATCH 9/9] xen/time: Free onlined per-cpu data structure if we want to online it again Konrad Rzeszutek Wilk

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=1370447678-22367-1-git-send-email-konrad.wilk@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).