[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BEC9F67575FA1E429CA7CF5AE9BE3634403712@SHSMSX102.ccr.corp.intel.com>
Date: Wed, 20 Feb 2013 13:46:47 +0000
From: "Li, Fei" <fei.li@...el.com>
To: Cyrill Gorcunov <gorcunov@...nvz.org>
CC: "pavel@....cz" <pavel@....cz>, "rjw@...k.pl" <rjw@...k.pl>,
"Brown, Len" <len.brown@...el.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"peterz@...radead.org" <peterz@...radead.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"ebiederm@...ssion.com" <ebiederm@...ssion.com>,
"rientjes@...gle.com" <rientjes@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"Liu, Chuansheng" <chuansheng.liu@...el.com>,
"Wang, Biao" <biao.wang@...el.com>
Subject: RE: [PATCH] freezer: configure user space process frozen along with
kernel threads
> -----Original Message-----
> From: Cyrill Gorcunov [mailto:gorcunov@...il.com] On Behalf Of Cyrill
> Gorcunov
> Sent: Wednesday, February 20, 2013 5:05 PM
> To: Li, Fei
> Cc: pavel@....cz; rjw@...k.pl; Brown, Len; mingo@...hat.com;
> peterz@...radead.org; akpm@...ux-foundation.org; viro@...iv.linux.org.uk;
> ebiederm@...ssion.com; rientjes@...gle.com; linux-kernel@...r.kernel.org;
> linux-pm@...r.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists