On Mon, Aug 06, 2001 at 04:44:52PM +0900, Atsushi Nemoto wrote: > Here is an patch to fix virtual aliasing problem with SysV IPC shared > memory. I tested this patch on a r4k cpu with 32Kb D-cache. > > If D-cache is smaller than PAGE_SIZE this patch is not needed at all, > but I think it is not so bad unconditionally forcing alignment to > SHMLBA. It's wasting huge amounts of address space. That can be prohibitive if you want to run something such as electric fence. Technically the worst case of any CPU that's required is 32kb on R4000 / R4400 SC and MC versions, so I don't want to go beyond that. What does this patch have to do with SysV shared mem? Shmat(2) does proper alignment checking and aligning and doesn't call arch_get_unmapped_area. We do have an alignment problem with mmap(2); somebody already has a correct patch for this already pending to be merged by Alan and Linus as it affects all architectures. I assume your patch was actually intended to fix this problem; it' doesn't correctly properly deal with anonymous mappings which have no extra alignment constraints nor correctly factor in the file offset so with just two mmap calls I can still create aliases. Ralf