Re: Query to optimize PageCache size in system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux