After more detail examination of this problem, what I see is that the 
storage for the shared memory appears to be allocated via RAMFS in the 
pagecache in tiny-shmem.c (i.e. a non-mmu platform) and the storage is 
mmapped when the shmat is performed. When the pagecache hits its threshold 
of low RAM and starts to cleanup, the mmapped storage for the shared 
memory segment gets cleaned up as well old file cache entries. Eventually 
this storage gets re-used as pagecache and makes it appear as though the 
JFFS2 file system has overwritten the shared memory block when in reality 
the storage was freed and re-used. From looking at the code, either the 
page is not getting properly flagged as being mmapped on shmat or I am 
missing something in the pagecache cleanup code since it appears that any 
mmapped storage in the pagecache will always be ignored during cleanup.

Any ideas?

John Moore




John B Moore <jmo...@moreycorp.com> 
Sent by: uclinux-dev-boun...@uclinux.org
01/20/2010 03:49 PM
Please respond to
uClinux development list <uclinux-dev@uclinux.org>


To
uClinux development list <uclinux-dev@uclinux.org>
cc

Subject
[uClinux-dev] Disk Cache overlaying Shared Memory?







 I am running a 2.6.17 uClinux kernel on a Coldfire 5233 and am having an 
issue where it appears as though the disk cache is overlaying shared 
memory. In the application, I have allocated a 4K block of shared memory 
and am writing files to a JFFS2 file system. The Cached data size 
continues to grow as I continue to write files until about 1M of RAM is 
still available at which point the shared memory block gets overwritten 
with part of the data that was just written to JFFS2. This happens 
consistently and is easily reproducible. If I am not using shared memory 
but just malloc a block of storage instead, no overlay happens and the 
cache grows only slightly larger before it  levels off as the cache cleans 
itself up. 

Any ideas why this overlay may be happening? 

John Moore 


This e-mail, including attachments, may contain information that is 
confidential and/or proprietary, and may only be used by the person to 
whom this email is addressed. If the recipient of this e-mail is not the 
intended recipient or an authorized agent, the reader is hereby notified 
that any dissemination, distribution, or copying of this e-mail is 
prohibited. If this e-mail has been delivered to you in error, please 
notify the sender by replying to this message and deleting this e-mail 
immediately._______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev




This e-mail, including attachments, may contain information that is 
confidential and/or proprietary, and may only be used by the person to 
whom this email is addressed. If the recipient of this e-mail is not the 
intended recipient or an authorized agent, the reader is hereby notified 
that any dissemination, distribution, or copying of this e-mail is 
prohibited. If this e-mail has been delivered to you in error, please 
notify the sender by replying to this message and deleting this e-mail 
immediately.
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to