All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org
Subject: Re: lazy_buddy-2.5.25-1
Date: Fri, 12 Jul 2002 23:22:32 -0700	[thread overview]
Message-ID: <20020713062232.GC21551@holomorphy.com> (raw)
In-Reply-To: <20020710085917.GP25360@holomorphy.com>

On Wed, Jul 10, 2002 at 01:59:17AM -0700, William Lee Irwin III wrote:
> This patch implements deferred coalescing for the Linux page-level
[...]
> TODO:
[...]
> (5)  use split_free_pages() to recover pages from higher-order
> 	deferred queues to avoid spuriously failing under fragmentation

Okay, people bugged me about this so here it is, testbooted on an
8cpu 16GB i386 box:

Cheers,
Bill


===== mm/page_alloc.c 1.129 vs edited =====
--- 1.129/mm/page_alloc.c	Wed Jul 10 22:09:41 2002
+++ edited/mm/page_alloc.c	Fri Jul 12 22:55:45 2002
@@ -344,6 +344,26 @@
 	}
 }
 
+static struct page *FASTCALL(steal_deferred_page(zone_t *, int));
+static struct page *steal_deferred_page(zone_t *zone, int order)
+{
+	struct page *page;
+	free_area_t *area = zone->free_area;
+	int found_order;
+
+	for (found_order = order+1; found_order < MAX_ORDER; ++found_order)
+		if (!list_empty(&area[found_order].deferred_pages))
+			goto found_page;
+
+	return NULL;
+
+found_page:
+	page = list_entry(area[found_order].deferred_pages.next, struct page, list);
+	list_del(&page->list);
+	area[found_order].locally_free--;
+	split_pages(zone, page, order, found_order);
+}
+
 #ifdef CONFIG_SOFTWARE_SUSPEND
 int is_head_of_free_region(struct page *page)
 {
@@ -391,8 +411,12 @@
 		area->locally_free--;
 	} else
 		page = buddy_alloc(zone, order);
-	if (unlikely(!page))
+	if (unlikely(!page)) {
+		page = steal_deferred_page(zone, order);
+		if (likely(!page))
 		goto out;
+	}
+
 	prep_new_page(page);
 	area->active++;
 	zone->free_pages -= 1UL << order;

  parent reply	other threads:[~2002-07-13  6:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-10  8:59 lazy_buddy-2.5.25-1 William Lee Irwin III
2002-07-11  4:49 ` lazy_buddy-2.5.25-1 William Lee Irwin III
2002-07-11  5:02   ` lazy_buddy-2.5.25-1 William Lee Irwin III
2002-07-11  5:11     ` lazy_buddy-2.5.25-1 William Lee Irwin III
2002-07-13  6:22 ` William Lee Irwin III [this message]
2002-07-13  6:29   ` lazy_buddy-2.5.25-1 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=20020713062232.GC21551@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.