On Sat, Jul 03, 2021 at 11:37:07AM +0800, Zhang Yi wrote: > I check the ocfs2 code, if we register shrinker here, __ocfs2_recovery_thread()-> > ocfs2_recover_node() seems will register and unregister a lot of unnecessary > shrinkers. It depends on the lifetime of the shrinker and the journal, because of > the jbd2_journal_destroy() destroy everything, it not a simple undo of > jbd2_load_journal(), so it's not easy to add shrinker properly. But it doesn't > seems like a real problem, just curious. ocfs2_recover_node() only gets called for nodes that need recovery --- that is, when an ocfs2 server has crashed, then it becomes necessary to replay that node's journal before that node's responsibilities can be taken over by another server. So it doesn't get called that frequently --- and when it is needed, the fact that we need to read the journal, and replay its entries, the cost in comparison for registering and unregistering the shrinker is going to be quite cheap. Cheers, - Ted