[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [question] shm_nattch in sys_shmat?
- To: colpatch@us.ibm.com
- Subject: Re: [question] shm_nattch in sys_shmat?
- From: Christoph Rohland <cr@sap.com>
- Date: Mon, 03 Feb 2003 20:48:33 +0100
- Cc: linux-mm@kvack.org, William Lee Irwin III <wli@holomorphy.com>,"Martin J. Bligh" <mbligh@aracnet.com>
- Fake-Sender: owner-linux-mm@kvack.org
- In-Reply-To: <3E3AFA3A.6050205@us.ibm.com> (Matthew Dobson's message of"Fri, 31 Jan 2003 14:35:38 -0800")
- Organisation: Development SAP J2EE Engine
- Original-Recipient: rfc822;linux-mm-archive@humbolt.geo.uu.nl
- References: <3E3AFA3A.6050205@us.ibm.com>
- Sender: Rik van Riel <riel@nl.linux.org>
- User-Agent: Gnus/5.090014 (Oort Gnus v0.14) XEmacs/21.4 (Native Windows TTYSupport (Windows), i686-pc-cygwin)
Hi Matthew,
On Fri, 31 Jan 2003, Matthew Dobson wrote:
> sys_shmat, does in fact increment shm_nattch, but only to
> decrement it again a few lines later, as seen in this code
> snippet. Can anyone please explain why this is?
sys_shmat temporarily increases shm_nattch to make sure it's never zero:
> >>> shp->shm_nattch++;
Make sure shm_nattch is greater than zero.
> > user_addr = (void*) do_mmap (file, addr, size, prot,
map the segment which increments shm_nattch in shm_mmap accounting for
the actual mapping
> >>> shp->shm_nattch--;
Correct it again.
Greetings
Christoph
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/