From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ravish Tayal Subject: Fwd: Query to optimize PageCache size in system Date: Fri, 15 May 2009 11:21:56 +0530 Message-ID: References: <20090513155444.GF15360@parisc-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: ravish.tayal@conexant.com To: linux-arm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-usb@vger.kernel.org Return-path: In-Reply-To: Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Including Linux mailing list in the mail thread. Thanks Matthew, Please see my inline explanations. On Wed, May 13, 2009 at 9:24 PM, Matthew Wilcox wrote: > On Wed, May 13, 2009 at 08:35:52PM +0530, Ravish Tayal wrote: >> I am looking for help to reduce the number of cached pages in the >> system. I am using 2.6.12 linux kernel on ARM processor.for my >> embedded USB mass storage application. > > Why do you think the number of cached pages is a problem? =A0What pro= blem > are you experiencing that you think is caused by having a large numbe= r > of cached pages? > RT: My intention is to keep the Zone->nr_inactive to be minimum. By which I means in case File system read operation pages which are in active list should alow to be part of the page cache, while once moved to inactive list it should be soon aged out to free list. Which for embedded scenario would allow low memory devices to keep good amount of free memory. Currently I am periodically calling try_to_free_pages to get it done ;-= ) >> 3. Is there any provision in linux kernel through which I can restri= ct >> the new page allocation for disk operation to not to be added in the >> page-cache =A0? >> 4. If I open the file with O_DIRECT Flag would page_cache be avoided= , >> irrespective it is file read or File write operations? > > Question 4 appears to be the answer to question 3. =A0O_DIRECT works = for > both reads and writes, but does have restrictions on alignment. > RT: I tried to use the O_DIRECT options with bftpd ftp =A0server + 2.6.12 kernel, In File write operation I have observed no difference in term page caching behaviour. Though in that setup file read operation starts failining which I didn't debug much. Thanks for your suggestion. regards Ravish Tayal > -- > Matthew Wilcox =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Int= el Open Source Technology Centre > "Bill, look, we understand that you're interested in selling us this > operating system, but compare it to ours. =A0We can't possibly take s= uch > a retrograde step." > -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html