Skip to contentSkip to conversation

On shrinkable caches

DISCUSSION Nikolay Borisov 2 participants 3 messages Jun 20, 2016 – Jun 23, 2016 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello,

I have a question regarding the SLAB_RECLAIM_ACCOUNT flag with which BTRFS caches are created. Currently there isn't a single usage of register_shrinker under fs/btrfs. Apart from the inode cache which is being shrunk from the generic super_cache_scan I don't think the memory used for those caches should be accounted as reclaimable?

Regards,
Nikolay

#1 lore raw
Quoted 3 lines · Nikolay Borisov

I have a question regarding the SLAB_RECLAIM_ACCOUNT flag with which BTRFS caches are created. Currently there isn't a single usage of register_shrinker under fs/btrfs.

The SLAB_RECLAIM_ACCOUNT flag has been there since the first versions in 2007 (when shrinkeres did not exist) but I can't find any specific reason why.

Quoted 3 lines

Apart from the inode cache which is
being shrunk from the generic super_cache_scan I don't think the memory used for those caches should be accounted as reclaimable?

I agree, in most cases I don't see any possibility to reclaim the objects earlier than the explicit free.

#2 lore raw
Quoted 9 lines · David Sterba
Quoted 3 lines · Nikolay Borisov

I have a question regarding the SLAB_RECLAIM_ACCOUNT flag with which BTRFS caches are created. Currently there isn't a single usage of register_shrinker under fs/btrfs.

The SLAB_RECLAIM_ACCOUNT flag has been there since the first versions in 2007 (when shrinkeres did not exist) but I can't find any specific reason why.

Quoted 6 lines
Quoted 3 lines

Apart from the inode cache which is
being shrunk from the generic super_cache_scan I don't think the memory used for those caches should be accounted as reclaimable?

I agree, in most cases I don't see any possibility to reclaim the objects earlier than the explicit free.

If that's the case, then I'll be happy to send a patch.