* question about process freezing
@ 2006-12-11 2:05 Bob YANG
2006-12-11 20:33 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Bob YANG @ 2006-12-11 2:05 UTC (permalink / raw)
To: linux-pm
[-- Attachment #1.1: Type: text/plain, Size: 263 bytes --]
Hi,
Could anybody explain to me what process freezing is? I mean, what will
happen to a frozen process? I tried to understand the codes in
kernel/power/process.c and found one thing freeze_process() does is to set
PF_FREEZE flag. What is that for?
Thanks,
Peng
[-- Attachment #1.2: Type: text/html, Size: 283 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: question about process freezing
2006-12-11 2:05 question about process freezing Bob YANG
@ 2006-12-11 20:33 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2006-12-11 20:33 UTC (permalink / raw)
To: linux-pm; +Cc: Bob YANG
Hi,
On Monday, 11 December 2006 03:05, Bob YANG wrote:
> Hi,
>
> Could anybody explain to me what process freezing is? I mean, what will
> happen to a frozen process? I tried to understand the codes in
> kernel/power/process.c and found one thing freeze_process() does is to set
> PF_FREEZE flag. What is that for?
This is to tell the process to go to the refrigerator.
The function used by processes to check if we want them to go to the
refrigerator is called try_to_freeze() and defined in either sched.h or
freezer.h (in newer kernels). User space processes call try_to_freeze()
in get_signal_to_deliver() and kernel threads (that are freezeable) should
call it explicitly wherever appropriate.
The refrigerator itself is a function defined in process.c. Processes that
enter it set their PF_FROZEN flags and change their states to
TASK_UNINTERRUPTIBLE. They are in this state until we clear the PF_FROZEN
flag for them, in thaw_processes().
Greetings,
Rafael
--
If you don't have the time to read,
you don't have the time or the tools to write.
- Stephen King
^ permalink raw reply [flat|nested] 6+ messages in thread
* Question about process freezing
@ 2007-11-20 9:11 Franck Bui-Huu
2007-11-20 15:37 ` Alan Stern
0 siblings, 1 reply; 6+ messages in thread
From: Franck Bui-Huu @ 2007-11-20 9:11 UTC (permalink / raw)
To: linux-pm
Hi,
I have a simple/dumb question about process freezing.
Instead of freezing every single user land processes by sending them a
fake signal and waiting for them to go to the refrigerator, why not
freezing the scheduler ?
Thanks,
Franck
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about process freezing
2007-11-20 9:11 Question " Franck Bui-Huu
@ 2007-11-20 15:37 ` Alan Stern
2007-11-21 7:46 ` Franck Bui-Huu
0 siblings, 1 reply; 6+ messages in thread
From: Alan Stern @ 2007-11-20 15:37 UTC (permalink / raw)
To: Franck Bui-Huu; +Cc: linux-pm
On Tue, 20 Nov 2007, Franck Bui-Huu wrote:
> Hi,
>
> I have a simple/dumb question about process freezing.
>
> Instead of freezing every single user land processes by sending them a
> fake signal and waiting for them to go to the refrigerator, why not
> freezing the scheduler ?
Because processes can't simply be frozen immediately. They need to
have a chance to release any important locks or mutexes they may be
holding.
Alan Stern
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about process freezing
2007-11-20 15:37 ` Alan Stern
@ 2007-11-21 7:46 ` Franck Bui-Huu
2007-11-21 13:58 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Franck Bui-Huu @ 2007-11-21 7:46 UTC (permalink / raw)
To: Alan Stern; +Cc: linux-pm
Alan Stern wrote:
> On Tue, 20 Nov 2007, Franck Bui-Huu wrote:
>> Instead of freezing every single user land processes by sending them a
>> fake signal and waiting for them to go to the refrigerator, why not
>> freezing the scheduler ?
>
> Because processes can't simply be frozen immediately. They need to
> have a chance to release any important locks or mutexes they may be
> holding.
>
You mean any locks held by a frozen process and needed by the suspend
code path ?
thanks,
Franck
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about process freezing
2007-11-21 7:46 ` Franck Bui-Huu
@ 2007-11-21 13:58 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2007-11-21 13:58 UTC (permalink / raw)
To: linux-pm
On Wednesday, 21 of November 2007, Franck Bui-Huu wrote:
> Alan Stern wrote:
> > On Tue, 20 Nov 2007, Franck Bui-Huu wrote:
> >> Instead of freezing every single user land processes by sending them a
> >> fake signal and waiting for them to go to the refrigerator, why not
> >> freezing the scheduler ?
> >
> > Because processes can't simply be frozen immediately. They need to
> > have a chance to release any important locks or mutexes they may be
> > holding.
> >
>
> You mean any locks held by a frozen process and needed by the suspend
> code path ?
Yes.
Regards,
Rafael
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-11-21 13:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-11 2:05 question about process freezing Bob YANG
2006-12-11 20:33 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2007-11-20 9:11 Question " Franck Bui-Huu
2007-11-20 15:37 ` Alan Stern
2007-11-21 7:46 ` Franck Bui-Huu
2007-11-21 13:58 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox