public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Josh Aas <josha@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: Re: free bootmem feedback patch
Date: Fri, 06 Aug 2004 14:11:50 +0000	[thread overview]
Message-ID: <411391A6.1040904@sgi.com> (raw)
In-Reply-To: <40F46962.4090604@sgi.com>

[-- Attachment #1: Type: text/plain, Size: 1562 bytes --]

Attached is an improved version of Tony Luck's patch. It shaves another 
~25% off by not using atomic ops to clear the page reserved bits and 
prefetching. Tony - will you sign off on it with me and we'll get this in?

Unfortunately, this still leaves a ~1 minute delay with no indication of 
what is going on for 4TB machines, and ~2 minutes for 8TB. Thus, I'd 
still like to see my progrees indicator patch go in. I am guessing 
memory sizes are only going to get bigger than even 8 TB, and memory is 
not going to get faster at the rate the totals increase (it certainly 
didn't double in speed between 4 and 8 TB installations). Thoughts?

Signed-off-by: Josh Aas <josha@sgi.com>

-Josh

William Lee Irwin III wrote:
> On Tue, Aug 03, 2004 at 12:53:53PM -0500, Josh Aas wrote:
> 
>>Are there any outstanding issues with Tony's second revision of the 
>>free_all_bootmem_core function? Do we still have the problem of making 
>>sure longwork in node_bootmem_map[] corresponds to an order 6 page with 
>>the right physical alignment? The second revision looks good to me. If I 
>>could get some more feedback on it I'll clean up any remaining issues so 
>>it can land sometime soon. I'll post test results (unpatched vs. 
>>patched) on a big machine later this afternoon.
> 
> 
> I think it's fine.
> 
> On Tue, Aug 03, 2004 at 12:53:53PM -0500, Josh Aas wrote:
> 
>>wli - do you still want to see the memory map for my big test machine 
>>(512GB RAM)?
> 
> 
> Sure.
> 
> 
> -- wli

-- 
Josh Aas
Silicon Graphics, Inc. (SGI)
Linux System Software
651-683-3068

[-- Attachment #2: bootmem3.patch --]
[-- Type: text/x-patch, Size: 1470 bytes --]

--- a/mm/bootmem.c	2004-08-05 15:33:39.000000000 -0500
+++ b/mm/bootmem.c	2004-08-05 16:25:05.000000000 -0500
@@ -259,6 +259,7 @@ static unsigned long __init free_all_boo
 	unsigned long i, count, total = 0;
 	unsigned long idx;
 	unsigned long *map; 
+	int gofast = 0;
 
 	BUG_ON(!bdata->node_bootmem_map);
 
@@ -267,14 +268,32 @@ static unsigned long __init free_all_boo
 	page = virt_to_page(phys_to_virt(bdata->node_boot_start));
 	idx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT);
 	map = bdata->node_bootmem_map;
+	if (bdata->node_boot_start == 0 ||
+	    ffs(bdata->node_boot_start) - PAGE_SHIFT > ffs(BITS_PER_LONG))
+		gofast = 1;
 	for (i = 0; i < idx; ) {
 		unsigned long v = ~map[i / BITS_PER_LONG];
-		if (v) {
+		if (gofast && v == ~0UL) {
+			int j;
+
+			count += BITS_PER_LONG;
+			(page)->flags &= ~(1UL << PG_reserved);
+			set_page_count(page, 1);
+			for (j = 1; j < BITS_PER_LONG; j++) {
+				if (j + 16 < BITS_PER_LONG) {
+                      			prefetchw(page + j + 16);
+                                }
+				(page + j)->flags &= ~(1UL << PG_reserved);
+			}	
+			__free_pages(page, ffs(BITS_PER_LONG)-1);
+			i += BITS_PER_LONG;
+			page += BITS_PER_LONG;
+		} else if (v) {
 			unsigned long m;
 			for (m = 1; m && i < idx; m<<=1, page++, i++) {
 				if (v & m) {
 					count++;
-					ClearPageReserved(page);
+					(page)->flags &= ~(1UL << PG_reserved);	
 					set_page_count(page, 1);
 					__free_page(page);
 				}

  parent reply	other threads:[~2004-08-06 14:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-13 22:59 free bootmem feedback patch Joshua Aas
2004-07-13 23:14 ` Luck, Tony
2004-07-13 23:52 ` Joshua Aas
2004-07-14  8:44 ` Andi Kleen
2004-07-14  9:17 ` William Lee Irwin III
2004-07-14  9:19 ` William Lee Irwin III
2004-07-14 16:17 ` Joshua Aas
2004-07-14 18:34 ` Luck, Tony
2004-07-14 22:12 ` William Lee Irwin III
2004-07-15 19:11 ` Luck, Tony
2004-07-15 19:31 ` Matthew Wilcox
2004-07-15 20:21 ` David Mosberger
2004-07-15 23:16 ` William Lee Irwin III
2004-07-15 23:34 ` Matthew Wilcox
2004-07-15 23:53 ` Luck, Tony
2004-07-16  0:09 ` David Mosberger
2004-07-16  0:11 ` William Lee Irwin III
2004-07-16  0:18 ` Matthew Wilcox
2004-07-16  0:18 ` William Lee Irwin III
2004-08-03 17:53 ` Josh Aas
2004-08-03 23:53 ` William Lee Irwin III
2004-08-06 14:11 ` Josh Aas [this message]
2004-08-06 14:17 ` William Lee Irwin III
2004-08-06 17:58 ` Luck, Tony
2004-08-06 18:27 ` Josh Aas
2004-08-06 20:09 ` Luck, Tony
2004-08-06 20:51 ` 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=411391A6.1040904@sgi.com \
    --to=josha@sgi.com \
    --cc=linux-ia64@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox