linux-mips-fnet
[Top] [All Lists]

Re: SysV IPC shared memory and virtual alising

To: Atsushi Nemoto <nemoto@toshiba-tops.co.jp>
Subject: Re: SysV IPC shared memory and virtual alising
From: Ralf Baechle <ralf@oss.sgi.com>
Date: Tue, 14 Aug 2001 10:49:41 +0200
Cc: linux-mips@oss.sgi.com, linux-mips@fnet.fr
In-reply-to: <20010806164452D.nemoto@toshiba-tops.co.jp>; from nemoto@toshiba-tops.co.jp on Mon, Aug 06, 2001 at 04:44:52PM +0900
References: <20010806164452D.nemoto@toshiba-tops.co.jp>
User-agent: Mutt/1.2.5i
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

<Prev in Thread] Current Thread [Next in Thread>