public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: Li Fei <fei.li@intel.com>
Cc: pavel@ucw.cz, rjw@sisk.pl, len.brown@intel.com, 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, chuansheng.liu@intel.com,
	biao.wang@intel.com
Subject: Re: [PATCH] freezer: configure user space process frozen along with kernel threads
Date: Wed, 20 Feb 2013 13:05:07 +0400	[thread overview]
Message-ID: <20130220090507.GV20312@moon> (raw)
In-Reply-To: <1361326525.9753.1.camel@fli24-HP-Compaq-8100-Elite-CMT-PC>

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?

  reply	other threads:[~2013-02-20  9:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20  2:15 [PATCH] freezer: configure user space process frozen along with kernel threads Li Fei
2013-02-20  9:05 ` Cyrill Gorcunov [this message]
2013-02-20 13:46   ` Li, Fei
2013-02-20 13:51 ` Eric W. Biederman
2013-02-20 15:24   ` Alan Stern
2013-02-20 20:28     ` Eric W. Biederman
2013-02-20 20:48       ` Alan Stern
2013-02-20 21:36         ` Eric W. Biederman
2013-02-20 21:58           ` Alan Stern
2013-02-20 22:49           ` Pavel Machek
2013-02-20 22:39   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130220090507.GV20312@moon \
    --to=gorcunov@openvz.org \
    --cc=akpm@linux-foundation.org \
    --cc=biao.wang@intel.com \
    --cc=chuansheng.liu@intel.com \
    --cc=ebiederm@xmission.com \
    --cc=fei.li@intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=rientjes@google.com \
    --cc=rjw@sisk.pl \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox