From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752139AbcHLD4t (ORCPT ); Thu, 11 Aug 2016 23:56:49 -0400 Received: from ipmail04.adl6.internode.on.net ([150.101.137.141]:2496 "EHLO ipmail04.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbcHLD4s (ORCPT ); Thu, 11 Aug 2016 23:56:48 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am4QAPVHrVd5LDUCIGdsb2JhbABYBoNFgVKCeYN5nTaMZYobhhcCAgEBAoFYTQEBAQEBAQcBAQEBAQE4QIReAQEEAScTHCMFCwgDGAklDwUlAwcaE4gpB8B0AQEBBwIBJB6FRIUVgTkBgniFaQWZPI8Kj02MNYN4gnOBbSoyhysBAQE Date: Fri, 12 Aug 2016 13:56:45 +1000 From: Dave Chinner To: Linus Torvalds Cc: Christoph Hellwig , "Huang, Ying" , LKML , Bob Peterson , Wu Fengguang , LKP Subject: Re: [LKP] [lkp] [xfs] 68a9f5e700: aim7.jobs-per-min -13.6% regression Message-ID: <20160812035645.GQ19025@dastard> References: <87eg5w18iu.fsf@yhuang-mobile.sh.intel.com> <87a8gk17x7.fsf@yhuang-mobile.sh.intel.com> <8760r816wf.fsf@yhuang-mobile.sh.intel.com> <20160811155721.GA23015@lst.de> <20160812005442.GN19025@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 11, 2016 at 07:27:52PM -0700, Linus Torvalds wrote: > On Thu, Aug 11, 2016 at 5:54 PM, Dave Chinner wrote: > > > > So, removing mark_page_accessed() made the spinlock contention > > *worse*. > > > > 36.51% [kernel] [k] _raw_spin_unlock_irqrestore > > 6.27% [kernel] [k] copy_user_generic_string > > 3.73% [kernel] [k] _raw_spin_unlock_irq > > 3.55% [kernel] [k] get_page_from_freelist > > 1.97% [kernel] [k] do_raw_spin_lock > > 1.72% [kernel] [k] __block_commit_write.isra.30 > > I don't recall having ever seen the mapping tree_lock as a contention > point before, but it's not like I've tried that load either. So it > might be a regression (going back long, I suspect), or just an unusual > load that nobody has traditionally tested much. > > Single-threaded big file write one page at a time, was it? Yup. On a 4 node NUMA system. So when memory reclaim kicks in, there's a write process, a writeback kworker and 4 kswapd kthreads all banging on the mapping->tree_lock. There's an awful lot of concurrency happening behind the scenes of that single user process writing to a file... > The mapping tree lock has been around forever (it used to be a rw-lock > long long ago), but I wonder if we might have moved more stuff into it > (memory accounting comes to mind) causing much worse contention or > something. Yeah, there is now a crapton of accounting updated in account_page_dirtied under the tree lock - memcg, writeback, node, zone, task, etc. And there's a *lot* of code that __delete_from_page_cache() can execute under the tree lock. > Hmm. Just for fun, I googled "tree_lock contention". It's shown up > before - back in 2006, and it was you hitting it back then too. Of course! That, however, would have been when I was playing with real big SGI machines, not a tiddly little 16p VM.... :P Cheers, Dave. -- Dave Chinner david@fromorbit.com