From: "Chentao(Boby)" <boby.chen@huawei.com>
To: konrad.wilk@oracle.com, roger.pau@citrix.com
Cc: liujinlj.liu@huawei.com, xen-devel@lists.xenproject.org,
Yanqiangjun <yanqiangjun@huawei.com>,
zhangmin <rudy.zhangmin@huawei.com>,
wu.wubin@huawei.com
Subject: A memory leak problem in xen-blkback module
Date: Fri, 12 Sep 2014 14:58:36 +0800 [thread overview]
Message-ID: <5412999C.6010600@huawei.com> (raw)
Hi Konrad,
I find a memory leak problem in xen-blkback module of linux-3.14.4 release, and the newest 3.17-rc4 also has the same problem. The problem will occur in below condition.
In xen_blkbk_map function, first get_free_page from balloon or the list of blkif free pages, then map this page. If get_free_page succeed, but map failed,
the grant handle corresponding to this page will be assigned to BLKBACK_INVALID_HANDLE. Because map failed, it will execute xen_blkbk_unmap to retrieve resources.
But in xen_blkbk_unmap function, if the grant handle of a page is BLKBACK_INVALID_HANDLE, it will continue to next loop to execute unmap and put_free_pages.
Only executes put_free_pages, these pages will be returned to the list of blkif free pages and at last be returned to balloon.
Make a summary, in the condition of get_free_page succeed but map failed, the page will be leaked from balloon or the list of blkif free pages. I have a immature thought,
in xen_blkbk_unmap funtion, when judge the grant handle of a page is BLKBACK_INVALID_HANDLE, can we execute put_free_pages to retrieve this one page?
Just like below:
if (pages[i]->handle == BLKBACK_INVALID_HANDLE) {
put_free_pages(blkif, pages[i]->page, 1);
continue;
}
I'm looking forward to your reply. Any reply is appreciated.
Best wishes.
Tao Chen
next reply other threads:[~2014-09-12 6:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 6:58 Chentao(Boby) [this message]
2014-09-15 9:55 ` A memory leak problem in xen-blkback module Roger Pau Monné
2014-09-15 12:54 ` Chentao(Boby)
2014-09-15 13:15 ` Roger Pau Monné
2014-09-16 1:33 ` Chentao(Boby)
2014-09-30 15:23 ` Roger Pau Monné
2014-10-01 13:46 ` 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=5412999C.6010600@huawei.com \
--to=boby.chen@huawei.com \
--cc=konrad.wilk@oracle.com \
--cc=liujinlj.liu@huawei.com \
--cc=roger.pau@citrix.com \
--cc=rudy.zhangmin@huawei.com \
--cc=wu.wubin@huawei.com \
--cc=xen-devel@lists.xenproject.org \
--cc=yanqiangjun@huawei.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).