Skip to contentSkip to conversation

question on freeze and aio

DISCUSSION Oliver Neukum 7 participants 19 messages Feb 9, 2007 – Feb 14, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

can there be running aio requests if all tasks are frozen?

Regards
Oliver

#1 lore raw
Quoted 3 lines · Oliver Neukum

Hi,

can there be running aio requests if all tasks are frozen?

I think so. We have to be able to save the image after all. :-)

Greetings,
Rafael

#2 lore raw
In reply to Oliver Neukum

Hi.

Quoted 3 lines · Oliver Neukum

Hi,

can there be running aio requests if all tasks are frozen?

Since tasks are frozen, no new aio requests would be submitted. We do a sync to ssek to complete existing requests; I haven't looked to see whether that would need extending to flush aio as well, but don't think that would be the case. Given everyone else's silence, so far, you might be better to ask the author(s) of the aio code.

(As I type Rafael's reply has arrived, but I think my answer might still be helpful, so I'll send it too).

Regards,

Nigel

#3 lore raw
Quoted 5 lines · Nigel Cunningham

Hi.

Quoted 2 lines · Oliver Neukum

Hi,

Quoted 7 lines
Quoted 1 line

can there be running aio requests if all tasks are frozen?

Since tasks are frozen, no new aio requests would be submitted. We do a sync to ssek to complete existing requests; I haven't looked to see whether that would need extending to flush aio as well, but don't think that would be the case. Given everyone else's silence, so far, you might be better to ask the author(s) of the aio code.

I believe Nigel is basically correct. However sync will only flush aio for block devices. Other types of aio will remain active.

aio callbacks are interrupt-driven and execute in a workqueue (see fs/aio.c), and as far as I can tell that workqueue doesn't freeze. Unless some general facility freezes all workqueues...

Alan Stern

#4 lore raw

Hi.

Quoted 15 lines · Alan Stern
Quoted 5 lines · Nigel Cunningham

Hi.

Quoted 2 lines · Oliver Neukum

Hi,

Quoted 7 lines
Quoted 1 line

can there be running aio requests if all tasks are frozen?

Since tasks are frozen, no new aio requests would be submitted. We do a sync to ssek to complete existing requests; I haven't looked to see whether that would need extending to flush aio as well, but don't think that would be the case. Given everyone else's silence, so far, you might be better to ask the author(s) of the aio code.

Quoted 6 lines

I believe Nigel is basically correct. However sync will only flush aio for block devices. Other types of aio will remain active.

aio callbacks are interrupt-driven and execute in a workqueue (see fs/aio.c), and as far as I can tell that workqueue doesn't freeze. Unless some general facility freezes all workqueues...

Hmm. That applies to Raid, too? I've had some reports of raid i/o being caught in the BUG_ON() I have to catch I/O that shouldn't be happening, but haven't gotten around to looking at them yet.

Regards,

Nigel

#5 lore raw
Quoted 21 lines · Nigel Cunningham

Hi.

Quoted 18 lines · Alan Stern
Quoted 5 lines · Nigel Cunningham

Hi.

Quoted 2 lines · Oliver Neukum

Hi,

Quoted 7 lines
Quoted 1 line

can there be running aio requests if all tasks are frozen?

Since tasks are frozen, no new aio requests would be submitted. We do a sync to ssek to complete existing requests; I haven't looked to see whether that would need extending to flush aio as well, but don't think that would be the case. Given everyone else's silence, so far, you might be better to ask the author(s) of the aio code.

I believe Nigel is basically correct. However sync will only flush aio for block devices. Other types of aio will remain active.

Quoted 7 lines
Quoted 3 lines

aio callbacks are interrupt-driven and execute in a workqueue (see fs/aio.c), and as far as I can tell that workqueue doesn't freeze. Unless some general facility freezes all workqueues...

Hmm. That applies to Raid, too? I've had some reports of raid i/o being caught in the BUG_ON() I have to catch I/O that shouldn't be happening, but haven't gotten around to looking at them yet.

Yes, I think it applies to RAID, but that's because md_thread has been made PF_NOFREEZE explicitly, since we want to be able to save the image to an md-based swap.

Pretty much everything that uses workqueues can do that, too.

Greetings,
Rafael

Signature · 3 lines
If you don't have the time to read,
you don't have the time or the tools to write.
		- Stephen King
#6 lore raw
In reply to Nigel Cunningham
Quoted 7 lines · Nigel Cunningham
Quoted 3 lines

aio callbacks are interrupt-driven and execute in a workqueue (see fs/aio.c), and as far as I can tell that workqueue doesn't freeze. Unless some general facility freezes all workqueues...

Hmm. That applies to Raid, too? I've had some reports of raid i/o being caught in the BUG_ON() I have to catch I/O that shouldn't be happening, but haven't gotten around to looking at them yet.

Sorry, I don't know how the RAID drivers work.

Alan Stern

