public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Maxim Levitsky <maximlevitsky@gmail.com>
To: linux-pm <linux-pm@lists.linux-foundation.org>
Subject: Question about behavier of the freezer
Date: Sun, 24 Jan 2010 21:42:11 +0200	[thread overview]
Message-ID: <1264362131.7011.13.camel@maxim-laptop> (raw)

I know following things:

All kernel threads aren't freezable by default, thus are running while
suspend/resume is done. (Of course this is unless thread sleeps on a
lock, or when pm core enters atomic context)

Kernel thread can became freezable, and then it is frozen when it calls
try_to_freeze.

I also know that userspace program that is in TASK_UNINTERRUPTIBLE can't
be frozen, and breaks suspend.

Now what happens if userspace thread is TASK_RUNNING? Can it be
interrupted inside the kernel?

Or in other words, userspace thread can be interrupted to receive signal
while inside the kernel?

I think that signals are only delivered if userspace task in running in
user mode. If it is in TASK_INTERRUPTIBLE, then the task will be woken
up (this is corresponding wait function will return some predefined
error message, and then kernel code will try to return to userspace as
fast as possible. When task returns to userspace, right away the signal
handler is called.

Did I answer my own question?

Best regards,
Maxim Levitsky

             reply	other threads:[~2010-01-24 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-24 19:42 Maxim Levitsky [this message]
2010-01-24 21:16 ` Question about behavier of the freezer Rafael J. Wysocki

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=1264362131.7011.13.camel@maxim-laptop \
    --to=maximlevitsky@gmail.com \
    --cc=linux-pm@lists.linux-foundation.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