On Thu, Mar 28, 2024 at 03:53:30PM +0800, Abel Wu wrote: > > +static int schedule_flush_migrate_mm(void) > > +{ > > + struct callback_head *flush_cb; > > + > > + flush_cb = kzalloc(sizeof(*flush_cb), GFP_KERNEL); > > + if (!flush_cb) > > + return -ENOMEM; > > + > > + flush_cb->func = flush_migrate_mm_task_workfn; > > + if (task_work_add(current, flush_cb, TWA_RESUME)) > > + kfree(flush_cb); > > It seems we will lose track of flush_cb and causes memleak here. Did I miss > anything? Oops, yeah, the work item needs to free itself. Thanks for spotting it. -- tejun