[Top] [All Lists]

Re: Linux Shared Memory Issue

Subject: Re: Linux Shared Memory Issue
From: Atsushi Nemoto <>
Date: Fri, 26 Apr 2002 12:11:07 +0900 (JST)
In-reply-to: <>
Organization: TOSHIBA Personal Computer System Corporation
References: <> <> <>
>>>>> On Thu, 25 Apr 2002 11:46:04 -0700, Jun Sun <> said:
>> #define COLOUR_ALIGN(addr,pgoff) \ ((((addr)+SHMLBA-1)&~(SHMLBA-1))
>> + \ (((pgoff)<<PAGE_SHIFT) & (SHMLBA-1)))

jsun> What is the purpose of adding the pgoff part?  To avoid mapping
jsun> all shared regions into the beginning of cache?

I suppose so.  For example, mmapping offset 0x1000 of /dev/kmem will
return 0xXXXX0000 address if we ignore pgoff.  This can cause aliasing
problem with KSEG0 address (0x80001000).  Adding pgoff, mmap will
return 0xXXXX1000.

In case of IPC shm, pgoff is always 0 so this change does not effect.

Atsushi Nemoto

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