From: Martin H. <err...@mp...> - 2008-04-30 23:45:35
|
Looking into failures for shmat01 and shmt09 I came upon sys/shm.h, which defines SHMLBA. Unfortunately it is set to the pagesize, which is wong as well. I've opened glibc bug #6471 for this. If I patch sys/shm.h to the cache size the shmat01 test succeeds. shmt09 needs an additional patch to correct the sbrk increment to the SHMLBA size, which you find attached. I'll submit a patch for mmap01 later this week. Best regards, Martin Signed-off-by: Martin Habets <err...@mp...> On Wed, Apr 30, 2008 at 10:59:26PM +0100, Martin Habets wrote: > LTP test mmap01 fails on sparc with: > > mmap01 1 FAIL : mmap() Failed on mmapfile, errno=22 > > because the address passed in is only page aligned: > > /* > * Initialize addr to align with the first page boundary above the > * break address of the process. > */ > addr = (void *) (((intptr_t)sbrk(0) + (page_sz - 1)) & ~(page_sz - 1)); > ... > addr = mmap(addr, page_sz, PROT_READ | PROT_WRITE, > MAP_FILE|MAP_SHARED|MAP_FIXED, fildes, 0); > > The address should be aligned to the value of SHMLBA as defined in > asm/shmparam.h. > See Documentation/cachetlb.txt for the explanation behind this. > For most architectures this value is the page size, but not all. > > Unfortunately asm/shmparam.h is not suitable for inclusion in user space > programs. I looked at sysconf(LEVEL1_DCACHE_SIZE), but that returns 0 on > sparc. > Is there another solution other than hardcoding the exceptions in > architecture specific code? > > Thanks, > Martin |