From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@ucw.cz>
Cc: LKML <linux-kernel@vger.kernel.org>,
Nigel Cunningham <ncunningham@linuxmail.org>,
Hu Gang <hugang@soulinfo.com>
Subject: Re: [RFC][PATCH] swsusp: do not use higher order allocations on resume [update 2]
Date: Tue, 8 Feb 2005 23:28:00 +0100 [thread overview]
Message-ID: <200502082328.00937.rjw@sisk.pl> (raw)
In-Reply-To: <20050208191001.GB2544@elf.ucw.cz>
On Tuesday, 8 of February 2005 20:10, Pavel Machek wrote:
> Hi!
>
> > > so it is okay, but...
> >
> > ... I could have done it more elegantly. You're right, I've now introduced
> > a function eat_page() that adds a page to the list of unusable pages and
> > used it instead of the free_page() here.
>
> Thanks.
>
> > > > + p = pbe;
> > > > + pbe += PB_PAGE_SKIP;
> > > > + do
> > > > + p->next = p + 1;
> > > > + while (p++ < pbe);
> > >
> > > I've already seen this code somewhere around in different
> > > variant... Perhaps you want to make it inline function?
> >
> > I tried to avoid modifying the suspend part, but if it's not a problem,
> > why don't we go farther and reuse alloc_pagedir() in the resume code?
> >
> > It has the advantage that read_pagedir() is then much simpler, and it
> > returns an integer. However, for this purpose, it's better to split
> > alloc_pagedir() into two functions, one of which allocates memory pages,
> > and the second puts the list structure on them.
>
> I guess that modifying suspend part is okay. We do not want to have
> two copies of similar code...
>
> > > > + if(!(pagedir_nosave = swsusp_pagedir_relocate(p)))
> > > > + return -ENOMEM;
> > >
> > > Same here.
> >
> > The value is used in error reporting and the only reason why this function
> > may fail is the lack of memory (the same applies to alloc_pagedir()).
> >
> > The revised (not as thoroughly tested as the previous one, but hopefully
> > nicer) patch follows.
>
> I guess I'll wait for "reuse alloc_pagedir" version.
It's this one. :-)
Greets,
Rafael
--
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
-- Lewis Carroll "Alice's Adventures in Wonderland"
next prev parent reply other threads:[~2005-02-08 22:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-30 23:19 [RFC][PATCH] swsusp: do not use higher order memory allocations on resume Rafael J. Wysocki
2005-01-31 23:19 ` [RFC][PATCH] swsusp: do not use higher order memory allocations [update] Rafael J. Wysocki
2005-02-07 11:08 ` [RFC][PATCH] swsusp: do not use higher order allocations on resume [update 2] Rafael J. Wysocki
2005-02-07 14:27 ` Pavel Machek
2005-02-07 14:45 ` Rafael J. Wysocki
2005-02-07 16:23 ` Pavel Machek
2005-02-08 18:29 ` Rafael J. Wysocki
2005-02-08 19:10 ` Pavel Machek
2005-02-08 22:28 ` Rafael J. Wysocki [this message]
2005-02-08 22:42 ` Pavel Machek
2005-02-08 23:22 ` Rafael J. Wysocki
2005-02-13 5:54 ` hugang
2005-02-13 6:11 ` hugang
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=200502082328.00937.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=hugang@soulinfo.com \
--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 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®