xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xen.org
Cc: Juergen Gross <jgross@suse.com>,
	wei.liu2@citrix.com, ian.jackson@eu.citrix.com
Subject: [PATCH v3 0/5] xenstore: fix memory leak of xenstored
Date: Tue, 19 Jul 2016 13:30:41 +0200	[thread overview]
Message-ID: <1468927846-23676-1-git-send-email-jgross@suse.com> (raw)

xenstored has a memory leak when setting watches: a no longer active
watch which fired in the past will still use some memory. This is
critical for long running connections to xenstored like the qemu
process serving as a qdisk backend for dom0. It will use some few
kB in xenstored for each domain create/destroy pair.

Fix this leak by using a temporary memory context for all allocations
in xenstored when firing a watch event.

Changes in V3:
- renamed temporary context parameter name and added comments in 
  patches 2-5 as requested by Wei Liu

Changes in V2:
- modified patch description as requested by Ian Jackson
- split up patch 2 as requested by Ian Jackson

Juergen Gross (5):
  xenstore: call each xenstored command function with temporary context
  xenstore: add explicit memory context parameter to get_parent()
  xenstore: add explicit memory context parameter to read_node()
  xenstore: add explicit memory context parameter to get_node()
  xenstore: use temporary memory context for firing watches

 tools/xenstore/xenstored_core.c        | 134 ++++++++++++++++++++-------------
 tools/xenstore/xenstored_core.h        |   4 +
 tools/xenstore/xenstored_domain.c      |  20 +++--
 tools/xenstore/xenstored_domain.h      |  10 +--
 tools/xenstore/xenstored_transaction.c |   5 +-
 tools/xenstore/xenstored_transaction.h |   2 +-
 tools/xenstore/xenstored_watch.c       |  22 ++++--
 tools/xenstore/xenstored_watch.h       |   3 +-
 8 files changed, 123 insertions(+), 77 deletions(-)

-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

             reply	other threads:[~2016-07-19 11:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 11:30 Juergen Gross [this message]
2016-07-19 11:30 ` [PATCH v3 1/5] xenstore: call each xenstored command function with temporary context Juergen Gross
2016-07-19 11:30 ` [PATCH v3 2/5] xenstore: add explicit memory context parameter to get_parent() Juergen Gross
2016-07-19 11:30 ` [PATCH v3 3/5] xenstore: add explicit memory context parameter to read_node() Juergen Gross
2016-07-19 11:30 ` [PATCH v3 4/5] xenstore: add explicit memory context parameter to get_node() Juergen Gross
2016-07-19 11:30 ` [PATCH v3 5/5] xenstore: use temporary memory context for firing watches Juergen Gross
2016-07-19 13:19 ` [PATCH v3 0/5] xenstore: fix memory leak of xenstored Wei Liu

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=1468927846-23676-1-git-send-email-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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).