Am 06.12.2010 16:58, schrieb Nikos Chantziaras:
> On 12/06/2010 04:33 PM, Stroller wrote:
>>
[...]
>>
>> The machine seems much snappier if I return to an interactive session
>> after leaving it idle for some time, but during DVD rips it is still
>> unresponsive for tens of seconds at a time. It seems like maybe it
>> responds quicker than mainline sources, but it's still so slow that
>> it's both unusable and hard to be sure whether that's the case.
>>

As a side note: Have you tried using sys-process/latencytop to find the
exact reason for your latency problem?

>> Will try cgroups this week, perhaps.
> 
> cgroups will not help with that either.  I bet the problem is that the
> kernel doesn't care about what kind of data it is caching.  I came
> across this on LKML, but no one was interested in a solution.
> 
> The problem is that the kernel caches all data.  Ripping a DVD will
> consume 4GB cache, and all other data will be thrown out.  Throwing that
> all out again after the rip has finished is an awful lot of I/O load.
> The smart thing to do would be for the kernel to not cache such stuff
> (DVD rips, big video files, etc.)  But it does.
> 
> 

I fear I start to repeat myself, but I /think/ cgroups could help again.
The memory subsystem allows you to set hard limits on the amount of
memory used by a cgroup. This seems to include cache.

Please take a look at [1] and [2]. Both should give you enough
information to get you started. You should apply memory limits
explicitly for certain processes/shells - not on a per-default basis as
the CPU scheduling solution.

Disclaimer: I have never tried this and do not intend to do this.

[1]
http://www.google.de/url?sa=t&source=web&cd=1&ved=0CBgQFjAA&url=http%3A%2F%2Fwww.linuxfoundation.jp%2Fjp_uploads%2Fseminar20081119%2FCgroupMemcgMaster.pdf&rct=j&q=%2Bcgroup%20%2B%22file%20cache%22&ei=ZFT9TNWtDZS08QOf-vihDA&usg=AFQjCNHd23FsqouJutTc4BAotkM9CUpfMQ&cad=rja

[2] file:///usr/src/linux/Documentation/cgroups/memory.txt

P.S.: We would not have this problem if application designers were more
careful about i/o and cache performance. If the dvd ripper opened files
with the option O_DIRECT (as specified in `man 2 open`), the cache would
stay clean.

Hope this helps,
Florian Philipp

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to