On 2018/6/29 8:26 PM, shhuiw wrote: > > > On 06/28/2018 03:34 PM, Coly Li wrote: >> On 2018/6/28 3:16 PM, Wang Sheng-Hui wrote: >>> From: Shenghui Wang <shhuiw@xxxxxxxxxxx> >>> >>> Free the cache_set->flush_bree heap memory on journal free. >>> >> Hi Sheng-hui, >> >> Could you please to explain more in commit log what problem will be if >> free_heap(&c->flush_btree) not called ? And how you patch fixes the problem. >> >> Thanks. >> >> Coly Li > Hi Coly, > > I just read the code through and noticed that there is > "init_heap(&c->flush_btree, 128, GFP_KERNEL)" in bch_journal_alloc > but there is no free_heap in bch_journal_free. > > And I searched the bcache code and didn't find other logic free the > ->flush_btree heap. Hi Sheng-hui, Thanks for your comments, it makes sense to me. I add this patch into my for-test directory, and test it with other for 4.19 patches. Coly Li > >>> Signed-off-by: Wang Sheng-Hui <shhuiw@xxxxxxxxxxx> >>> --- >>> drivers/md/bcache/journal.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c >>> index 18f1b5239620..10748c626a1d 100644 >>> --- a/drivers/md/bcache/journal.c >>> +++ b/drivers/md/bcache/journal.c >>> @@ -828,6 +828,7 @@ void bch_journal_free(struct cache_set *c) >>> free_pages((unsigned long) c->journal.w[1].data, JSET_BITS); >>> free_pages((unsigned long) c->journal.w[0].data, JSET_BITS); >>> free_fifo(&c->journal.pin); >>> + free_heap(&c->flush_btree); >>> } >>> >>> int bch_journal_alloc(struct cache_set *c) >>> >> >> > -- To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html