From: Pavel Machek <pavel@ucw.cz>
To: Nigel Cunningham <ncunningham@clear.net.nz>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Patrick Mochel <mochel@osdl.org>, Andrew Morton <akpm@digeo.com>
Subject: Re: New Software Suspend Patch for testing.
Date: Sat, 5 Apr 2003 01:00:47 +0200 [thread overview]
Message-ID: <20030404230047.GA154@elf.ucw.cz> (raw)
In-Reply-To: <1049454721.2418.33.camel@laptop-linux.cunninghams>
Hi!
> The changes from the last version are not huge; perhaps most significant
> is that the dynamically allocated bitmaps (in place of pageflags) are
> implemented. This won't mean anything to most people, but Andrew
> Morton,
@@ -536,6 +519,9 @@
struct page *page;
int i;
int cold;
+#if CONFIG_SOFTWARE_SUSPEND
+ static unsigned int loopcount;
+#endif
if (wait)
might_sleep();
@@ -589,7 +575,23 @@
/* here we're in the low on memory slow path */
+#if CONFIG_SOFTWARE_SUSPEND
+ loopcount=0;
+#endif
rebalance:
+#ifdef CONFIG_SOFTWARE_SUSPEND
+ if(gfp_mask & __GFP_FAST) {
+/* when using memeat, we ask for all pages that are really free.
+ 5 calls to reschedule should be sufficient to recall all of them since
+ when a page can be found, it is after only one reschedule.
+ Actually I consider this as a bug of alloc_pages, since allocating a
+ page should not hang in an endless loop when it is clear that no
+ memory is available (cbd) */
+ loopcount++;
+ if(loopcount > 5)
+ return NULL;
+ }
+#endif
if ((current->flags & (PF_MEMALLOC | PF_MEMDIE)) && !in_interrupt()) {
/* go through the zonelist yet again, ignoring mins */
for (i = 0; zones[i] != NULL; i++) {
Again this is *really really* ugly. Why do you need it? 2.5. has
special function for freeing memory.
Pavel
--
When do you have heart between your knees?
next prev parent reply other threads:[~2003-04-04 22:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-04 11:12 New Software Suspend Patch for testing Nigel Cunningham
2003-04-04 13:30 ` Pavel Machek
2003-04-04 20:00 ` Nigel Cunningham
2003-04-04 23:03 ` Pavel Machek
2003-04-05 16:58 ` Alan Cox
2003-04-04 23:00 ` Pavel Machek [this message]
2003-04-15 20:06 ` Patrick Mochel
2003-04-15 21:33 ` Nigel Cunningham
2003-04-15 21:35 ` Patrick Mochel
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=20030404230047.GA154@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.org \
--cc=ncunningham@clear.net.nz \
/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