#7 lore raw
In reply to Alan Stern
Quoted 15 lines · Alan Stern
Quoted 5 lines · Nigel Cunningham

Hi.

Quoted 2 lines · Oliver Neukum

Hi,

Quoted 7 lines
Quoted 1 line

can there be running aio requests if all tasks are frozen?

Since tasks are frozen, no new aio requests would be submitted. We do a sync to ssek to complete existing requests; I haven't looked to see whether that would need extending to flush aio as well, but don't think that would be the case. Given everyone else's silence, so far, you might be better to ask the author(s) of the aio code.

Quoted 6 lines

I believe Nigel is basically correct. However sync will only flush aio for block devices. Other types of aio will remain active.

aio callbacks are interrupt-driven and execute in a workqueue (see fs/aio.c), and as far as I can tell that workqueue doesn't freeze. Unless some general facility freezes all workqueues...

No, workqueues are not frozen unless they are explicitly declared as freezeable. Which currently is only done by XFS, AFAIKS.

Greetings,
Rafael

Signature · 3 lines
If you don't have the time to read,
you don't have the time or the tools to write.
		- Stephen King
#8 lore raw

Hi!

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 1 line

can there be running aio requests if all tasks are frozen?

Since tasks are frozen, no new aio requests would be submitted. We do a sync to ssek to complete existing requests; I haven't looked to see whether that would need extending to flush aio as well, but don't think that would be the case. Given everyone else's silence, so far, you might be better to ask the author(s) of the aio code.

I believe Nigel is basically correct. However sync will only flush aio for block devices. Other types of aio will remain active.

Quoted 6 lines
Quoted 3 lines

aio callbacks are interrupt-driven and execute in a workqueue (see fs/aio.c), and as far as I can tell that workqueue doesn't freeze. Unless some general facility freezes all workqueues...

No, workqueues are not frozen unless they are explicitly declared as freezeable. Which currently is only done by XFS, AFAIKS.

Ok, then we have a bug in swsusp. Can someone locate _which_ workqueue is used for aio... and make it freezeable?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#9 lore raw
Quoted 17 lines · Pavel Machek

Hi!

Quoted 15 lines
Quoted 14 lines
Quoted 7 lines
Quoted 1 line

can there be running aio requests if all tasks are frozen?

Since tasks are frozen, no new aio requests would be submitted. We do a sync to ssek to complete existing requests; I haven't looked to see whether that would need extending to flush aio as well, but don't think that would be the case. Given everyone else's silence, so far, you might be better to ask the author(s) of the aio code.

I believe Nigel is basically correct. However sync will only flush aio for block devices. Other types of aio will remain active.

aio callbacks are interrupt-driven and execute in a workqueue (see fs/aio.c), and as far as I can tell that workqueue doesn't freeze. Unless some general facility freezes all workqueues...

Quoted 5 lines
Quoted 2 lines

No, workqueues are not frozen unless they are explicitly declared as freezeable. Which currently is only done by XFS, AFAIKS.

Ok, then we have a bug in swsusp. Can someone locate _which_ workqueue is used for aio... and make it freezeable?

Hm, so AIO is not needed for saving the image regardless of the system configuration?

Rafael

#10 lore raw

Hi!

Quoted 5 lines
Quoted 2 lines

Ok, then we have a bug in swsusp. Can someone locate _which_ workqueue is used for aio... and make it freezeable?

Hm, so AIO is not needed for saving the image regardless of the system configuration?

No, definitely not.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#11 lore raw
In reply to Pavel Machek
Quoted 5 lines · Pavel Machek
Quoted 2 lines

No, workqueues are not frozen unless they are explicitly declared as freezeable. Which currently is only done by XFS, AFAIKS.

Ok, then we have a bug in swsusp. Can someone locate _which_ workqueue is used for aio... and make it freezeable?

Here is an untested patch. Does anybody have a way to test it?

(BTW, should it be spelled "freezeable" or "freezable"?)

Alan Stern

