mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: William Lee Irwin III <wli@holomorphy.com>,
	kernel list <linux-kernel@vger.kernel.org>,
	ACPI mailing list <acpi-devel@lists.sourceforge.net>
Subject: Re: suspend-to-{RAM,disk} for 2.5.17
Date: Wed, 29 May 2002 00:00:32 +0200	[thread overview]
Message-ID: <20020528220032.GA3476@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20020521222858.GA14737@elf.ucw.cz> <20020527194018.GQ14918@holomorphy.com> <20020528193220.GB189@elf.ucw.cz> <20020528210917.GU14918@holomorphy.com> <20020528211120.GA28189@atrey.karlin.mff.cuni.cz> <20020528212427.GV14918@holomorphy.com> <20020528213408.GE28189@atrey.karlin.mff.cuni.cz> <20020528215318.GW14918@holomorphy.com>

Hi!

> >> Actually, I just thought of something that might be useful in addition,
> >> which is that it would probably only be necessary to search inside of
> >> page_zone(page), do you agree?
> 
> On Tue, May 28, 2002 at 11:34:08PM +0200, Pavel Machek wrote:
> > Hey, speeding this up is not a top priority. But.. if we can make it
> > simpler as well ... ;-).
> 
> Yeah, system startup/shutdown isn't really something to optimize for
> aside from dodging some worst cases (which is not relevant here).
> 
> 
> On Tue, May 28, 2002 at 11:34:08PM +0200, Pavel Machek wrote:
> > #ifdef CONFIG_SOFTWARE_SUSPEND
> > int is_head_of_free_region(struct page *page)
> > {
> >         zone_t *zone = page_zone(page);
> >         unsigned long flags;
> >         int order;
> >         list_t *curr;
> > 
> >         /*
> >          * Should not matter as we need quiescent system for
> >          * suspend anyway, but...
> >          */
> >         spin_lock_irqsave(&zone->lock, flags);
> >         for (order = MAX_ORDER - 1; order >= 0; --order)
> >                 list_for_each(curr, &zone->free_area[order].free_list){
> >                         if (!curr)
> >                                 break;
> >                         if (page == list_entry(curr, struct page,list)) {
> >                                 spin_unlock_irqrestore(&zone->lock,flags);
> >                                 return 1 << order;
> >                         }
> >                 }
> >         spin_unlock_irqrestore(&zone->lock, flags);
> >         return 0;
> > }
> > #endif /* CONFIG_SOFTWARE_SUSPEND */
> > Does that look okay to you?
> > 							Pavel
> 
> This looks good, though OTOH if we have a page from a zone we should know
> the zone exists, and then maybe the if (!curr) check isn't
> >> needed. If that's

Good point. Killed.

> the case the scary check that almost looks like defensive programming won't
> be needed at all. Also, is it always expected that this will be a
> free page?

No. It may be used page, too. That's why it is asking. 
								Pavel
-- 
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.

  reply	other threads:[~2002-05-28 22:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-21 22:28 Pavel Machek
2002-05-21 23:01 ` Linus Torvalds
2002-05-21 23:15   ` Linus Torvalds
2002-05-21 23:27     ` Pavel Machek
2002-05-21 23:40     ` Pavel Machek
2002-05-21 23:20   ` Pavel Machek
2002-05-21 23:26     ` Linus Torvalds
2002-05-21 23:33       ` Pavel Machek
2002-05-22  0:09         ` Linus Torvalds
2002-05-22  0:15           ` Pavel Machek
2002-05-22  6:49   ` Martin Dalecki
2002-05-22  9:00     ` Pavel Machek
2002-05-22 10:03     ` Xavier Bestel
2002-05-22  9:03       ` Martin Dalecki
2002-05-22 10:35         ` Albert D. Cahalan
2002-05-22 10:42         ` Xavier Bestel
2002-05-22 12:54       ` Frank v Waveren
2002-05-22 15:59       ` Linus Torvalds
2002-05-25 13:30 ` Geert Uytterhoeven
2002-05-26 17:20   ` Pavel Machek
2002-05-27 19:40 ` William Lee Irwin III
2002-05-28 19:20   ` Pavel Machek
2002-05-28 19:32   ` Pavel Machek
2002-05-28 21:09     ` William Lee Irwin III
2002-05-28 21:11       ` Pavel Machek
2002-05-28 21:24         ` William Lee Irwin III
2002-05-28 21:34           ` Pavel Machek
2002-05-28 21:53             ` William Lee Irwin III
2002-05-28 22:00               ` Pavel Machek [this message]
2002-05-28 22:28                 ` William Lee Irwin III

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=20020528220032.GA3476@atrey.karlin.mff.cuni.cz \
    --to=pavel@suse.cz \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wli@holomorphy.com \
    /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®