From: Coywolf Qi Hunt <coywolf@greatcn.org>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org
Subject: [BUG FIX] [PATCH] fork_init() max_low_pfn fixes potential OOM bug on big highmem machine
Date: Mon, 28 Jun 2004 23:55:29 +0800 [thread overview]
Message-ID: <40E03F71.8010902@greatcn.org> (raw)
<http://localhost/lxr/ident?i=start_kernel>Hello all,
On machine with 16G(or 8G if 4k stacks) or more memory, high max_threads
could let system run out of low memory.
This patch decides max_threads by the amount of low memory instead of
the total physical memory.
Systems without high memory would not be affected.
Coywolf
=====================================================================
diff -rup linux-2.6.7/init/main.c linux-2.6.7-cy/init/main.c
--- linux-2.6.7/init/main.c Wed Jun 9 00:07:40 2004
+++ linux-2.6.7-cy/init/main.c Thu Jun 17 04:55:54 2004
@@ -467,7 +467,7 @@ asmlinkage void __init start_kernel(void
if (efi_enabled)
efi_enter_virtual_mode();
#endif
- fork_init(num_physpages);
+ fork_init(max_low_pfn);
proc_caches_init();
buffer_init();
unnamed_dev_init();
diff -rup linux-2.6.7/kernel/fork.c linux-2.6.7-cy/kernel/fork.c
--- linux-2.6.7/kernel/fork.c Wed Jun 9 00:07:40 2004
+++ linux-2.6.7-cy/kernel/fork.c Mon Jun 28 22:55:50 2004
@@ -224,8 +224,8 @@ void __init fork_init(unsigned long memp
/*
* The default maximum number of threads is set to a safe
- * value: the thread structures can take up at most half
- * of memory.
+ * value: the thread structures can take up at most 1/8
+ * of low memory.
*/
max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8;
/*
--
Coywolf Qi Hunt
Admin of http://GreatCN.org and http://LoveCN.org
next reply other threads:[~2004-06-28 15:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-28 15:55 Coywolf Qi Hunt [this message]
2004-06-28 16:53 ` [BUG FIX] [PATCH] fork_init() max_low_pfn fixes potential OOM bug on big highmem machine Russell King
2004-06-29 10:48 ` Coywolf Qi Hunt
2004-06-29 10:58 ` Russell King
2004-06-30 9:56 ` [BUG FIX] [ARM/ARM26] find_memend_and_nodes bug fix Coywolf Qi Hunt
2004-06-29 11:11 ` [BUG FIX] [PATCH] fork_init() max_low_pfn fixes potential OOM bug on big highmem machine Chris Wedgwood
2004-06-30 10:43 ` [BUG FIX] fork_init() " Coywolf Qi Hunt
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=40E03F71.8010902@greatcn.org \
--to=coywolf@greatcn.org \
--cc=akpm@osdl.org \
--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.