The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* XFS vs. swsusp
@ 2006-07-31 21:59 Pavel Machek
  2006-07-31 22:41 ` Nathan Scott
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2006-07-31 21:59 UTC (permalink / raw)
  To: nathans, kernel list, Rafael J. Wysocki

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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: XFS vs. swsusp
  2006-07-31 21:59 XFS vs. swsusp Pavel Machek
@ 2006-07-31 22:41 ` Nathan Scott
  2006-07-31 22:53   ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Scott @ 2006-07-31 22:41 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list, Rafael J. Wysocki, xfs

On Mon, Jul 31, 2006 at 11:59:33PM +0200, Pavel Machek wrote:
> Hi!

Hi there,

> 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.

> 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.

-- 
Nathan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: XFS vs. swsusp
  2006-07-31 22:41 ` Nathan Scott
@ 2006-07-31 22:53   ` Pavel Machek
  2006-07-31 23:23     ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2006-07-31 22:53 UTC (permalink / raw)
  To: Nathan Scott; +Cc: kernel list, Rafael J. Wysocki, xfs

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).
> 
> 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.

> > 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.

> 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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: XFS vs. swsusp
  2006-07-31 22:53   ` Pavel Machek
@ 2006-07-31 23:23     ` Rafael J. Wysocki
  2006-08-01  0:47       ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2006-07-31 23:23 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Nathan Scott, kernel list, xfs

Hi,

On Tuesday 01 August 2006 00:53, Pavel Machek wrote:
> > > 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.
> 
> > > 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.
> 
> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: XFS vs. swsusp
  2006-07-31 23:23     ` Rafael J. Wysocki
@ 2006-08-01  0:47       ` Pavel Machek
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2006-08-01  0:47 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Nathan Scott, kernel list, xfs

Hi!

> > > 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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-01  0:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-31 21:59 XFS vs. swsusp Pavel Machek
2006-07-31 22:41 ` Nathan Scott
2006-07-31 22:53   ` Pavel Machek
2006-07-31 23:23     ` Rafael J. Wysocki
2006-08-01  0:47       ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox