From: Rik van Riel <riel@conectiva.com.br>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-mm@kvack.org
Subject: [patch2] pre8 VM stable
Date: Mon, 15 May 2000 16:11:56 -0300 (BRST) [thread overview]
Message-ID: <Pine.LNX.4.21.0005151611010.20410-100000@duckman.distro.conectiva> (raw)
Hi Linus,
here is the second version of the patch, with the
leak fixed and per-zonelist status.
regards,
Rik
--
The Internet is not a network of computers. It is a network
of people. That is its real strength.
Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies
http://www.conectiva.com/ http://www.surriel.com/
--- mm/page_alloc.c.orig Fri May 12 20:13:08 2000
+++ mm/page_alloc.c Mon May 15 15:57:06 2000
@@ -243,6 +243,9 @@
if (page)
return page;
}
+ /* Somebody else is freeing pages? */
+ if (atomic_read(&zonelist->free_before_allocate))
+ try_to_free_pages(zonelist->gfp_mask);
}
/*
@@ -270,7 +273,11 @@
*/
if (!(current->flags & PF_MEMALLOC)) {
int gfp_mask = zonelist->gfp_mask;
- if (!try_to_free_pages(gfp_mask)) {
+ int result;
+ atomic_inc(&zonelist->free_before_allocate);
+ result = try_to_free_pages(gfp_mask);
+ atomic_dec(&zonelist->free_before_allocate);
+ if (!result) {
if (!(gfp_mask & __GFP_HIGH))
goto fail;
}
@@ -414,6 +421,7 @@
zonelist = pgdat->node_zonelists + i;
memset(zonelist, 0, sizeof(*zonelist));
+ atomic_set(&zonelist->free_before_allocate, 0);
zonelist->gfp_mask = i;
j = 0;
k = ZONE_NORMAL;
--- include/linux/mmzone.h.orig Mon May 15 15:47:39 2000
+++ include/linux/mmzone.h Mon May 15 15:48:04 2000
@@ -70,6 +70,7 @@
typedef struct zonelist_struct {
zone_t * zones [MAX_NR_ZONES+1]; // NULL delimited
int gfp_mask;
+ atomic_t free_before_allocate;
} zonelist_t;
#define NR_GFPINDEX 0x100
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
reply other threads:[~2000-05-15 19:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=Pine.LNX.4.21.0005151611010.20410-100000@duckman.distro.conectiva \
--to=riel@conectiva.com.br \
--cc=linux-mm@kvack.org \
--cc=torvalds@transmeta.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