LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nigel Cunningham <ncunningham@linuxmail.org>
To: Pavel Machek <pavel@suse.cz>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Suspend2 merge preparation: Rationale behind the freezer changes.
Date: Sat, 22 May 2004 12:43:32 +1000	[thread overview]
Message-ID: <40AEBE54.4050702@linuxmail.org> (raw)
In-Reply-To: <20040521133422.GG10052@elf.ucw.cz>

Hi.

Pavel Machek wrote:
>>No... this is what you already know, just described differently. You 
>>mentioned in your documentation that suspend2 overcomes the half of 
>>memory limitation by saving the image in two parts: the second part is 
>>LRU (unless I have my terminology confused: I'm talking about pages on 
> 
> 
> Yes, I just did not realize that it means changes for freezer.

It means that we need to be more careful to ensure that processes all 
processes are frozen than we do with your implementation: we can't have 
processes forking or exiting because a timer fires while we're writing 
the first part of the image. (I saw that happen with bad effects).

>>Yes, but we're not just talking about user threads. We could 
>>differentiate kernel threads and user threads (presumably using another 
>>PF_ flag?) and attempt to freeze the user threads first.
> 
> There should be some other way to see kernel threads... their mm is
> init_mm or something like that.

Yes.

> Did you add hooks into sys_read() to deal with with
> kernel-thread-vs-kernel-thread ordering?

With the hooks, I don't have to worry about ordering at all. Once the 
atomic_t comes down to zero, every process has either entered the 
refrigerator because it hit a start/restart hook or wasn't doing 
anything to start with. I don't have to care about ordering because 
anything that does start activity while I'm signalling hits a hook and 
gets refrigerated anyway, even if it's not in response to the pseudo-signal.

> Well, slowness is likely to be something like 1% at
> microbenchmark. (Try lm_bench, test "lat-read" or something like
> that). Of course you don't feel any slowness; but you'd probably not
> feel any slowness if kernel was compiled -O0 either. 

:>. I'll put benchmarking on my todo list...

>>Summary:
>>- I'll try your user space first, kernel space afterwards suggestion.
>>- I'll also look into benchmarking the system with and without suspend2 
>>compiled in (ie with and without the hooks, since they compile away to 
>>nothing without CONFIG_SOFTWARE_SUSPEND2
> 
> 
> Don't spend too much time benchmarking... But you might want to ask Al
> Viro what he thinks about another test in sys_read ;-).

... and won't spend too long on it :>. I think I can guess.

Nigel

-- 
Nigel & Michelle Cunningham
C/- Westminster Presbyterian Church Belconnen
61 Templeton Street, Cook, ACT 2614.
+61 (2) 6251 7727(wk); +61 (2) 6254 0216 (home)

Evolution (n): A hypothetical process whereby infinitely improbable 
events occur
with alarming frequency, order arises from chaos, and no one is given 
credit.

  reply	other threads:[~2004-05-22  2:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-17  6:49 Nigel Cunningham
2004-05-21  9:33 ` Pavel Machek
2004-05-21 12:28   ` Nigel Cunningham
2004-05-21 13:34     ` Pavel Machek
2004-05-22  2:43       ` Nigel Cunningham [this message]
2004-05-21 13:42     ` Oliver Neukum
2004-05-21 17:08       ` Pavel Machek
2004-05-21 17:12         ` Oliver Neukum
2004-05-21 17:15           ` Pavel Machek
2004-05-21 17:20             ` Oliver Neukum
2004-05-21 23:35               ` Herbert Xu
2004-05-22  2:47                 ` Nigel Cunningham
2004-05-21 22:32       ` Nigel Cunningham
2004-05-22 14:11         ` Bill Davidsen

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=40AEBE54.4050702@linuxmail.org \
    --to=ncunningham@linuxmail.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --subject='Re: Suspend2 merge preparation: Rationale behind the freezer changes.' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).