Coda File System

Re: How do I run the RVM tests?

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Fri, 5 Jan 2001 13:24:16 -0500
On Thu, Jan 04, 2001 at 07:35:00PM -0800, Timothy J. Wood wrote:
> 
> 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.

My reading from the mmap manual pages indicates that MAP_FIXED is
probably always needed when we specify an addrptr. I've made the
coda_mmap_anon.h somewhat more readable and merged the two sides of the
#if/#else as follows,

    #ifndef MAP_ANON
    #define MAP_ANON 0
    #endif

    #define mmap_anon(raddrptr, addrptr, len, prot) do { \
	int fd = -1, flags = MAP_ANON | MAP_PRIVATE; \
	if (addrptr) flags |= MAP_FIXED; \
	if (!MAP_ANON) fd = open("/dev/zero", O_RDWR); \
	raddrptr = mmap((char *)addrptr, len, prot, flags, fd, 0); \
	if (fd != -1) close(fd); \
    } while(0);


This could explain other RVM_EINTERNAL errors that are occasionally
reported when people try to set up servers with a large RVM segment.

Jan
Received on 2001-01-05 13:24:33