All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Nigel Cunningham <ncunningham@crca.org.au>
Cc: linux-pm@lists.linux-foundation.org, Jiri Slaby <jirislaby@gmail.com>
Subject: Re: [RFC 09/15] PM / Hibernate: user, 	implement user_ops writer
Date: Mon, 5 Apr 2010 01:13:56 +0200	[thread overview]
Message-ID: <201004050113.56521.rjw@sisk.pl> (raw)
In-Reply-To: <4BB91BEC.6030906@crca.org.au>

On Monday 05 April 2010, Nigel Cunningham wrote:
> Hi again.
> 
> On 01/04/10 08:36, Rafael J. Wysocki wrote:
> >>>> Regarding using LRU pages as temporary storage, if it wasn't safe and
> >>>> reliable, I would have stopped doing it ages ago.
> >>>
> >>> We've been through that already and as you can see I'm still not convinced.
> >>> Sorry, but that's how it goes.  The fact that ToI uses this approach without
> >>> seeing any major breakage is a good indication that it _may_ be safe in
> >>> general, not that it _is_ safe in all cases one can imagine.
> >>
> >> It's not "any major breakage", but no breakage at all over a course of
> >> about 6 or 7 years of usage. I agree that it's not mathematical proof,
> >> but still...
> >
> > I'd say without any reported breakage you could blame on the usage of LRU
> > pages.  But I think even if such things were reported, it wouldn't be really
> > straightforward to track them down to the LRU, because they wouldn't be
> > reproducible.
> 
> That depends on the cause. There are only so many things that can change 
> the contents of the LRU. Freezing tasks significantly reduces that 
> number, and with memory allocation tracking, it shouldn't be that hard 
> to figure out what caused the issue - especially when we find the 
> problem while atomic and can therefore dump etc data structures without 
> worrying about locking. Ugly, yes. But it would reliably find the cause.

Possibly.

However, I think we can also do something different.  Namely, add a mechanism
tracking modifications of the LRU pages like copy-on-write.  We can safely
assume that the number of LRU pages modified during hibernation will be very
limited, so it should be possible to keep some spare pages for saving them
if need be and use the following high-level hibernation algorithm:
- freeze tasks
- make room for atomic copying of non-LRU memory
- freeze devices
- create the copy of non-LRU memory, start monitoring LRU
- thaw devices
- save the copy of non-LRU memory and the contents of LRU pages
  to the storage; if an LRU page is modified in the process, copy its contents
  to a spare page (before the modification) and save it later (that can be done
  using pages previously used to store the copy of non-LRU memory that have
  been already saved)

That sounds pretty straightforward to me and doesn't seem to depend on
assumptions that would be difficult to verify.

> >>> Besides, that would be a constraint on the future changes of the mm subsystem
> >>> that I'm not sure we should introduce.  At least the mm people would need to
> >>> accept that and there's a long way before we're even able to ask them.
> >>
> >> It doesn't need to be that way. As with KMS, a simple way of flagging
> >> which pages need to be atomically copied is all that's necessary.
> >
> > I'm not sure about that.
> >
> > Besides, assuming that the LRU pages are really safe, I'd prefer to save them
> > directly as a part of the image along with the atomic copy instead of using
> > them as temporary storage.
> 
> We're obviously not going to agree on this. Can we nevertheless find a 
> way ahead in which we're both happy?

I believe so.

> Seek to minimise the differences, even if some of the TuxOnIce code isn't
> merged?

Sure.

Thanks,
Rafael

  reply	other threads:[~2010-04-04 23:13 UTC|newest]

