linux-mips
[Top] [All Lists]

Re: SysV IPC shared memory and virtual alising

To: ralf@oss.sgi.com
Subject: Re: SysV IPC shared memory and virtual alising
From: Atsushi Nemoto <nemoto@toshiba-tops.co.jp>
Date: Thu, 16 Aug 2001 12:04:01 +0900
Cc: linux-mips@oss.sgi.com, linux-mips@fnet.fr
In-reply-to: <20010814104941.F5928@bacchus.dhis.org>
Organization: TOSHIBA Personal Computer System Corporation
References: <20010806164452D.nemoto@toshiba-tops.co.jp> <20010814104941.F5928@bacchus.dhis.org>
Sender: owner-linux-mips@oss.sgi.com
>>>>> On Tue, 14 Aug 2001 10:49:41 +0200, Ralf Baechle <ralf@oss.sgi.com> said:
ralf> It's wasting huge amounts of address space.  That can be
ralf> prohibitive if you want to run something such as electric fence.
ralf> Technically the worst case of any CPU that's required is 32kb on
ralf> R4000 / R4400 SC and MC versions, so I don't want to go beyond
ralf> that.

Yes.  My patch is wasting address space.  I did not know reasonable
size for alignment, so I used SHMLBA value.  It may be better to
calculate proper alignment size on run-time or compile-time.

ralf> What does this patch have to do with SysV shared mem?  Shmat(2)
ralf> does proper alignment checking and aligning and doesn't call
ralf> arch_get_unmapped_area.

I tried with this code (Xshm extention in Xserver use shm like this) :

        shmid = shmget(IPC_PRIVATE, 0x1000, IPC_CREAT | 0777);
        data = shmat(shmid, 0, 0);
        data2 = shmat(shmid, 0, 0);

In this case, get_unmapped_area() is called with a file structure does
not have 'get_unmapped_area' operation ('shmem_file_operations') so
arch_get_unmapped_area() is called.

---
Atsushi Nemoto

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