On Thu, Jan 15, 2015 at 04:53:08PM +0800, Gui Hecheng wrote: > The following patch: > btrfs: remove empty fs_devices to prevent memory runout > > introduces @valid_dev_root aiming at recording @btrfs_device objects that > have corresponding block devices with btrfs. > But if a block device is broken or unplugged, no one tells the > @valid_dev_root to cleanup the "dead" objects. > > To recycle the memory occuppied by those "dead"s, we could rely on > the shrinker. The shrinker's scan function will traverse the > @valid_dev_root and trys to open the devices one by one, if it fails > or encounters a non-btrfs it will remove the "dead" @btrfs_device.
I don't see why shrinker is used here. linux.git/linux/shrinker.h: "A callback you can register to apply pressure to ageable caches." How is guaranteed that it will take action at the right time? -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html