From: Joshua Aas <josha@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: free bootmem feedback patch
Date: Tue, 13 Jul 2004 22:59:46 +0000 [thread overview]
Message-ID: <40F46962.4090604@sgi.com> (raw)
Hello,
NUMA machines with a lot of memory/nodes appear to hang when freeing boot memory, as it can take on the order of 4 minutes. I would like to propose this patch, which adds progress feedback during this time. On a machine with only one memory region (a single node), it prints:
Freeing boot memory... done
It prints more dots every x nodes handled based on the total number of nodes, in such a way that the line never exceeds 80 chars. This way it is possible to see progress being made. I have tested this on a few machines, including a 512p/512GB machine, and it works fine.
Please apply.
Signed-off-by: Josh Aas <josha@sgi.com>
-----------------------------------------------------------------------
--- linux-2.6.7-clean/arch/ia64/mm/init.c 2004-06-16 00:19:22.000000000 -0500
+++ linux-2.6.7/arch/ia64/mm/init.c 2004-07-13 15:25:46.000000000 -0500
@@ -516,7 +516,7 @@ mem_init (void)
long reserved_pages, codesize, datasize, initsize;
unsigned long num_pgt_pages;
pg_data_t *pgdat;
- int i;
+ int i, pgdat_count;
static struct kcore_list kcore_mem, kcore_vmem, kcore_kernel;
#ifdef CONFIG_PCI
@@ -540,8 +540,29 @@ mem_init (void)
kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
kclist_add(&kcore_kernel, _stext, _end - _stext);
+ /*
+ * Give nice feedback while freeing boot memory. Each entry in pgdat corresponds to
+ * a memory zone, presumably a node in a NUMA machine. We need nice feedback so that
+ * machines with lots of nodes/memory don't appear to be hanging.
+ */
+ printk(KERN_INFO "Freeing boot memory...");
+# define NUM_FREE_BOOT_MEM_MSG_CHAR_COUNT 27 /* 22 + 5 for done message */
+ pgdat_count = 0;
+ i = 0;
for_each_pgdat(pgdat)
+ pgdat_count++;
+ pgdat_count = (pgdat_count / (80 - NUM_FREE_BOOT_MEM_MSG_CHAR_COUNT)) - 1;
+ for_each_pgdat(pgdat) {
totalram_pages += free_all_bootmem_node(pgdat);
+ if (i = pgdat_count) {
+ printk(".");
+ i = 0;
+ }
+ else {
+ i++;
+ }
+ }
+ printk(" done\n");
reserved_pages = 0;
efi_memmap_walk(count_reserved_pages, &reserved_pages);
-----------------------------------------------------------------------
--
Josh Aas
Silicon Graphics, Inc. (SGI)
Linux System Software
651-683-3068
next reply other threads:[~2004-07-13 22:59 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-13 22:59 Joshua Aas [this message]
2004-07-13 23:14 ` free bootmem feedback patch 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
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=40F46962.4090604@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 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.