linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Ravish Tayal <ravish.tayal@gmail.com>,
	linux-arm@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-usb@vger.kernel.org,
	ravish.tayal@conexant.com
Subject: Re: Query to optimize PageCache size in system
Date: Thu, 14 May 2009 22:00:15 +0100	[thread overview]
Message-ID: <20090514210015.GD20363@shareable.org> (raw)
In-Reply-To: <20090513155444.GF15360@parisc-linux.org>

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?  What problem
> are you experiencing that you think is caused by having a large number
> of cached pages?

Ravish didn't say if this applies, but cached pages are a problem on
NOMMU platforms because they cause severe placement-fragmentation of
other memory allocations including userspace allocations, and since
those all must be physically contiguous, it's a problem.

> > 3. Is there any provision in linux kernel through which I can restrict
> > the new page allocation for disk operation to not to be added in the
> > page-cache  ?
> > 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.  O_DIRECT works for
> both reads and writes, but does have restrictions on alignment.

In theory there are some fadvise calls as an alternative, but I don't
know if they work.

There was also a patch posted a few months ago to limit the amount of
memory used for file page cache to a fraction of the total memory.
That might work.

A better solution to avoid fragmentation is crudely segregating file
cache pages from other allocations.  That's roughly what 2.4 NOMMU
kernels do, but 2.6 doesn't have the option.  (It has other problems
anyway).

-- Jamie

  reply	other threads:[~2009-05-14 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e42309110905130732xf4313a6qba1f30a2d89728be@mail.gmail.com>
     [not found] ` <e42309110905130732xf4313a6qba1f30a2d89728be-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-13 15:05   ` Query to optimize PageCache size in system Ravish Tayal
2009-05-13 15:43     ` Greg KH
2009-05-13 15:54     ` Matthew Wilcox
2009-05-14 21:00       ` Jamie Lokier [this message]
     [not found]       ` <e42309110905142210k332b8818l695a03efdc75673f@mail.gmail.com>
2009-05-15  5:51         ` Fwd: " Ravish Tayal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090514210015.GD20363@shareable.org \
    --to=jamie@shareable.org \
    --cc=linux-arm@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=ravish.tayal@conexant.com \
    --cc=ravish.tayal@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).