# Device specific caching.

## dE_logics

Cause of ram constrains, I've reduced dirty caching, but will this affect internal performance? For .e.g. caching of data generated from the CPU or copied over from the memory?

If so, how can I just limit the dirty cache ratio to external FS like NFS/CIFA or USB devices?

----------

## CrankyPenguin

You might find some help with /etc/conf.d/hdparm  It allows you to set some device-specific parameters.  I'm not sure if it will be sufficient for your needs but it is a place to start.

----------

## dE_logics

Yes, I already use hdparm; it doesn't have such a feature. It just has read ahead which's not it.

----------

## CrankyPenguin

No true but the hdparm conf does device-specific tasks so you may be able to build on that to put something together.

----------

## krinn

There's an old bug when reducing the dirty ratio, i'm not sure it has been fix : https://lkml.org/lkml/2006/12/28/171

Corruption... you better make sure this one has been fix prior to go that way.

And there's no point to cache cpu as cpu have 3rd level cache today, and far far faster than your normal ram, and i think the kernel have enough task already to do than handling all cpu instructions to cache them.

And there's no point to cache a device with another one of the same speed, so caching your main memory with your main memory would just be a waste of time and speed.

----------

## dE_logics

 *krinn wrote:*   

> There's an old bug when reducing the dirty ratio, i'm not sure it has been fix : https://lkml.org/lkml/2006/12/28/171
> 
> Corruption... you better make sure this one has been fix prior to go that way.
> 
> And there's no point to cache cpu as cpu have 3rd level cache today, and far far faster than your normal ram, and i think the kernel have enough task already to do than handling all cpu instructions to cache them.
> ...

 

This system ain't of today. Also I was wondering about  - 

Program -> RAM dirty caching -> HDD

So it would cache data which should be written to disk, not instructions. Also there's no corruption with dirty caching in my case.

----------

