Skip to contentSkip to conversation

XFS vs. swsusp

DISCUSSION Pavel Machek 3 participants 5 messages Jul 31, 2006 – Aug 1, 2006

lore
Share & tools
lore
#0 lore raw

Hi!

Rafael has patches to add bdev freezing to swsusp. I'd like to know if they are neccessary (and why).

1) Is sync() enough to guarantee that all the data written before sync actually reach the platters?

(Or is it that data only reach the journal? OTOH that would be okay, too).

2) If we stop all the user proceses and all the kernel threads, is that enough to prevent XFS from writing to disk?
Pavel

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

Hi!

Hi there,

Quoted 7 lines

Rafael has patches to add bdev freezing to swsusp. I'd like to know if they are neccessary (and why).

1) Is sync() enough to guarantee that all the data written before sync actually reach the platters?

(Or is it that data only reach the journal? OTOH that would be okay, too).

It ensures file data reaches its final resting place, and that metadata changes have been logged. It does not necessarily ensure that metadata changes have reached their final resting place (which can be done during log recovery if need be).

A freeze is one way to ensure all metadata will be written out (and not just to the log, I mean), unmount is another (d'uh), and remount,ro is a third.

Quoted 2 lines

2) If we stop all the user proceses and all the kernel threads, is that enough to prevent XFS from writing to disk?

Yes, I believe so (if all user processes and kernel threads are stopped, who else would be left to initiate I/O?). There is a timer driven wakeup done on the per-fs xfssyncd kernel threads, which do background metadata writeout and will write to the log periodically... but if those processes are all stopped too, you should be OK.

cheers.

Signature · 1 line
Nathan
#2 lore raw

Hi!

Quoted 10 lines
Quoted 7 lines

Rafael has patches to add bdev freezing to swsusp. I'd like to know if they are neccessary (and why).

1) Is sync() enough to guarantee that all the data written before sync actually reach the platters?

(Or is it that data only reach the journal? OTOH that would be okay, too).

It ensures file data reaches its final resting place, and that metadata changes have been logged. It does not necessarily

....

Okay, good, being safely in the journal is okay.

Quoted 5 lines
Quoted 2 lines

2) If we stop all the user proceses and all the kernel threads, is that enough to prevent XFS from writing to disk?

Yes, I believe so (if all user processes and kernel threads are stopped, who else would be left to initiate I/O?). There is a

Well, we were afraid that you'd do it from timer interrupt or something like that.

Quoted 4 lines

timer driven wakeup done on the per-fs xfssyncd kernel threads, which do background metadata writeout and will write to the log periodically... but if those processes are all stopped too, you should be OK.

Timer only wakes up xfssyncd thread, right? That's okay, as that thread will be stopped.

Rafael, I do not think we need bdev freezing changes for XFS.
Pavel

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

Hi,

Quoted 23 lines · Pavel Machek
Quoted 10 lines
Quoted 7 lines

Rafael has patches to add bdev freezing to swsusp. I'd like to know if they are neccessary (and why).

1) Is sync() enough to guarantee that all the data written before sync actually reach the platters?

(Or is it that data only reach the journal? OTOH that would be okay, too).

It ensures file data reaches its final resting place, and that metadata changes have been logged. It does not necessarily

....

Okay, good, being safely in the journal is okay.

Quoted 5 lines
Quoted 2 lines

2) If we stop all the user proceses and all the kernel threads, is that enough to prevent XFS from writing to disk?

Yes, I believe so (if all user processes and kernel threads are stopped, who else would be left to initiate I/O?). There is a

Well, we were afraid that you'd do it from timer interrupt or something like that.

Quoted 7 lines
Quoted 4 lines

timer driven wakeup done on the per-fs xfssyncd kernel threads, which do background metadata writeout and will write to the log periodically... but if those processes are all stopped too, you should be OK.

Timer only wakes up xfssyncd thread, right? That's okay, as that thread will be stopped.

But we call sync() before kernel threads are frozen. What happens if xfssyncd gets woken up by the timer after the sync() and before we freeze it?

Rafael

#4 lore raw

Hi!

Quoted 10 lines
Quoted 7 lines
Quoted 4 lines

timer driven wakeup done on the per-fs xfssyncd kernel threads, which do background metadata writeout and will write to the log periodically... but if those processes are all stopped too, you should be OK.

Timer only wakes up xfssyncd thread, right? That's okay, as that thread will be stopped.

But we call sync() before kernel threads are frozen. What happens if xfssyncd gets woken up by the timer after the sync() and before we freeze it?

xfssyncd writes some data to disk, but that is okay (no important data could be generated in the meantime) and then it is frozen. As we take system snapshot after the freeze, it is okay, because image is consistent.

I do not see a problem.
Pavel

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