Re: Re: [problem] Hung task caused by memory migration when cpuset.mems changes

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

 



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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux