From: Rik van Riel <riel@conectiva.com.br>
To: Roger Larsson <roger.larsson@norran.net>
Cc: Stephan von Krawczynski <skraw@ithnet.com>, linux-mm@kvack.org
Subject: Re: [PATCH RFC] higher order allocs 2.4.10-pre9-recycle-R1
Date: Sun, 16 Sep 2001 13:28:37 -0300 (BRST) [thread overview]
Message-ID: <Pine.LNX.4.33L.0109161327530.9536-200000@imladris.rielhome.conectiva> (raw)
In-Reply-To: <200109152258.f8FMwbK05717@mailc.telia.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 720 bytes --]
On Sun, 16 Sep 2001, Roger Larsson wrote:
> I have made some test runs - results are close to proper 2.4.10-pre9
> actually slightly better for all but two of mine testcases.
> diff of two files bigger than RAM got half throughput, why???
> mmap002 (use all memory attempt) took more than three times as long -
> less memory to use at once, OK. And not necessarily a bad thing.
These "test runs" are completely unrelated to memory fragmentation.
I don't know what you're thinking, but you could at least test the
thing you're trying to fix ...
regards,
Rik
--
IA64: a worthy successor to i860.
http://www.surriel.com/ http://distro.conectiva.com/
Send all your spam to aardvark@nl.linux.org (spam digging piggy)
[-- Attachment #2: Type: TEXT/X-DIFF, Size: 2232 bytes --]
*******************************************
Patch prepared by: roger.larsson@norran.net
Name of file: /home/roger/patches/patch-2.4.10-pre9-recycle-R1
--- linux/mm/page_alloc.c.orig Sat Sep 15 17:30:32 2001
+++ linux/mm/page_alloc.c Sun Sep 16 00:01:24 2001
@@ -104,7 +104,12 @@
spin_lock_irqsave(&zone->lock, flags);
- zone->free_pages -= mask;
+ area->recycled++;
+ if (area->recycled <= 0)
+ area->recycled=1;
+
+ if (!order || area->recycled < 0)
+ zone->free_pages -= mask;
while (mask + (1 << (MAX_ORDER-1))) {
struct page *buddy1, *buddy2;
@@ -193,9 +198,14 @@
index = page - zone->zone_mem_map;
if (curr_order != MAX_ORDER-1)
MARK_USED(index, curr_order, area);
- zone->free_pages -= 1 << order;
page = expand(zone, page, index, order, curr_order, area);
+ /* use initial area, requested order */
+ area=zone->free_area + order;
+ area->recycled--; /* might go neg, fixed in free */
+ if (!order || area->recycled < 0)
+ zone->free_pages -= 1 << order;
+
spin_unlock_irqrestore(&zone->lock, flags);
set_page_count(page, 1);
@@ -653,7 +663,8 @@
if (zone->size) {
spin_lock_irqsave(&zone->lock, flags);
for (order = 0; order < MAX_ORDER; order++) {
- head = &(zone->free_area + order)->free_list;
+ free_area_t *area = zone->free_area + order;
+ head = &area->free_list;
curr = head;
nr = 0;
for (;;) {
@@ -663,8 +674,9 @@
nr++;
}
total += nr * (1 << order);
- printk("%lu*%lukB ", nr,
- (PAGE_SIZE>>10) << order);
+ printk("%lu/%ld*%lukB ", nr,
+ area->recycled,
+ (PAGE_SIZE>>10) << order);
}
spin_unlock_irqrestore(&zone->lock, flags);
}
@@ -891,6 +903,7 @@
bitmap_size = LONG_ALIGN(bitmap_size+1);
zone->free_area[i].map =
(unsigned long *) alloc_bootmem_node(pgdat, bitmap_size);
+ zone->free_area[i].recycled = 0;
}
}
build_zonelists(pgdat);
--- linux/include/linux/mmzone.h.orig Sat Sep 15 21:58:47 2001
+++ linux/include/linux/mmzone.h Sat Sep 15 22:01:29 2001
@@ -21,6 +21,7 @@
typedef struct free_area_struct {
struct list_head free_list;
unsigned long *map;
+ long recycled;
} free_area_t;
struct pglist_data;
prev parent reply other threads:[~2001-09-16 16:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-15 22:53 Roger Larsson
2001-09-16 16:28 ` Rik van Riel [this message]
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.33L.0109161327530.9536-200000@imladris.rielhome.conectiva \
--to=riel@conectiva.com.br \
--cc=linux-mm@kvack.org \
--cc=roger.larsson@norran.net \
--cc=skraw@ithnet.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