[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-smp
Subject:    Re: stuck on TLB IPI wait (CPU#1)
From:       George <greerga () nidhogg ! ham ! muohio ! edu>
Date:       1999-05-31 19:23:30
[Download RAW message or body]

On Mon, 31 May 1999, Gunnar Thorburn wrote:

>I am wondering exactly the same thing because this error causes my machine
>to crash too (in quite the same way as yours).

It's caused by some subtle SMP thing.  Here's a patch which fixes the
symptom for me.  It basically reverts the changes to page_alloc.c in
2.2.0-pre6 to 2.2.0-pre7.

My test involved multi-threaded applications causing the system to run out
of memory.  With 128MB of RAM it died barely getting into swap.  At 32MB I
couldn't kill it and at 64MB it died around 50MB into swap.  So at least
with my test the problem was memory oriented.

It's not the right fix, but it may help. I see better swapping with this
anyway.

diff -u ../linux/mm/page_alloc.c ./linux/mm/page_alloc.c
--- ../linux/mm/page_alloc.c	Wed May 12 16:38:15 1999
+++ ./linux/mm/page_alloc.c	Mon May 31 15:11:04 1999
@@ -189,8 +189,6 @@
 	atomic_set(&map->count, 1); \
 } while (0)
 
-int low_on_memory = 0;
-
 unsigned long __get_free_pages(int gfp_mask, unsigned long order)
 {
 	unsigned long flags;
@@ -214,19 +212,14 @@
 	 * do our best to just allocate things without
 	 * further thought.
 	 */
-	if (!(current->flags & PF_MEMALLOC)) {
+	if (current->flags & PF_MEMALLOC)
+		goto ok_to_allocate;
+	else {
 		int freed;
 
-		if (nr_free_pages > freepages.min) {
-			if (!low_on_memory)
-				goto ok_to_allocate;
-			if (nr_free_pages >= freepages.high) {
-				low_on_memory = 0;
-				goto ok_to_allocate;
-			}
-		}
+		if (nr_free_pages > freepages.low)
+			goto ok_to_allocate;
 
-		low_on_memory = 1;
 		current->flags |= PF_MEMALLOC;
 		freed = try_to_free_pages(gfp_mask);
 		current->flags &= ~PF_MEMALLOC;

-George Greer

-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to majordomo@vger.rutgers.edu

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic