Re: [PATCH] block: call __bio_free in bio_endio
From: Jens Axboe <axboe@fb.com>
Date: 2017-06-29 21:24:14
From: Jens Axboe <axboe@fb.com>
Date: 2017-06-29 21:24:14
On 06/29/2017 02:24 PM, Christoph Hellwig wrote:
On Thu, Jun 29, 2017 at 11:54:17AM -0700, Shaohua Li wrote:quoted
bio_free isn't a good place to free cgroup info. There are a lot of cases bio is allocated in special way (for example, in stack) and never gets called by bio_put hence bio_free, we are leaking memory. This patch moves the free to bio endio, which should be called anyway. The __bio_free call in bio_free is kept, in case the bio never gets called bio endio.Jens already renamed __bio_free to bio_uninit in Linus' tree. That being said I think we should just kill __bio_free once all the work is in. But I think we should defer this post the initial pull for 4.12-rc to reduce the merge pain.
Yes, let's pick up that work after the existing for-4.13/block has been merged upstream. -- Jens Axboe