lkml.org 
[lkml]   [2013]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] freezer: configure user space process frozen along with kernel threads
Date
> -----Original Message-----
> From: Cyrill Gorcunov [mailto:gorcunov@gmail.com] On Behalf Of Cyrill
> Gorcunov
> Sent: Wednesday, February 20, 2013 5:05 PM
> To: Li, Fei
> Cc: pavel@ucw.cz; rjw@sisk.pl; Brown, Len; mingo@redhat.com;
> peterz@infradead.org; akpm@linux-foundation.org; viro@zeniv.linux.org.uk;
> ebiederm@xmission.com; rientjes@google.com; linux-kernel@vger.kernel.org;
> linux-pm@vger.kernel.org; Liu, Chuansheng; Wang, Biao
> Subject: Re: [PATCH] freezer: configure user space process frozen along with
> kernel threads
>
> On Wed, Feb 20, 2013 at 10:15:25AM +0800, Li Fei wrote:
> >
> > +#ifdef CONFIG_FREEZER
> > +
> > +static ssize_t freeze_late_read(struct file *file, char __user *buf,
> > + size_t count, loff_t *ppos)
> > +{
> > + struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
> > + char buffer[PROC_NUMBUF];
> > + int freeze_late;
> > + size_t len;
> > + if (!task)
> > + return -ESRCH;
> > + freeze_late = (task->flags & PF_FREEZER_LATE) ? 1 : 0;
> > + len = snprintf(buffer, sizeof(buffer), "%d\n", freeze_late);
> > + return simple_read_from_buffer(buf, count, ppos, buffer, len);
> > +}
>
> Don't you need put_task_struct() once you grabbed it?

Thanks for your reminder. I'll update it in later version.

Best Regards,
Li Fei


\
 
 \ /
  Last update: 2013-02-20 15:42    [W:0.079 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site