Coda File System

Re: How do I run the RVM tests?

From: Timothy J. Wood <tjw_at_omnigroup.com>
Date: Thu, 4 Jan 2001 19:35:00 -0800
On Thursday, January 4, 2001, at 04:48 PM, Jan Harkes wrote:
 > saddr    is the starting address of rvm


   Ah... duh... I should have looked at what the arguments were.  That 
would probably have prompted me to find the real problem.

   The problem is that on the platform I'm working on, mmap behaves 
slightly incompatibly.  If the address given is non-zero, the current 
RVM code expects that if that address/length range is available, it will 
be used.  If MAP_FIXED is specified, however, mmap will use the region.

   So, this change fixed my problem:

Index: coda_mmap_anon.h
===================================================================
RCS file: /coda-src/rvm/include/coda_mmap_anon.h,v
retrieving revision 4.1
diff -c -r4.1 coda_mmap_anon.h
*** coda_mmap_anon.h    1999/11/15 22:54:34     4.1
--- coda_mmap_anon.h    2001/01/05 03:32:01
***************
*** 19,25 ****
   #define CODA_MMAP_ANON_H

   #ifdef MAP_ANON
! #define mmap_anon(raddrptr, addrptr, len, prot)       { raddrptr = 
mmap(addrptr, len, prot, (MAP_PRIVATE | MAP_ANON), -1, 0); }
   #else
   #define mmap_anon(raddrptr, addrptr, len, prot)       { int fd; \
                                                   if ((fd = 
open("/dev/zero", O_RDWR)) == -1) \
--- 19,25 ----
   #define CODA_MMAP_ANON_H

   #ifdef MAP_ANON
! #define mmap_anon(raddrptr, addrptr, len, prot)       { raddrptr = 
mmap(addrptr, len, prot, (MAP_PRIVATE | MAP_ANON | (addrptr ? 
MAP_FIXED : 0)), -1, 0); }
   #else
   #define mmap_anon(raddrptr, addrptr, len, prot)       { int fd; \
                                                   if ((fd = 
open("/dev/zero", O_RDWR)) == -1) \


   This approach is already used if MAP_ANON is not defined, so I assume 
the sematics of mmap_anon should really be that both sides of this ifdef 
should add MAP_FIXED if the pointer is non-null.

   Once I apply this change, the rvm_basher and lwp_basher both run fine 
and report no errors.

   Thanks!

-tim
Received on 2001-01-04 22:34:55