xen-blkback: fix memory leaks
PATCH v2 2/4 xen-blkback: fix memory leaks
Quoted 16 lines · Roger Pau Monne
I've at least identified two possible memory leaks in blkback, both related to the shutdown path of a VBD:
- blkback doesn't wait for any pending purge work to finish before cleaning the list of
free_pages. The purge work will callput_free_pagesand thus we might end up with pages being added to thefree_pageslist after we have emptied it. Fix this by making sure there's no pending purge work before exitingxen_blkif_schedule, and moving thefree_pagecleanup code toxen_blkif_free.
- blkback doesn't wait for pending requests to end before cleaning persistent grants and the list offree_pages. Again this can add pages to thefree_pageslist or persistent grants to thepersistent_gntsred-black tree. Fixed by moving the persistent grants andfree_pagescleanup code toxen_blkif_free.
Quoted 2 lines
Also, add some checks in
xen_blkif_freeto make sure we are cleaning everything.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 17 lines · Matthew Rushton
Quoted 16 lines · Roger Pau Monne
I've at least identified two possible memory leaks in blkback, both related to the shutdown path of a VBD:
- blkback doesn't wait for any pending purge work to finish before cleaning the list of
free_pages. The purge work will callput_free_pagesand thus we might end up with pages being added to thefree_pageslist after we have emptied it. Fix this by making sure there's no pending purge work before exitingxen_blkif_schedule, and moving thefree_pagecleanup code toxen_blkif_free.
- blkback doesn't wait for pending requests to end before cleaning persistent grants and the list offree_pages. Again this can add pages to thefree_pageslist or persistent grants to thepersistent_gntsred-black tree. Fixed by moving the persistent grants andfree_pagescleanup code toxen_blkif_free.
Quoted 5 lines
Quoted 2 lines
Also, add some checks in
xen_blkif_freeto make sure we are cleaning everything.Tested-by Matt Rushton <[email protected]>Reviewed-by Matt Rushton <[email protected]>
Christoph
Quoted 17 lines · Matthew Rushton
Quoted 16 lines · Roger Pau Monne
I've at least identified two possible memory leaks in blkback, both related to the shutdown path of a VBD:
- blkback doesn't wait for any pending purge work to finish before cleaning the list of
free_pages. The purge work will callput_free_pagesand thus we might end up with pages being added to thefree_pageslist after we have emptied it. Fix this by making sure there's no pending purge work before exitingxen_blkif_schedule, and moving thefree_pagecleanup code toxen_blkif_free.
- blkback doesn't wait for pending requests to end before cleaning persistent grants and the list offree_pages. Again this can add pages to thefree_pageslist or persistent grants to thepersistent_gntsred-black tree. Fixed by moving the persistent grants andfree_pagescleanup code toxen_blkif_free.
Quoted 5 lines
Quoted 2 lines
Also, add some checks in
xen_blkif_freeto make sure we are cleaning everything.Tested-by Matt Rushton <[email protected]>Reviewed-by Matt Rushton <[email protected]>
Christoph