Skip to contentSkip to conversation

suspend: Do not freeze md_threads

RFC PATCH In review Rafael J. Wysocki 3 participants 4 messages Nov 2, 2006 – Nov 6, 2006 MD RAID

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 suspend: Do not freeze md_threads

Hi,

If there's a swap file on a software RAID, it should be possible to use this file for saving the swsusp's suspend image. Also, this file should be available to the memory management subsystem when memory is being freed before the suspend image is created.

For the above reasons it seems that md_threads should not be frozen during the suspend and the appended patch makes this happen, but then there is the question if they don't cause any data to be written to disks after the suspend image has been created, provided that all filesystems are frozen at that time.

Please advise.

Greetings,
Rafael

---
 drivers/md/md.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c +1 -1
Index: linux-2.6.19-rc4-mm2/drivers/md/md.c
===================================================================
@@ -4489,6 +4489,7 @@ static int md_thread(void * arg)
 	 * many dirty RAID5 blocks.
 	 */
 
+	current->flags |= PF_NOFREEZE;
 	allow_signal(SIGKILL);
 	while (!kthread_should_stop()) {
 
@@ -4505,7 +4506,6 @@ static int md_thread(void * arg)
 			 test_bit(THREAD_WAKEUP, &thread->flags)
 			 || kthread_should_stop(),
 			 thread->timeout);
-		try_to_freeze();
 
 		clear_bit(THREAD_WAKEUP, &thread->flags);
 
#1 lore raw

Hi!

Quoted 10 lines

If there's a swap file on a software RAID, it should be possible to use this file for saving the swsusp's suspend image. Also, this file should be available to the memory management subsystem when memory is being freed before the suspend image is created.

For the above reasons it seems that md_threads should not be frozen during the suspend and the appended patch makes this happen, but then there is the question if they don't cause any data to be written to disks after the suspend image has been created, provided that all filesystems are frozen at that time.

Looks okay to me. It would be nice to have someone (Ingo? Neil?) try to suspend to swap on md......
Pavel

Quoted 31 lines

Please advise.

Greetings,
Rafael

---
 drivers/md/md.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.19-rc4-mm2/drivers/md/md.c
===================================================================

drivers/md/md.c +1 -1
@@ -4489,6 +4489,7 @@ static int md_thread(void * arg)
 	 * many dirty RAID5 blocks.
 	 */
 
+	current->flags |= PF_NOFREEZE;
 	allow_signal(SIGKILL);
 	while (!kthread_should_stop()) {
 
@@ -4505,7 +4506,6 @@ static int md_thread(void * arg)
 			 test_bit(THREAD_WAKEUP, &thread->flags)
 			 || kthread_should_stop(),
 			 thread->timeout);
-		try_to_freeze();
 
 		clear_bit(THREAD_WAKEUP, &thread->flags);
 
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
Quoted 7 lines · On Sunday November 5, [email protected] wrote:

Hi!

Quoted 5 lines

If there's a swap file on a software RAID, it should be possible to use this file for saving the swsusp's suspend image. Also, this file should be available to the memory management subsystem when memory is being freed before the suspend image is created.

Quoted 8 lines
Quoted 5 lines

For the above reasons it seems that md_threads should not be frozen during the suspend and the appended patch makes this happen, but then there is the question if they don't cause any data to be written to disks after the suspend image has been created, provided that all filesystems are frozen at that time.

Looks okay to me. It would be nice to have someone (Ingo? Neil?) try to suspend to swap on md......

Yes... suspending to swap-on-md would probably be fairly easy. Resuming from that same swap might be a bit more of a challenge. If only I had more time...

but the patch looks good to me. I'll see that it gets applied. Thanks,

NeilBrown

#3 lore raw

Hi!

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

If there's a swap file on a software RAID, it should be possible to use this file for saving the swsusp's suspend image. Also, this file should be available to the memory management subsystem when memory is being freed before the suspend image is created.

For the above reasons it seems that md_threads should not be frozen during the suspend and the appended patch makes this happen, but then there is the question if they don't cause any data to be written to disks after the suspend image has been created, provided that all filesystems are frozen at that time.

Quoted 6 lines
Quoted 2 lines

Looks okay to me. It would be nice to have someone (Ingo? Neil?) try to suspend to swap on md......

Yes... suspending to swap-on-md would probably be fairly easy. Resuming from that same swap might be a bit more of a challenge. If only I had more time...

With uswsusp (scheduled for 10.2), it should be fairly easy, too. I guess we shall just get Andrea to try it :-).
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html