Thread overview: 158+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23 16:17 [RFC 01/15] FS: libfs, implement simple_write_to_buffer Jiri Slaby
2010-03-23 16:17 ` Jiri Slaby
2010-03-23 16:17 ` [RFC 02/15] PM / Hibernate: snapshot cleanup Jiri Slaby
2010-03-24 20:29   ` Pavel Machek
2010-03-24 20:29   ` Pavel Machek
2010-03-24 22:35   ` Rafael J. Wysocki
2010-03-24 22:35   ` Rafael J. Wysocki
2010-03-25  5:29   ` Pavel Machek
2010-03-25  5:29   ` Pavel Machek
2010-03-23 16:17 ` Jiri Slaby
2010-03-23 16:17 ` [RFC 03/15] PM / Hibernate: separate block_io Jiri Slaby
2010-03-23 16:17 ` Jiri Slaby
2010-03-24 20:30   ` Pavel Machek
2010-03-24 20:30   ` Pavel Machek
2010-03-24 21:22     ` Jiri Slaby
2010-03-24 22:58       ` Nigel Cunningham
2010-03-25  2:35         ` Nigel Cunningham
2010-03-25  2:35         ` [linux-pm] " Nigel Cunningham
2010-03-25 20:12           ` Rafael J. Wysocki
2010-03-25 20:12           ` [linux-pm] " Rafael J. Wysocki
2010-03-25 20:13             ` Nigel Cunningham
2010-03-25 20:13             ` [linux-pm] " Nigel Cunningham
2010-03-25 20:33               ` Rafael J. Wysocki
2010-03-25 20:33               ` [linux-pm] " Rafael J. Wysocki
2010-03-25 20:36                 ` Nigel Cunningham
2010-03-25 20:36                 ` Nigel Cunningham
2010-03-29 13:30             ` Pavel Machek
2010-03-29 13:30             ` [linux-pm] " Pavel Machek
2010-03-25 14:29         ` Pavel Machek
2010-03-25 14:29         ` Pavel Machek
2010-03-24 22:58       ` Nigel Cunningham
2010-03-24 21:22     ` Jiri Slaby
2010-03-23 16:17 ` [RFC 04/15] PM / Hibernate: move the first_sector out of swsusp_write Jiri Slaby
2010-03-24 20:31   ` Pavel Machek
2010-03-24 20:31   ` Pavel Machek
2010-03-25 21:26     ` Rafael J. Wysocki
2010-03-25 21:26     ` Rafael J. Wysocki
2010-03-23 16:17 ` Jiri Slaby
2010-03-23 16:17 ` [RFC 05/15] PM / Hibernate: group swap ops Jiri Slaby
2010-03-25 21:28   ` Rafael J. Wysocki
2010-03-25 21:28   ` Rafael J. Wysocki
2010-03-23 16:17 ` Jiri Slaby
2010-03-23 16:17 ` [RFC 06/15] PM / Hibernate: swap, remove swap_map_handle usages Jiri Slaby
2010-03-24 20:33   ` Pavel Machek
2010-03-24 21:29     ` Jiri Slaby
2010-03-24 21:29     ` Jiri Slaby
2010-03-25 21:35       ` Rafael J. Wysocki
2010-03-25 21:35       ` Rafael J. Wysocki
2010-03-24 20:33   ` Pavel Machek
2010-03-23 16:17 ` Jiri Slaby
2010-03-23 16:17 ` [RFC 07/15] PM / Hibernate: add sws_modules_ops Jiri Slaby
2010-03-24 20:36   ` Pavel Machek
2010-03-24 21:31     ` Jiri Slaby
2010-03-24 21:31     ` Jiri Slaby
2010-03-24 20:36   ` Pavel Machek
2010-03-25 22:02   ` Rafael J. Wysocki
2010-03-25 22:02   ` Rafael J. Wysocki
2010-03-23 16:17 ` Jiri Slaby
2010-03-23 16:17 ` [RFC 08/15] PM / Hibernate: add user module_ops Jiri Slaby
2010-03-23 16:17   ` Jiri Slaby
2010-03-25 22:07   ` Rafael J. Wysocki
2010-03-26  9:43     ` Jiri Slaby
2010-03-26  9:43     ` Jiri Slaby
2010-03-25 22:07   ` Rafael J. Wysocki
2010-03-23 16:17 ` [RFC 09/15] PM / Hibernate: user, implement user_ops writer Jiri Slaby
2010-03-24 20:42   ` Pavel Machek
2010-03-24 21:40     ` Jiri Slaby
2010-03-24 21:40     ` Jiri Slaby
2010-03-25 21:36       ` Pavel Machek
2010-03-25 21:36       ` Pavel Machek
2010-03-25 22:14       ` Rafael J. Wysocki
2010-03-25 22:14       ` Rafael J. Wysocki
2010-03-26  9:34         ` Jiri Slaby
2010-03-26 22:04           ` Rafael J. Wysocki
2010-03-29 15:33             ` Jiri Slaby
2010-03-29 15:33             ` Jiri Slaby
2010-03-29 22:09               ` Rafael J. Wysocki
2010-03-30  1:14                 ` Nigel Cunningham
2010-03-30 21:03                   ` Rafael J. Wysocki
2010-03-31  2:31                     ` Nigel Cunningham
2010-03-31 14:47                       ` Pavel Machek
2010-03-31 21:01                         ` Nigel Cunningham
2010-03-31 20:25                       ` Rafael J. Wysocki
2010-03-31 21:06                         ` Nigel Cunningham
2010-03-31 21:36                           ` Rafael J. Wysocki
2010-04-04 23:08                             ` Nigel Cunningham
2010-04-04 23:13                               ` Rafael J. Wysocki [this message]
2010-03-31 21:54                           ` Nigel Cunningham
2010-03-30  8:59                 ` Jiri Slaby
2010-03-30 20:50                   ` Rafael J. Wysocki
2010-03-31 14:41                     ` Jiri Slaby
2010-03-31 20:29                       ` Rafael J. Wysocki
2010-04-21 21:22                         ` Jiri Slaby
2010-04-22  3:43                           ` Rafael J. Wysocki
2010-03-26 22:04           ` Rafael J. Wysocki
2010-03-27  7:02           ` Pavel Machek
2010-03-27  7:02           ` Pavel Machek
2010-03-26  9:34         ` Jiri Slaby
2010-03-24 20:42   ` Pavel Machek
2010-03-23 16:17 ` Jiri Slaby
2010-03-23 16:17 ` [RFC 10/15] PM / Hibernate: user, implement user_ops reader Jiri Slaby
2010-03-25  5:30   ` what the patches do " Pavel Machek
2010-03-25  5:42     ` Nigel Cunningham
2010-03-25  6:12       ` Nigel Cunningham
2010-03-25  6:12       ` [linux-pm] " Nigel Cunningham
2010-03-25 20:14       ` Rafael J. Wysocki
2010-03-25 20:14       ` Rafael J. Wysocki
2010-03-25 20:21         ` Nigel Cunningham
2010-03-25 20:21         ` Nigel Cunningham
2010-03-25 20:29           ` Rafael J. Wysocki
2010-03-25 20:29           ` Rafael J. Wysocki
2010-03-25 20:35             ` Nigel Cunningham
2010-03-25 21:13               ` Rafael J. Wysocki
2010-03-25 21:13               ` Rafael J. Wysocki
2010-03-25 20:35             ` Nigel Cunningham
2010-03-25 21:26             ` Pavel Machek
2010-03-25 21:26             ` Pavel Machek
2010-03-25 21:49               ` [linux-pm] " Nigel Cunningham
2010-04-02  6:36                 ` Pavel Machek
2010-04-02  6:36                 ` [linux-pm] " Pavel Machek
2010-04-02 17:03                   ` Rafael J. Wysocki
2010-04-02 17:03                   ` [linux-pm] " Rafael J. Wysocki
2010-03-25 21:49               ` Nigel Cunningham
2010-03-25  5:42     ` Nigel Cunningham
2010-03-25 22:21     ` Rafael J. Wysocki
2010-03-25 22:21     ` Rafael J. Wysocki
2010-03-25  5:30   ` Pavel Machek
2010-03-23 16:17 ` Jiri Slaby
2010-03-23 16:17 ` [RFC 11/15] PM / Hibernate: add chunk i/o support Jiri Slaby
2010-03-23 16:17 ` Jiri Slaby
2010-03-25 22:38   ` Rafael J. Wysocki
2010-03-25 22:38   ` Rafael J. Wysocki
2010-03-26  9:09     ` Jiri Slaby
2010-03-26  9:09     ` Jiri Slaby
2010-03-26 10:02       ` Nigel Cunningham
2010-03-26 10:02       ` Nigel Cunningham
2010-03-23 16:17 ` [RFC 12/15] PM / Hibernate: split snapshot_read_next Jiri Slaby
2010-03-23 16:17 ` Jiri Slaby
2010-03-25 22:44   ` Rafael J. Wysocki
2010-03-25 22:44   ` Rafael J. Wysocki
2010-03-23 16:17 ` [RFC 13/15] PM / Hibernate: split snapshot_write_next Jiri Slaby
2010-03-25 22:46   ` Rafael J. Wysocki
2010-03-25 22:46   ` Rafael J. Wysocki
2010-03-23 16:17 ` Jiri Slaby
2010-03-23 16:17 ` [RFC 14/15] PM / Hibernate: dealign swsusp_info Jiri Slaby
2010-03-23 16:17 ` Jiri Slaby
2010-03-25 22:46   ` Rafael J. Wysocki
2010-03-25 22:46   ` Rafael J. Wysocki
2010-03-23 16:17 ` [RFC 15/15] PM / Hibernate: move non-swap code to snapshot.c Jiri Slaby
2010-03-23 16:17 ` Jiri Slaby
2010-03-25 22:50   ` Rafael J. Wysocki
2010-03-25 22:50   ` Rafael J. Wysocki
2010-03-23 21:51 ` [RFC 01/15] FS: libfs, implement simple_write_to_buffer Rafael J. Wysocki
2010-03-23 21:51 ` Rafael J. Wysocki
2010-03-23 22:09 ` [linux-pm] " Nigel Cunningham
2010-03-23 22:09 ` Nigel Cunningham
2010-03-24 22:13 ` Rafael J. Wysocki
2010-03-24 22:13 ` 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=201004050113.56521.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=jirislaby@gmail.com \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=ncunningham@crca.org.au \
    /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.