mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: tj@kernel.org, pavel@ucw.cz, len.brown@intel.com,
	rdunlap@xenotime.net, linux-pm@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM/Freezer/Docs: Document the beauty of freeze/thaw semantics
Date: Thu, 2 Feb 2012 20:36:58 +0100	[thread overview]
Message-ID: <201202022036.59167.rjw@sisk.pl> (raw)
In-Reply-To: <20120202022829.13341.64259.stgit@srivatsabhat.in.ibm.com>

On Thursday, February 02, 2012, Srivatsa S. Bhat wrote:
> The way the different freeze/thaw functions encapsulate each other are quite
> lovely from a design point of view. And as a side-effect, the way in which
> they are invoked (cleaning up on failure for example) differs significantly
> from how usual functions are dealt with. This is because of the underlying
> semantics that govern the freezing and thawing of various tasks.
> 
> This subtle aspect that differentiates these functions from the rest, is
> worth documenting.
> 
> Many thanks to Tejun Heo for providing enlightenment on this topic.
> 
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>

Applied.

Thanks,
Rafael


> ---
> 
>  Documentation/power/freezing-of-tasks.txt |   21 +++++++++++++++++++++
>  1 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt
> index ebd7490..ec715cd 100644
> --- a/Documentation/power/freezing-of-tasks.txt
> +++ b/Documentation/power/freezing-of-tasks.txt
> @@ -63,6 +63,27 @@ devices have been reinitialized, the function thaw_processes() is called in
>  order to clear the PF_FROZEN flag for each frozen task.  Then, the tasks that
>  have been frozen leave __refrigerator() and continue running.
>  
> +
> +Rationale behind the functions dealing with freezing and thawing of tasks:
> +-------------------------------------------------------------------------
> +
> +freeze_processes():
> +  - freezes only userspace tasks
> +
> +freeze_kernel_threads():
> +  - freezes all tasks (including kernel threads) because we can't freeze
> +    kernel threads without freezing userspace tasks
> +
> +thaw_kernel_threads():
> +  - thaws only kernel threads; this is particularly useful if we need to do
> +    anything special in between thawing of kernel threads and thawing of
> +    userspace tasks, or if we want to postpone the thawing of userspace tasks
> +
> +thaw_processes():
> +  - thaws all tasks (including kernel threads) because we can't thaw userspace
> +    tasks without thawing kernel threads
> +
> +
>  III. Which kernel threads are freezable?
>  
>  Kernel threads are not freezable by default.  However, a kernel thread may clear
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


      reply	other threads:[~2012-02-02 19:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02  2:28 Srivatsa S. Bhat
2012-02-02 19:36 ` Rafael J. Wysocki [this message]

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=201202022036.59167.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=len.brown@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rdunlap@xenotime.net \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tj@kernel.org \
    /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

Powered by JetHome