mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Andrew Morton <akpm@osdl.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] swsusp: move snapshot-handling functions to snapshot.c
Date: Mon, 31 Oct 2005 22:59:38 +0100	[thread overview]
Message-ID: <20051031215938.GB14877@elf.ucw.cz> (raw)
In-Reply-To: <200510310135.42190.rjw@sisk.pl>

Hi!

> > Can you elaborate? resume is certainly going to get list of pbes...
> 
> OK
> On x86-64 we have to allocate a few safe pages to put the temporary page
> tables on them.  In principle I can imagine the following code for this:
> 
> do {
> 	get a page;
> 	walk the list of pbes to verify that the page is safe;
> 	if (the page is not safe)
> 		keep track of it;
> } while (the page is not safe)
> 
> but I'd rather not like to propose Andi to merge it. ;-)  Currently the x86-64 arch
> code uses the same method of marking non-safe pages that is used by
> the rest of swsusp for efficiency and I think it should stay this
> way.

Ok, I see.

> > > - sys_create_pagedir
> > 
> > Ugly...
> 
> Oh, it can be done on-the-fly in
> sys_put_this_stuff_where_appropriate(image data) (at the expense of one
> redundant check per call).

Yes, but it is still ugly, as you keep some context across the
syscalls.

> > > Cleanup: /* certainly something's gone wrong */
> > > - sys_destroy_pagedir /* that's it */
> > > - sys_resume_devices
> > 
> > You should not need to do this one. resuming devices is going to be
> > integrated in atomic_restore, because suspending devices is there, too.
> 
> Yes, but I need to thaw processes anyway, so I can release memory as well.
> OTOH, if sys_atomic_restore fails because of the lack of memory, the memory
> should be freed _before_ resuming devices, since otherwise subsequent
> failures are almost certain to appear (I've seen what happens in that case).
> Now, if the memory is allocated by the kernel, I can easily put an
> emergency memory-freeing call in sys_atomic_restore (in that case
> sys_destroy_pagedir will be redundant, but so what?).

Ugh, I'd say "don't care about this one too much". If resume is
failing, we have bad problems anyway.

> > Here's how it looks... additionaly, I have ioctl for getting one
> > usable page. It is true that I did not solve error paths, yet; I'll
> > certainly need some way to free memory, too.
> 
> IMHO, these are important issues.

Yes, but I do not expect any problems while actually coding that...

								Pavel
-- 
Thanks, Sharp!

  reply	other threads:[~2005-10-31 21:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-30 15:37 [PATCH 0/3] swsusp: code separation continued Rafael J. Wysocki
2005-10-30 15:40 ` [PATCH 1/3] swsusp: rework swsusp_suspend Rafael J. Wysocki
2005-10-30 17:54   ` Ingo Oeser
2005-10-30 21:18     ` Rafael J. Wysocki
2005-10-30 15:44 ` [PATCH 2/3] swsusp: move snapshot-handling functions to snapshot.c Rafael J. Wysocki
2005-10-30 19:52   ` Pavel Machek
2005-10-30 21:16     ` Rafael J. Wysocki
2005-10-30 21:28       ` Pavel Machek
2005-10-30 22:37         ` Rafael J. Wysocki
2005-10-30 23:04           ` Pavel Machek
2005-10-31  0:35             ` Rafael J. Wysocki
2005-10-31 21:59               ` Pavel Machek [this message]
2005-11-01 18:29                 ` Rafael J. Wysocki
2005-11-01 21:04                   ` Pavel Machek
2005-11-01 23:53                     ` Rafael J. Wysocki
2005-11-02 21:08                       ` Pavel Machek
2005-10-31 19:36     ` Rafael J. Wysocki
2005-10-31 22:02       ` Pavel Machek
2005-11-01 12:57         ` Rafael J. Wysocki
2005-11-01 17:33           ` [PATCH 1/2] swsusp: reduce code duplication (was: Re: [PATCH 2/3] swsusp: move snapshot-handling functions to snapshot.c) Rafael J. Wysocki
2005-11-01 17:37             ` [PATCH 2/2] swsusp: simplify pagedir relocation Rafael J. Wysocki
2005-11-01 21:11               ` Pavel Machek
2005-11-01 23:15                 ` Rafael J. Wysocki
2005-11-01 21:09             ` [PATCH 1/2] swsusp: reduce code duplication (was: Re: [PATCH 2/3] swsusp: move snapshot-handling functions to snapshot.c) Pavel Machek
2005-10-30 15:48 ` [PATCH 3/3] swsusp: move swap check out of swsusp_suspend 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=20051031215938.GB14877@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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

all inboxes | Powered by JetHome®