Patchwork fs / ext3: Always unlock updates in ext3_freeze()

login
register
mail settings
Submitter Pavel Machek
Date Aug. 25, 2011, 1:49 p.m.
Message ID <20110825134956.GA10476@ucw.cz>
Download mbox | patch
Permalink /patch/111573/
State New
Headers show

Comments

Pavel Machek - Aug. 25, 2011, 1:49 p.m.
Hi!

> > > > The problem really isn't XFS specific, nor is it new - the fact is
> > > > that any filesystem that has registered a shrinker or can do async
> > > > work in the background post-sync is vulnerable to this problem. It's
> > > 
> > > Should we avoid calling shrinkers while hibernating?
> > 
> > If you like getting random OOM problems when hibernating, then go
> > for it.  Besides, shrinkers are used for more than just filesystems,
> > so you might find you screw entire classes of users by doing this
> > (eg everyone using intel graphics and 3D).
> > 
> > > Or put BUG_ON()s into filesystem shrinkers so that this can not
> > > happen?
> > 
> > Definitely not. If your concern is filesystem shrinkers and you want
> > a large hammer to hit the problem with then do your hibernate
> > image allocation wih GFP_NOFS and the filesystem shrinkers will
> > abort without doing anything.
> 
> I think we can do that, actually.

I believe we should, yes. Question is if it helps much, because
various drivers (and userspace in case uswsusp?) will still trigger
GFP_KERNEL allocations.

Something like this?
Rafael J. Wysocki - Aug. 25, 2011, 2:33 p.m.
On Thursday, August 25, 2011, Pavel Machek wrote:
> Hi!
> 
> > > > > The problem really isn't XFS specific, nor is it new - the fact is
> > > > > that any filesystem that has registered a shrinker or can do async
> > > > > work in the background post-sync is vulnerable to this problem. It's
> > > > 
> > > > Should we avoid calling shrinkers while hibernating?
> > > 
> > > If you like getting random OOM problems when hibernating, then go
> > > for it.  Besides, shrinkers are used for more than just filesystems,
> > > so you might find you screw entire classes of users by doing this
> > > (eg everyone using intel graphics and 3D).
> > > 
> > > > Or put BUG_ON()s into filesystem shrinkers so that this can not
> > > > happen?
> > > 
> > > Definitely not. If your concern is filesystem shrinkers and you want
> > > a large hammer to hit the problem with then do your hibernate
> > > image allocation wih GFP_NOFS and the filesystem shrinkers will
> > > abort without doing anything.
> > 
> > I think we can do that, actually.
> 
> I believe we should, yes. Question is if it helps much, because
> various drivers (and userspace in case uswsusp?) will still trigger
> GFP_KERNEL allocations.
> 
> Something like this?
> 
> --- snapshot.c.ofic	2011-08-25 15:48:41.000000000 +0200
> +++ snapshot.c	2011-08-25 15:49:07.000000000 +0200
> @@ -1107,7 +1107,7 @@
>  
>  /* Helper functions used for the shrinking of memory. */
>  
> -#define GFP_IMAGE	(GFP_KERNEL | __GFP_NOWARN)
> +#define GFP_IMAGE	(GFP_NODS | __GFP_NOWARN)

Surely GFP_NOFS?

>  
>  /**
>   * preallocate_image_pages - Allocate a number of pages for hibernation image
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- snapshot.c.ofic	2011-08-25 15:48:41.000000000 +0200
+++ snapshot.c	2011-08-25 15:49:07.000000000 +0200
@@ -1107,7 +1107,7 @@ 
 
 /* Helper functions used for the shrinking of memory. */
 
-#define GFP_IMAGE	(GFP_KERNEL | __GFP_NOWARN)
+#define GFP_IMAGE	(GFP_NODS | __GFP_NOWARN)
 
 /**
  * preallocate_image_pages - Allocate a number of pages for hibernation image