* Question regarding kjournald when entering hibernation
@ 2011-11-11 8:35 Mohan
2011-11-11 21:36 ` Nigel Cunningham
0 siblings, 1 reply; 4+ messages in thread
From: Mohan @ 2011-11-11 8:35 UTC (permalink / raw)
To: linux-pm
Hi,
I am testing hibernation on a PPC4xx board.
I have noticed that kjournald is still running even when the hibernation
image is being saved to disk.
On looking at the code in fs/jbd/journal.c the kjournald thread
has a check "if(freezing(current))" which i assume is to
check if hibernating and to freeze the kjournald thread.
But since the kjournald thread has the PF_NOFREEZE flag
set it does not freeze the kjournald thread.
1. Can any one tell me in what case the kjournald thread is frozen?
2. Or is there no problem if it is not frozen during hibernation ?
3. Would it be a bad idea to set the kjournald thread freezeable using
"set_freezable()" ?
Thank you,
Mohan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question regarding kjournald when entering hibernation
2011-11-11 8:35 Question regarding kjournald when entering hibernation Mohan
@ 2011-11-11 21:36 ` Nigel Cunningham
2011-11-13 9:41 ` Mohan
0 siblings, 1 reply; 4+ messages in thread
From: Nigel Cunningham @ 2011-11-11 21:36 UTC (permalink / raw)
To: Mohan; +Cc: linux-pm
Hi Mohan.
On 11/11/11 19:35, Mohan wrote:
> Hi,
>
> I am testing hibernation on a PPC4xx board.
> I have noticed that kjournald is still running even when the hibernation
> image is being saved to disk.
>
> On looking at the code in fs/jbd/journal.c the kjournald thread
> has a check "if(freezing(current))" which i assume is to
> check if hibernating and to freeze the kjournald thread.
> But since the kjournald thread has the PF_NOFREEZE flag
> set it does not freeze the kjournald thread.
>
> 1. Can any one tell me in what case the kjournald thread is frozen?
All kernel threads were originally treated as unfreezable. Looking at
the history of kjournald in git, the support for freezing kjournald has
been there since before 2.6.12-rc2 (before git began to be used). I'd
therefore say that the code may never have been used and kjournald may
never have been frozen.
> 2. Or is there no problem if it is not frozen during hibernation ?
Since the hibernation code seeks to make an atomic copy which is then
saved, there shouldn't be a problem in the case of the vanilla kernel
and uswsusp. TuxOnIce might possibly have a problem if kjournald had
work to do and tried to do it (though a BUG_ON that the patch adds in
the block would capture the attempt at submitting I/O and stop
corruption occuring).
> 3. Would it be a bad idea to set the kjournald thread freezeable using
> "set_freezable()" ?
I think it would be a good idea. Even with the atomic copy (ignoring ToI
since it's out-of-tree), it will simplify the debugging process if
things that shouldn't be running don't run during hibernation.
Regards,
Nigel
--
Evolution (n): A hypothetical process whereby improbable
events occur with alarming frequency, order arises from chaos, and
no one is given credit.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question regarding kjournald when entering hibernation
2011-11-11 21:36 ` Nigel Cunningham
@ 2011-11-13 9:41 ` Mohan
0 siblings, 0 replies; 4+ messages in thread
From: Mohan @ 2011-11-13 9:41 UTC (permalink / raw)
To: Nigel Cunningham; +Cc: linux-pm
Hi Nigel,
Thanks for the response.
On Sat, Nov 12, 2011 at 6:36 AM, Nigel Cunningham <nigel@tuxonice.net> wrote:
> Hi Mohan.
>
> On 11/11/11 19:35, Mohan wrote:
>> Hi,
>>
>> I am testing hibernation on a PPC4xx board.
>> I have noticed that kjournald is still running even when the hibernation
>> image is being saved to disk.
>>
>> On looking at the code in fs/jbd/journal.c the kjournald thread
>> has a check "if(freezing(current))" which i assume is to
>> check if hibernating and to freeze the kjournald thread.
>> But since the kjournald thread has the PF_NOFREEZE flag
>> set it does not freeze the kjournald thread.
>>
>> 1. Can any one tell me in what case the kjournald thread is frozen?
>
> All kernel threads were originally treated as unfreezable. Looking at
> the history of kjournald in git, the support for freezing kjournald has
> been there since before 2.6.12-rc2 (before git began to be used). I'd
> therefore say that the code may never have been used and kjournald may
> never have been frozen.
>
I also felt that the kjournald thread is never frozen.
But it seems to have the if(freezing) check and the code for suspending
that got me wondering.
>> 2. Or is there no problem if it is not frozen during hibernation ?
>
> Since the hibernation code seeks to make an atomic copy which is then
> saved, there shouldn't be a problem in the case of the vanilla kernel
> and uswsusp. TuxOnIce might possibly have a problem if kjournald had
> work to do and tried to do it (though a BUG_ON that the patch adds in
> the block would capture the attempt at submitting I/O and stop
> corruption occuring).
>
As of now I am only using the hibernate support from the vanilla kernel.
And as you rightly point out there seems to be no problem in the
hibernation image that is created, I am able to resume successfully.
I am having other problems for which i feel the running of kjournald
during hibernation acts as a trigger. (will be debugging them
separately relates to
16K PAGESIZE and hIbernation image saved to swap file on / )
>> 3. Would it be a bad idea to set the kjournald thread freezeable using
>> "set_freezable()" ?
>
> I think it would be a good idea. Even with the atomic copy (ignoring ToI
> since it's out-of-tree), it will simplify the debugging process if
> things that shouldn't be running don't run during hibernation.
>
If it is alright i can prepare a patch for fs/jbd/journal.c with
the set_freezable() and refrigerator() -> try_to_freeze()
(like in mm/vmscan.c) code changes.
I would like to get it reviewed and ok'd if posible.
Please let me know where (who all) i have to post it to.
> Regards,
>
> Nigel
> --
> Evolution (n): A hypothetical process whereby improbable
> events occur with alarming frequency, order arises from chaos, and
> no one is given credit.
>
Regards,
Mohan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Question regarding kjournald when entering hibernation
@ 2011-11-11 8:23 Mohan
0 siblings, 0 replies; 4+ messages in thread
From: Mohan @ 2011-11-11 8:23 UTC (permalink / raw)
To: linux-pm
Hi,
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-13 9:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 8:35 Question regarding kjournald when entering hibernation Mohan
2011-11-11 21:36 ` Nigel Cunningham
2011-11-13 9:41 ` Mohan
-- strict thread matches above, loose matches on Subject: below --
2011-11-11 8:23 Mohan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox