linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nigel Cunningham <ncunningham@clear.net.nz>
To: Patrick Mochel <mochel@osdl.org>
Cc: Pavel Machek <pavel@ucw.cz>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: SWSUSP Discontiguous pagedir patch
Date: Mon, 03 Mar 2003 15:06:14 +1300	[thread overview]
Message-ID: <1046657173.8669.30.camel@laptop-linux.cunninghams> (raw)
In-Reply-To: <Pine.LNX.4.33.0303021731510.1120-100000@localhost.localdomain>

Hi.

Thanks for your comments. I'll take a look at your rewrite. I'm
currently working on a port of the 2.4 beta, so I'm hoping we're not
going at cross-purposes here. 

> Thank you for putting this back in C, it's much appreciated. 

I know nothing about x86 assembly and have just been following the
existing code, so I can't claim any credit for this. do_magic in
assembly was just a cut and paste from suspend_asm.S so that I could get
things going with the PAGEDIR_ENTRY macro.

> Do you have something against indenting comments? ;)

Cut and paste from the original - not my comment :>

> This is better done as 
> 
> 	for (loop = 0; loop < nr_copy_pagse; loop++) {
> 		memcpy((char *)pagedir_nosave[loop].orig_address,
> 		       (char *)pagedir_nosave[loop].address,
> 		       PAGE_SIZE);
> 		__flush_tlb();
> 	}
> 
> Is __flush_tlb() really necessary? 

Pass. Once again, I'm blindly following the comment that says you can't
use memcpy. All of my changes are algorithm rewrites, not changes to the
'magic'.

> This, and the rest of the deleted patch, are dubious. Once you start
> adding 
> 
> - more page flag bits
> - functions that use double pointers
> 
> big warning alarms start going off I haven't looked that far into it yet,
> but I suspect there are some design issues there that should get resolved.

Longer term, I don't want to add page_flags. A page_flag was just here
because it was the simplest way of getting a working implementation. In
the long term I would use a dynamically allocated bitmap instead.

The double pointers where the true point to the patch. They are
necessary because my aim in future patches is to get 2.5 to the same
point as 2.4. Under 2.4, you can now suspend to disk without needing to
eat any memory (assuming enough swap etc). To achieve this, the pages of
the pagedir must be able to be scattered around memory. With the
existing code, you have to be able to allocate a contiguous set of pages
for the whole pagedir. Take for an example a suspend cycle I did this
morning:

Mar  3 07:45:07 laptop-linux kernel: Free:1343. Sets:7720(7891),21527. PD:170. Swap:29589/53139. RAM to suspend:29930; resume:17459. Limits:30592,0
[deletia]
Mar  3 07:45:07 laptop-linux kernel: - SWSUSP Version : beta 18
Mar  3 07:45:07 laptop-linux kernel: - Swap available : 53139 (amount unused when preparing image).
Mar  3 07:45:07 laptop-linux kernel: - Pageset sizes  : 7891 and 21527. (Pagedir size: 170)
Mar  3 07:45:07 laptop-linux kernel: - Expected sizes : 7891 and 21527.
Mar  3 07:45:07 laptop-linux kernel: - Parameters     : 1 0 255 255 0
Mar  3 07:45:07 laptop-linux kernel: - Calculations   : Image size: 29760. Ram to suspend: 30101. To resume: 17801.
Mar  3 07:45:07 laptop-linux kernel: - Limits         : 30592 pages RAM. Initial boot: 29435. Current boot: 0.

In order to save 29760 pages, I needed a pagedir of 170 pages. Using the
old code, I'd have to allocate 256 contiguous pages. With only 1343
available, what do you think my chances are? With the new functionality,
it's no problem. (I should mention that I've seen a way in which I can
reduce the pagedir size that this code uses - the struct this is using
is different to the one currently in 2.5, and I would keep using the 2.5
version. This might mean we would need 128 pages instead of 256 for the
same image size, but I'm sure you'll appreciate that the argument still
stands).

Regards,

Nigel


  reply	other threads:[~2003-03-03  1:53 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1045784829.3821.10.camel@laptop-linux.cunninghams>
     [not found] ` <20030223223757.GA120@elf.ucw.cz>
     [not found]   ` <1046136752.1784.15.camel@laptop-linux.cunninghams>
     [not found]     ` <20030227132024.GB27084@atrey.karlin.mff.cuni.cz>
2003-02-27 18:42       ` SWSUSP Discontiguous pagedirs Nigel Cunningham
2003-03-01  4:22       ` SWSUSP Discontiguous pagedir patch Nigel Cunningham
2003-03-02 23:55         ` Patrick Mochel
2003-03-03  2:06           ` Nigel Cunningham [this message]
2003-03-03  2:31           ` Nigel Cunningham
2003-03-03 12:30           ` Pavel Machek
2003-03-04 20:36             ` Patrick Mochel
2003-03-05 20:50               ` Pavel Machek
2003-03-05 21:52                 ` Linux vs Windows temperature anomaly Jonathan Lundell
2003-03-05 23:11                   ` Herman Oosthuysen
2003-03-05 23:38                     ` Con Kolivas
2003-03-05 23:50                       ` Russell King
2003-03-06  0:29                         ` Ed Sweetman
2003-03-06  0:47                           ` Trever L. Adams
2003-03-06  9:45                             ` Russell King
2003-03-06  1:58                           ` Jonathan Lundell
2003-03-06  7:18                       ` Corvus Corax
2003-03-06  7:57                         ` Ed Sweetman
2003-03-06  8:18                           ` Corvus Corax
2003-03-06  8:58                             ` Ed Sweetman
2003-03-06 15:41                               ` Jesse Pollard
2003-03-06 14:27                         ` Jesse Pollard
2003-03-06  2:57                   ` David Rees
2003-03-06  6:12                   ` Matthias Schniedermeyer
2003-03-06 16:07                     ` Jonathan Lundell
2003-03-07  0:40                   ` Horst von Brand
2003-03-05 18:02           ` SWSUSP Discontiguous pagedir patch Pavel Machek
2003-03-07 17:14             ` Patrick Mochel
2003-03-07 20:27               ` Pavel Machek
2003-03-09 19:39                 ` Benjamin Herrenschmidt
2003-03-09 20:12                   ` Pavel Machek
2003-03-10 16:49                 ` Patrick Mochel
2003-03-10 19:23                   ` Pavel Machek
2003-03-10 19:05                     ` Patrick Mochel
2003-03-10 22:17                     ` Nigel Cunningham
2003-03-10 23:20                       ` Pavel Machek
2003-03-07 20:36               ` Pavel Machek
2003-03-10 16:51                 ` Patrick Mochel
2003-03-10 19:12                   ` Pavel Machek
2003-03-10 18:59                     ` Patrick Mochel
2003-03-07 20:41               ` Pavel Machek

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=1046657173.8669.30.camel@laptop-linux.cunninghams \
    --to=ncunningham@clear.net.nz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.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 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).