Skip to contentSkip to conversation

Disabling file system caching

DISCUSSION Balbir 2 participants 2 messages Jan 20, 2003

lore
Share & tools
lore

Balbir

author
#0 lore raw

Not sure if posting to the newsgroup linux.kernel sends it to the mailing list too.

"Balbir Singh" <[email protected]> wrote in message news:[email protected]...

Quoted 14 lines

"Rik van Riel" <[email protected]> wrote in message news:[email protected]...

Quoted 11 lines · Jean-Eric Cuendet
Quoted 2 lines

Is it possible to disable file caching for a given partition or mount?

No, if you do that mmap(), read(), write() etc. would be impossible.

Quoted 1 line

Or at least to limit it at a certain quantity of memory?

Not yet. I'm thinking of implementing something like this for the next version of -rmap (reclaim only from the cache if the cache occupies more than a certain fraction of ram).

I think that this feature is very important. In an embedded system using an NFS root filesystem, we found that the file cache would take a lot of memory and all insmods would fail. This is especially true when the system boots up and looks for /lib/modules.

I think it should be possible to modify the slab allocator to implement a memory pool. We could add a flag which would prevent the slab from growing beyond its initial size.

This approach would work only if the cache is allocated by using the slab allocator.

Balbir

#1 lore raw
Quoted 25 lines · Balbir

Not sure if posting to the newsgroup linux.kernel sends it to the mailing list too.

"Balbir Singh" <[email protected]> wrote in message news:[email protected]...

Quoted 14 lines

"Rik van Riel" <[email protected]> wrote in message news:[email protected]...

Quoted 11 lines · Jean-Eric Cuendet
Quoted 2 lines

Is it possible to disable file caching for a given partition or mount?

No, if you do that mmap(), read(), write() etc. would be impossible.

Quoted 1 line

Or at least to limit it at a certain quantity of memory?

Not yet. I'm thinking of implementing something like this for the next version of -rmap (reclaim only from the cache if the cache occupies more than a certain fraction of ram).

I think that this feature is very important. In an embedded system using an NFS root filesystem, we found that the file cache would take a lot of memory and all insmods would fail. This is especially true when the system boots up and looks for /lib/modules.

Quoted 6 lines

I think it should be possible to modify the slab allocator to implement a memory pool. We could add a flag which would prevent the slab from growing beyond its initial size.

This approach would work only if the cache is allocated by using the slab allocator.

No, it's not! And the slab alocator should mercilessly rip the cache when it needs some pages. In the NFS root case, I would guess it's a problem of NFS implementation allocating too much kernel memory, since both cache and user-land pages are riped in favor of kernel allocations.

-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <[email protected]>