[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] A memory leak problem in xen-blkback module



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


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.