Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: axp-list@redhat.com
Subject: Re: [Fwd: Alpha SMP problem]
Date: Wed, 8 Nov 2000 14:15:43 -0800	[thread overview]
Message-ID: <20001108141543.A27935@twiddle.net> (raw)
In-Reply-To: <3A09B857.79DB9BB2@appnet.com>

On Wed, Nov 08, 2000 at 03:32:23PM -0500, Jeff Sturm wrote:
> Honestly I didn't try your program, but I wouldn't consider blaming the
> kernel or glibc as long as your code is incorrect.

I did blame his code until I fixed it and it still failed.
The following is actually the best fix; nothing needs to be
made volatile, just add write-memory-barriers appropriately.

The Big Issue is that sometimes one gets not segmentation
faults, but illegal instruction faults.  This is a hallmark
of incorrect TLB or ASN handling.


r~


--- malloctest-old.c	Thu Nov  2 11:05:16 2000
+++ malloctest.c	Thu Nov  2 14:37:33 2000
@@ -57,13 +57,13 @@ void Free(void *m)
 		while (!mem->delete)
 			Th_Delay(1);
 
-		mb(); /* This is important to ensure that mem->buf 
-			 has been written to memory yet */
-
 		assert(mem->buf != NULL);
 		assert(mem->delete);
 		free(mem->buf);
 		mem->buf = NULL;
+
+		wmb();
+
 		mem->delete = 0;
 	}
 }
@@ -86,17 +86,14 @@ void DoTest(long Th_Num)
 
 		th_req[Th_Num]++;
 	
+		wmb();
 		mem.delete = 1;
 		
 		while (mem.delete) 
 			Th_Delay(1);
 		
-		mb(); /* This is important to ensure that mem->buf 
-			 has been written to memory yet */
-
 		assert(mem.buf == NULL);
 		assert(mem.delete == 0);
-
 	}	
 }
 




  parent reply	other threads:[~2000-11-08 22:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-08 13:51 [Fwd: Alpha SMP problem] Reto Baettig
2000-11-08 20:32 ` Jeff Sturm
2000-11-08 16:51   ` Reto Baettig
2000-11-08 22:44     ` Jeff Sturm
2000-11-09  6:11       ` should I use 8 DIMMs for UP2000 M/B when I put two 667Mhz processors? Jeong Hwan Park
2000-11-09  1:31         ` W Bauske
2000-11-09  6:31           ` Jeong Hwan Park
2000-11-09  2:09             ` W Bauske
2000-11-09  7:04               ` Greg Lindahl
2000-11-09  3:21                 ` W Bauske
2000-11-09 15:36                   ` Greg Lindahl
2000-11-09 20:49                     ` W Bauske
2000-11-10  3:10                       ` Greg Lindahl
2000-11-09 23:36                         ` W Bauske
2000-11-09 20:18         ` Tom Heibel
2000-11-09 20:25           ` Rich Payne
2000-11-09 20:24         ` Tom Heibel
2000-11-08 22:15   ` Richard Henderson [this message]
2000-11-08 17:39     ` [Fwd: Alpha SMP problem] Reto Baettig
2000-11-08 23:53     ` Jeff Sturm
2000-11-09  1:56       ` Richard Henderson
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox