From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [PATCH] Avoid useless inodes and dentries reclamation Date: Thu, 29 Aug 2013 11:36:10 -0700 Message-ID: <521F949A.2020908@intel.com> References: <1377726732.3625.31.camel@schen9-DESK> <20130829110741.GA23571@dastard> <1377799676.3625.69.camel@schen9-DESK> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Dave Chinner , Alexander Viro , Jan Kara , Dave Chinner , Andi Kleen , Matthew Wilcox , linux-fsdevel , linux-kernel To: Tim Chen Return-path: In-Reply-To: <1377799676.3625.69.camel@schen9-DESK> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org The new shrinker infrastructure in mmotm looks like it will make this problem worse. old code: shrink_slab() for_each_shrinker { do_shrinker_shrink(); // one per batch prune_super() grab_super_passive() } } Which means we've got at _most_ one grab_super_passive() per batch. The new code is something like this: shrink_slab() { list_for_each_entry(shrinker, &shrinker_list, list) { for_each_node_mask(... shrinkctl->nodes_to_scan) { shrink_slab_node() } } } shrink_slab_node() { max_pass = shrinker->count_objects(shrinker, shrinkctl); // ^^ does grab_super_passive() ... while (total_scan >= batch_size) { ret = shrinker->scan_objects(shrinker, shrinkctl); // ^^ does grab_super_passive() } } We've got an extra grab_super_passive()s in the case where we are actually doing a scan, plus we've got the extra for_each_node_mask() loop. That means even more lock acquisitions in the multi-node NUMA case, which is exactly where we want to get rid of global lock acquisitions.