All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Nigel Cunningham <ncunningham@linuxmail.org>
Cc: Andrew Morton <akpm@osdl.org>, Pavel Machek <pavel@ucw.cz>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Freeze bdevs when freezing processes.
Date: Tue, 24 Oct 2006 09:57:38 +0200	[thread overview]
Message-ID: <200610240957.38965.rjw@sisk.pl> (raw)
In-Reply-To: <1161643965.7033.12.camel@nigel.suspend2.net>

Hi,

On Tuesday, 24 October 2006 00:52, Nigel Cunningham wrote:
> Hi.
> 
> On Mon, 2006-10-23 at 21:19 +0200, Rafael J. Wysocki wrote:
> > On Monday, 23 October 2006 19:50, Andrew Morton wrote:
> > > > On Mon, 23 Oct 2006 19:14:50 +0200 Pavel Machek <pavel@ucw.cz> wrote:
> > > > On Mon 2006-10-23 09:55:22, Andrew Morton wrote:
> > > > > > On Mon, 23 Oct 2006 16:07:16 +0200 "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> > > > > > > I'm trying to prepare the patches to make swsusp into suspend2.
> > > > > > 
> > > > > > Oh, I see.  Please don't do that.
> > > > > 
> > > > > Why not?
> > 
> > Generally, we already do many things that suspend2 just duplicates and there's
> > one thing in suspend2 I really don't like, which is the use of LRU pages as
> > temporary storage.
> 
> The duplicated things obviously won't be merged (unless they're doing it
> better somehow), so there's no issue there.

OK (as long as there are no doubts the new code is doing things better ;-))

> As to the use of LRU pages, this can be disabled with a simple sysfs
> setting, so it doesn't need to be a big issue.

I'm sorry, but I don't think it can be merged at all as long as we are not
100% sure it's safe.  Currently, we aren't.

> > > > Last time I checked, suspend2 was 15000 lines of code, including its
> > > > own plugin system and special user-kernel protocol for drawing
> > > > progress bar (netlink based). It also did parts of user interface from
> > > 
> > > That's different.
> > > 
> > > I don't know where these patches are leading, but thus far they look like
> > > reasonable cleanups and generalisations.  So I suggest we just take them
> > > one at a time.
> > 
> > Well, the patch for the freezeing of bdevs contains a memory leak that I have
> > already pointed to Nigel for three times, it leads to some problems in the
> > error paths, AFAICT, and "solves" a problem that doesn't really exist in the
> > current code.
> 
> There's no memory leak. In Suspend2 (and I believe swsusp, but will
> admit I haven't carefully checked), every call to freeze processes has a
> matching call to thaw them. The thaw call will invoke make_fses_rw,
> which will free the memory that was allocated. If there's an issue, it's
> that in the failure path thaw_bdev can be called when freeze_bdev was
> never invoked. Having just realised that, I've just fixed it.

I was talking about the leak in the error path, where you exit the function
without freeing the already allocated objects.

> Regarding the problem not existing, I'll try to find time to reproduce
> it later in the day. Maybe the XFS guys have fixed it since I last
> checked, but I do know there was a real issue (even if you haven't seen
> it). That said, yesterday was my Red Hat day, so I'm not promising that
> I'll be quick.

Of course if you are able to show there is a problem, I won't be against this
patch.

