public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@ucw.cz>
Cc: Christoph <cr2005@u-club.de>, LKML <linux-kernel@vger.kernel.org>,
	xfs@oss.sgi.com, Christoph Hellwig <hch@infradead.org>,
	Nigel Cunningham <nigel@tuxonice.net>,
	Linux PM mailing list <linux-pm@lists.linux-foundation.org>
Subject: Re: [RFC][PATCH] PM / Freezer: Freeze filesystems along with freezing processes (was: Re: PM / hibernate xfs lock up / xfs_reclaim_inodes_ag)
Date: Thu, 4 Aug 2011 11:27:30 +0200	[thread overview]
Message-ID: <201108041127.30944.rjw@sisk.pl> (raw)
In-Reply-To: <20110803172922.GA2126@ucw.cz>

On Wednesday, August 03, 2011, Pavel Machek wrote:
> Hi!
> 
> > Freeze all filesystems during the freezing of tasks by calling
> > freeze_bdev() for each of them and thaw them during the thawing
> > of tasks with the help of thaw_bdev().
> > 
> > This is needed by hibernation, because some filesystems (e.g. XFS)
> > deadlock with the preallocation of memory used by it if the memory
> > pressure caused by it is too heavy.
> > 
> > The additional benefit of this change is that, if something goes
> > wrong after filesystems have been frozen, they will stay in a
> > consistent state and journal replays won't be necessary (e.g. after
> > a failing suspend or resume).  In particular, this should help to
> > solve a long-standing issue that in some cases during resume from
> > hibernation the boot loader causes the journal to be replied for the
> > filesystem containing the kernel image and initrd causing it to
> > become inconsistent with the information stored in the hibernation
> > image.
> 
> > +/**
> > + * freeze_filesystems - Force all filesystems into a consistent state.
> > + */
> > +void freeze_filesystems(void)
> > +{
> > +	struct super_block *sb;
> > +
> > +	lockdep_off();
> 
> Ouch. So... why do we need to silence this?

So that it doesn't complain? :-)

I'll need some time to get the exact details here.

> > +	/*
> > +	 * Freeze in reverse order so filesystems dependant upon others are
> > +	 * frozen in the right order (eg. loopback on ext3).
> > +	 */
> > +	list_for_each_entry_reverse(sb, &super_blocks, s_list) {
> > +		if (!sb->s_root || !sb->s_bdev ||
> > +		    (sb->s_frozen == SB_FREEZE_TRANS) ||
> > +		    (sb->s_flags & MS_RDONLY) ||
> > +		    (sb->s_flags & MS_FROZEN))
> > +			continue;
> 
> Should we stop NFS from modifying remote server, too?

What do you mean exactly?

> Plus... ext3 writes to read-only filesystems on mount; not sure if it
> does it later. But RDONLY means 'user cant write to it' not 'bdev will
> not be modified'. Should we freeze all?
> 
> How can 'already frozen' happen?
> 
> > +	list_for_each_entry(sb, &super_blocks, s_list)
> > +		if (sb->s_flags & MS_FROZEN) {
> > +			sb->s_flags &= ~MS_FROZEN;
> > +			thaw_bdev(sb->s_bdev, sb);
> > +		}
> 
> ...because we'll unfreeze it even if we did not freeze it...

So we need not check MS_FROZEN in freeze_filesystems().  OK

Thanks,
Rafael

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2011-08-04  9:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 16:05 PM / hibernate xfs lock up / xfs_reclaim_inodes_ag Christoph
2011-07-13  0:03 ` Dave Chinner
2011-07-26 20:28   ` Rafael J. Wysocki
2011-07-27  0:45     ` Dave Chinner
2011-07-27  9:35       ` Rafael J. Wysocki
2011-07-27 10:33         ` Christoph Hellwig
2011-07-27 12:22           ` Nigel Cunningham
2011-08-03 21:15             ` [RFC][PATCH] PM / Freezer: Freeze filesystems along with freezing processes (was: Re: PM / hibernate xfs lock up / xfs_reclaim_inodes_ag) Rafael J. Wysocki
     [not found]               ` <20110803172922.GA2126@ucw.cz>
2011-08-04  9:27                 ` Rafael J. Wysocki [this message]
2011-08-04 22:25                   ` Rafael J. Wysocki
2011-08-06 21:17                     ` [PATCH] PM / Freezer: Freeze filesystems while freezing processes (v2) Rafael J. Wysocki
2011-08-07  0:14                       ` Dave Chinner
2011-08-08 21:11                         ` Rafael J. Wysocki
2011-08-14  0:16                         ` Rafael J. Wysocki
2011-09-24 22:56                         ` Rafael J. Wysocki
2011-09-25  5:32                           ` Nigel Cunningham
2011-09-25 13:37                             ` Rafael J. Wysocki
2011-09-25 10:38                           ` Christoph
2011-09-25 13:32                             ` Rafael J. Wysocki
2011-09-25 21:57                               ` Christoph
2011-09-25 22:10                                 ` Rafael J. Wysocki
2011-09-26  5:27                                   ` Christoph
2011-10-22 15:14                                   ` Christoph
2011-10-22 21:35                                     ` Rafael J. Wysocki
2011-11-16 13:49                                       ` Ferenc Wagner
2011-11-16 21:50                                         ` Rafael J. Wysocki
2011-09-25 13:40                           ` [Update][PATCH] PM / Hibernate: Freeze kernel threads after preallocating memory Rafael J. Wysocki
2011-08-10 21:43         ` PM / hibernate xfs lock up / xfs_reclaim_inodes_ag Pavel Machek
2011-08-16 12:38           ` Christoph
2011-08-16 18:05             ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201108041127.30944.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=cr2005@u-club.de \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=nigel@tuxonice.net \
    --cc=pavel@ucw.cz \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox