mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Srinivasan Jayarajan" <srinivasan.jayarajan.lnxkrnl@gmail.com>
To: "Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Controlling use of page cache for usb-storage disk access in a MIPS based embedded system
Date: Fri, 5 Dec 2008 11:00:19 +0530	[thread overview]
Message-ID: <50fb67e90812042130m6274fb9bv110495a3a98ccb03@mail.gmail.com> (raw)

Hi,

  I have Linux 2.6.16-17 running on a MIPS development board. The
board also has an usb port. I also have samba 3.0.28a running on the
platform, which is used to share usb-storage disk partitions. The
system does not have any swap partition and after a cold reboot, the
system has about 154MB free

cat /proc/meminfo
MemTotal: 404768 kB
MemFree: 153508 kB
Buffers: 80 kB
Cached: 136464 kB
SwapCached: 0 kB
Active: 123828 kB
Inactive: 82316 kB
HighTotal: 163712 kB
HighFree: 376 kB
LowTotal: 241056 kB
LowFree: 153132 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
Mapped: 98996 kB
Slab: 25364 kB
CommitLimit: 202384 kB
Committed_AS: 235796 kB
PageTables: 2512 kB
VmallocTotal: 1015800 kB
VmallocUsed: 8060 kB
VmallocChunk: 1007568 kB

I have also tweaked the /proc/sys/vm entries as follows to limit the
use of page cache

/proc/sys/vm/dirty_background_ratio = 2
/proc/sys/vm/dirty_ratio = 5
/proc/sys/vm/dirty_expire_centisecs = 1000
/proc/sys/vm/vfs_cache_pressure = 10000

The moment I try to copy a huge file (about 1GB), the cached page
count goes up and eats away about 100MB in spite of the above vm
tweaks. In some cases, the system runs out of memory and OOM kicks in.

MemTotal: 404768 kB
MemFree: 10512 kB
Buffers: 1208 kB
Cached: 274260 kB
SwapCached: 0 kB
Active: 126472 kB
Inactive: 219632 kB
HighTotal: 163712 kB
HighFree: 376 kB
LowTotal: 241056 kB
LowFree: 10136 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 16200 kB
Writeback: 0 kB
Mapped: 101500 kB
Slab: 28176 kB
CommitLimit: 202384 kB
Committed_AS: 240220 kB
PageTables: 2596 kB
VmallocTotal: 1015800 kB
VmallocUsed: 8060 kB
VmallocChunk: 1007568 kB

I even tried copying a file from one folder to another from shell
using dd with the direct flag

dd oflag=direct if=/mnt/usb/test.avi of=/mnt/usb/copy/test.avi

The copy was very slow with the following results

1638660+0 records in
1638660+0 records out
838993920 bytes (839 MB) copied, 1827.17 s, 459 kB/s

But the page cache still ate quite a lot of memory close to 100MB, but
the growth in page cache was much slow. I would like to cap the use of
page cache to a hard limit of say about

Cached: 179200 kB. Is this possible and is it safe?


Thanks,

Srini

             reply	other threads:[~2008-12-05  5:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-05  5:30 Srinivasan Jayarajan [this message]
2008-12-10  6:00 ` Greg KH
2009-07-13  3:43   ` Srinivasan Jayarajan
2008-12-05  5:51 Srinivasan Jayarajan

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=50fb67e90812042130m6274fb9bv110495a3a98ccb03@mail.gmail.com \
    --to=srinivasan.jayarajan.lnxkrnl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®