From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932568AbcHKP5Z (ORCPT ); Thu, 11 Aug 2016 11:57:25 -0400 Received: from verein.lst.de ([213.95.11.211]:42202 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932375AbcHKP5X (ORCPT ); Thu, 11 Aug 2016 11:57:23 -0400 Date: Thu, 11 Aug 2016 17:57:21 +0200 From: Christoph Hellwig To: Linus Torvalds Cc: "Huang, Ying" , Dave Chinner , LKML , Bob Peterson , Wu Fengguang , LKP , Christoph Hellwig Subject: Re: [LKP] [lkp] [xfs] 68a9f5e700: aim7.jobs-per-min -13.6% regression Message-ID: <20160811155721.GA23015@lst.de> References: <20160809143359.GA11220@yexl-desktop> <20160810230840.GS16044@dastard> <87eg5w18iu.fsf@yhuang-mobile.sh.intel.com> <87a8gk17x7.fsf@yhuang-mobile.sh.intel.com> <8760r816wf.fsf@yhuang-mobile.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 10, 2016 at 06:00:24PM -0700, Linus Torvalds wrote: > The biggest difference is that we have "mark_page_accessed()" show up > after, and not before. There was also a lot of LRU noise in the > non-profile data. I wonder if that is the reason here: the old model > of using generic_perform_write/block_page_mkwrite didn't mark the > pages accessed, and now with iomap_file_buffered_write() they get > marked as active and that screws up the LRU list, and makes us not > flush out the dirty pages well (because they are seen as active and > not good for writeback), and then you get bad memory use. And that's actually a "bug" in the new code - mostly because I failed to pick up changes to the core code happening after we 'forked' it, in this case commit 2457ae ("mm: non-atomically mark page accessed during page cache allocation where possible"). The one liner below (not tested yet) to simply remove it should fix that up. I also noticed we have a spurious pagefault_disable/enable, I need to dig into the history of that first, though. diff --git a/fs/iomap.c b/fs/iomap.c index 48141b8..f39c318 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -199,7 +199,6 @@ again: pagefault_enable(); flush_dcache_page(page); - mark_page_accessed(page); status = iomap_write_end(inode, pos, bytes, copied, page); if (unlikely(status < 0))