fs/aio.c +1 -1
Index: usb-2.6/fs/aio.c
===================================================================
@@ -73,7 +73,7 @@ static int __init aio_setup(void)
 	kioctx_cachep = kmem_cache_create("kioctx", sizeof(struct kioctx),
 				0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
-	aio_wq = create_workqueue("aio");
+	aio_wq = create_freezeable_workqueue("aio");
 
 	pr_debug("aio_setup: sizeof(struct page) = %d\n", (int)sizeof(struct page));
 
#12 lore raw
Quoted 11 lines · On Tue, 13 Feb 2007 16:01:30 -0500 (EST) Alan Stern wrote:
Quoted 5 lines · Pavel Machek
Quoted 2 lines

No, workqueues are not frozen unless they are explicitly declared as freezeable. Which currently is only done by XFS, AFAIKS.

Ok, then we have a bug in swsusp. Can someone locate _which_ workqueue is used for aio... and make it freezeable?

Here is an untested patch. Does anybody have a way to test it?

(BTW, should it be spelled "freezeable" or "freezable"?)

www.dict.org says freezable.

fs/aio.c static int __init aio_setup(void) · line 78

Quoted 12 lines

Index: usb-2.6/fs/aio.c
===================================================================

fs/aio.c +1 -1
@@ -73,7 +73,7 @@ static int __init aio_setup(void)
 	kioctx_cachep = kmem_cache_create("kioctx", sizeof(struct kioctx),
 				0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
-	aio_wq = create_workqueue("aio");
+	aio_wq = create_freezeable_workqueue("aio");
 
 	pr_debug("aio_setup: sizeof(struct page) = %d\n", (int)sizeof(struct page));

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#13 lore raw
Quoted 7 lines · Randy Dunlap
Quoted 5 lines · On Tue, 13 Feb 2007 16:01:30 -0500 (EST) Alan Stern wrote:
Quoted 3 lines · Pavel Machek
Quoted 2 lines

No, workqueues are not frozen unless they are explicitly declared as freezeable. Which currently is only done by XFS, AFAIKS.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Ok, then we have a bug in swsusp. Can someone locate _which_ workqueue is used for aio... and make it freezeable?

Here is an untested patch. Does anybody have a way to test it?

(BTW, should it be spelled "freezeable" or "freezable"?)

www.dict.org says freezable.

Yeah, but we have always spelled "freezeable". Google search shows both are being used.

Greetings,
Rafael

Signature · 3 lines
If you don't have the time to read,
you don't have the time or the tools to write.
		- Stephen King
#14 lore raw
In reply to Alan Stern
Quoted 9 lines · Alan Stern
Quoted 5 lines · Pavel Machek
Quoted 2 lines

No, workqueues are not frozen unless they are explicitly declared as freezeable. Which currently is only done by XFS, AFAIKS.

Ok, then we have a bug in swsusp. Can someone locate _which_ workqueue is used for aio... and make it freezeable?

Here is an untested patch. Does anybody have a way to test it?

I'll give it a run on my test system.

Greetings,
Rafael

#15 lore raw
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Alan Stern
Quoted 3 lines · Pavel Machek
Quoted 2 lines

No, workqueues are not frozen unless they are explicitly declared as freezeable. Which currently is only done by XFS, AFAIKS.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Ok, then we have a bug in swsusp. Can someone locate _which_ workqueue is used for aio... and make it freezeable?

Here is an untested patch. Does anybody have a way to test it?

I'll give it a run on my test system.

Unfortunately, it seems to break the suspend.

The system doesn't suspend, but enters an endless loop right after the freezing of consoles.

I'll have to debug it a bit more on a machine with a serial console, but not today.

Well, it looks like there's something we didn't know about. :-)

Greetings,
Rafael

#16 lore raw
In reply to Alan Stern

Hi!

Quoted 8 lines
Quoted 7 lines
Quoted 1 line

can there be running aio requests if all tasks are frozen?

Since tasks are frozen, no new aio requests would be submitted. We do a sync to ssek to complete existing requests; I haven't looked to see whether that would need extending to flush aio as well, but don't think that would be the case. Given everyone else's silence, so far, you might be better to ask the author(s) of the aio code.

Quoted 6 lines

I believe Nigel is basically correct. However sync will only flush aio for block devices. Other types of aio will remain active.

aio callbacks are interrupt-driven and execute in a workqueue (see fs/aio.c), and as far as I can tell that workqueue doesn't freeze. Unless some general facility freezes all workqueues...

If this is so... we need to make that particular workqueue freezeable. (And we should really make most workqueues freezeable).

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#17 lore raw
Quoted 13 lines · Pavel Machek

Hi!

Quoted 11 lines
Quoted 7 lines
Quoted 1 line

can there be running aio requests if all tasks are frozen?

Since tasks are frozen, no new aio requests would be submitted. We do a sync to ssek to complete existing requests; I haven't looked to see whether that would need extending to flush aio as well, but don't think that would be the case. Given everyone else's silence, so far, you might be better to ask the author(s) of the aio code.

I believe Nigel is basically correct. However sync will only flush aio for block devices. Other types of aio will remain active.

Quoted 6 lines
Quoted 3 lines

aio callbacks are interrupt-driven and execute in a workqueue (see fs/aio.c), and as far as I can tell that workqueue doesn't freeze. Unless some general facility freezes all workqueues...

If this is so... we need to make that particular workqueue freezeable. (And we should really make most workqueues freezeable).

Except for the ones that are needed to save the image. Do we know which ones they are?

Rafael

#18 lore raw
In reply to Oliver Neukum

Hi!

Quoted 1 line

can there be running aio requests if all tasks are frozen?

If you see them running, you've found a kernel bug.

No, really, I do not think so. AFAIK, even aio does its i/o requests from process context, no?
Pavel

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