linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave McCracken <dmccr@us.ibm.com>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.4.19-pre2] Make max_threads be based on normal zone size
Date: Fri, 01 Mar 2002 11:38:47 -0600	[thread overview]
Message-ID: <71650000.1015004327@baldur> (raw)

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


The max_threads config parameter (used to determine how many tasks to
allow) is currently calculated based on the total amount of physical memory
in the machine.  This is wrong, since the real limiting factor is the
amount of memory in the normal zone.

This patch fixes the initialization of max_threads by allowing an
architecture to specify how much memory is in the normal zone, and using
that value to initialize max_threads.

My apologies for sending it as an attachment, but I don't trust my mail
client not to screw up an inline patch.

Dave McCracken

======================================================================
Dave McCracken          IBM Linux Base Kernel Team      1-512-838-3059
dmccr@us.ibm.com                                        T/L   678-3059

[-- Attachment #2: memsize-2.4.19-pre2.diff --]
[-- Type: text/plain, Size: 2372 bytes --]

--- linux-2.4.19-pre2/./init/main.c	Thu Feb 28 16:06:01 2002
+++ linux-2.4.19-pre2-memsize/./init/main.c	Fri Mar  1 09:44:15 2002
@@ -348,7 +348,6 @@
 asmlinkage void __init start_kernel(void)
 {
 	char * command_line;
-	unsigned long mempages;
 	extern char saved_command_line[];
 /*
  * Interrupts are still disabled. Do necessary setups, then
@@ -399,13 +398,21 @@
 	kmem_cache_sizes_init();
 	pgtable_cache_init();
 
-	mempages = num_physpages;
-
-	fork_init(mempages);
+	/*
+	 * For architectures that have highmem, num_mappedpages represents
+	 * the amount of memory the kernel can use.  For other architectures
+	 * it's the same as the total pages.  We need both numbers because
+	 * some subsystems need to initialize based on how much memory the
+	 * kernel can use.
+	 */
+	if (num_mappedpages == 0)
+		num_mappedpages = num_physpages;
+  
+	fork_init(num_mappedpages);
 	proc_caches_init();
-	vfs_caches_init(mempages);
-	buffer_init(mempages);
-	page_cache_init(mempages);
+	vfs_caches_init(num_physpages);
+	buffer_init(num_physpages);
+	page_cache_init(num_physpages);
 #if defined(CONFIG_ARCH_S390)
 	ccwcache_init();
 #endif
--- linux-2.4.19-pre2/./mm/memory.c	Thu Feb 28 16:06:02 2002
+++ linux-2.4.19-pre2-memsize/./mm/memory.c	Thu Feb 28 16:34:06 2002
@@ -52,6 +52,7 @@
 
 unsigned long max_mapnr;
 unsigned long num_physpages;
+unsigned long num_mappedpages;
 void * high_memory;
 struct page *highmem_start_page;
 
--- linux-2.4.19-pre2/./include/linux/mm.h	Thu Feb 28 16:06:01 2002
+++ linux-2.4.19-pre2-memsize/./include/linux/mm.h	Fri Mar  1 09:44:17 2002
@@ -15,6 +15,7 @@
 
 extern unsigned long max_mapnr;
 extern unsigned long num_physpages;
+extern unsigned long num_mappedpages;
 extern void * high_memory;
 extern int page_cluster;
 /* The inactive_clean lists are per zone. */
--- linux-2.4.19-pre2/./arch/i386/mm/init.c	Fri Dec 21 11:41:53 2001
+++ linux-2.4.19-pre2-memsize/./arch/i386/mm/init.c	Thu Feb 28 16:34:06 2002
@@ -462,8 +462,9 @@
 #ifdef CONFIG_HIGHMEM
 	highmem_start_page = mem_map + highstart_pfn;
 	max_mapnr = num_physpages = highend_pfn;
+	num_mappedpages = max_low_pfn;
 #else
-	max_mapnr = num_physpages = max_low_pfn;
+	max_mapnr = num_mappedpages = num_physpages = max_low_pfn;
 #endif
 	high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
 

             reply	other threads:[~2002-03-01 17:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-01 17:38 Dave McCracken [this message]
     [not found] <71650000.1015004327@baldur.suse.lists.linux.kernel>
2002-03-01 18:14 ` [PATCH 2.4.19-pre2] Make max_threads be based on normal zone size Andi Kleen
2002-03-01 18:19 ` Dave McCracken

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=71650000.1015004327@baldur \
    --to=dmccr@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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;
as well as URLs for NNTP newsgroup(s).