> > Some time ago I posted a very similar patch and we discussed it with the XFS
> > people.  In conclusion we decided not to apply it.
> > 
> > The patch that causes kernel threads to be thawed temporarily before we
> > attempt to free some memory doesn't look bad, but it's not needed for the
> > reason given by Nigel.  It may be needed for another reason, but I think we
> > should know why we apply it before we do so.
> 
> I'll seek to address this too.
> 
> > I have no specific objections with respect to the other patches except I'd
> > like to understand the patch that adds extents for the handling of swap before
> > I say I like it or not.
> > 
> > > > OTOH, that was half a year ago, but given that uswsusp can now do most
> > > > of the stuff suspend2 does (and without that 15000 lines of code), I
> > > > do not think we want to do complete rewrite of swsusp now.
> > > 
> > > uswsusp seems like a bad idea to me.
> > 
> > Could you please explain why exactly?
> > 
> > > We'd be better off concentrating on a simple, clean in-kernel thing which
> > > *works*. 
> > 
> > This depends on the point of view.  I test both swsusp and uswsusp on a regular
> > basis on 5 different boxes and they both work flawlessly (except when some
> > rogue patch breaks them, but that's a different story).
> > 
> > > Right now the main problems with swsusp are that it's slow and that there
> > > are driver problems.  (Actually these are both driver problems).
> > 
> > Well, suspend2 is not about drivers.  It's all about the "core", ie. memory
> > management, saving/restoring the image etc.
> > 
> > As far as the drivers are concerned, we (I, Pavel, Nigel and even you) can't
> > fix all of them and it really is a challenge to do something that will cause
> > them to be fixed.
> > 
> > In the meantime we fix some things that _we_ can address, like the handling
> > of highmem, the PAE-related issue on i386 etc.
> 
> Agreed.
> 
> > > Fiddling with the top-level interfaces doesn't address either of these core
> > > problems.
> > 
> > No, it doesn't, but for example it's the correct way of handling the resume
> > from an initrd image, IMHO.
> > 
> > > Apparently uswsusp has gained support for S3 while the in-kernel driver
> > > does not support S3.  That's disappointing.
> > 
> > The problem with that is on _many_ boxes we have to handle the video in a
> > special way before and after S3, and it is only possible from the user
> > space.  This was one of the reasons why we decided to develop the userland
> > suspend.
> 
> But that's a different issue - uswsusp is suspend to disk. Your s2ram
> thing is suspend to ram (although I guess you're somehow invoking it as
> a library or something for suspend to disk + ram).

Yes, we support the suspend to disk+RAM which also needs the video-related
black magic.

Greetings,
Rafael


-- 
You never change things by fighting the existing reality.
		R. Buckminster Fuller

  reply	other threads:[~2006-10-24  7:58 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-23  4:12 [PATCH] Freeze bdevs when freezing processes Nigel Cunningham
2006-10-23 10:36 ` Rafael J. Wysocki
2006-10-23 12:09   ` Nigel Cunningham
2006-10-23 14:07     ` Rafael J. Wysocki
2006-10-23 14:15       ` Nick Piggin
2006-10-23 14:20         ` Rafael J. Wysocki
2006-10-23 23:05           ` Nigel Cunningham
2006-10-23 16:55       ` Andrew Morton
2006-10-23 17:14         ` Pavel Machek
2006-10-23 17:50           ` Andrew Morton
2006-10-23 18:06             ` Pavel Machek
2006-10-23 19:19             ` Rafael J. Wysocki
2006-10-23 22:52               ` Nigel Cunningham
2006-10-24  7:57                 ` Rafael J. Wysocki [this message]
2006-10-24  8:21                   ` Nigel Cunningham
2006-10-23 21:39             ` Matthew Garrett
2006-10-23 22:12               ` Rafael J. Wysocki
2006-10-24  7:58               ` Pavel Machek
2006-10-23 22:58             ` Nigel Cunningham
2006-10-24  8:01               ` Pavel Machek
2006-10-23 23:22       ` Nigel Cunningham
2006-10-24  8:37         ` Rafael J. Wysocki
2006-10-24 14:44   ` David Chinner
2006-10-24 15:29     ` Rafael J. Wysocki
2006-10-24 16:20       ` Oleg Verych
2006-10-24 16:27         ` Oleg Verych
2006-10-24 17:08         ` Christoph Hellwig
2006-10-25  8:05         ` Pavel Machek
2006-10-24 16:33       ` David Chinner
2006-10-24 21:37         ` Pavel Machek
2006-10-25  0:13           ` David Chinner
2006-10-25  8:10             ` Pavel Machek
2006-10-25  8:38               ` David Chinner
2006-10-25  8:47                 ` Pavel Machek
2006-10-25 12:32                   ` Rafael J. Wysocki
2006-10-25 13:23                     ` Nigel Cunningham
2006-10-25 19:05                       ` Rafael J. Wysocki
2006-10-26  7:30                         ` David Chinner
2006-10-26  8:18                           ` Nigel Cunningham
2006-10-26  8:48                             ` Rafael J. Wysocki
2006-10-26  8:57                             ` David Chinner
2006-10-26  9:11                               ` Rafael J. Wysocki
2006-10-27  1:38                                 ` David Chinner
2006-10-27 14:37                                   ` Rafael J. Wysocki
2006-10-29 17:35                                   ` Pavel Machek
2006-10-29 23:29                                     ` Rafael J. Wysocki
2006-10-29 23:46                                       ` Nigel Cunningham
2006-10-26  9:18                               ` Nigel Cunningham
2006-10-26  9:08                             ` Rafael J. Wysocki
2006-10-25  8:12             ` Rafael J. Wysocki
2006-10-24 17:06       ` Christoph Hellwig
2006-10-24 19:09         ` Rafael J. Wysocki
2006-10-24 21:26         ` Pavel Machek
2006-10-24 21:33           ` Christoph Hellwig
2006-10-24 21:43             ` Pavel Machek
2006-10-24 22:19     ` Nigel Cunningham
2006-10-24 20:16 ` Rafael J. Wysocki
2006-10-24 22:17   ` Nigel Cunningham
2006-10-24 20:38 ` Christoph Hellwig

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=200610240957.38965.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncunningham@linuxmail.org \
    --cc=pavel@ucw.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.