From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752177AbdAZFod (ORCPT ); Thu, 26 Jan 2017 00:44:33 -0500 Received: from out0-146.mail.aliyun.com ([140.205.0.146]:56204 "EHLO out0-146.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbdAZFob (ORCPT ); Thu, 26 Jan 2017 00:44:31 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R761e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03280;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.7WJzXWh_1485409441; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Johannes Weiner'" , "'Andrew Morton'" Cc: "'Mel Gorman'" , , , References: <20170123181641.23938-1-hannes@cmpxchg.org> In-Reply-To: <20170123181641.23938-1-hannes@cmpxchg.org> Subject: Re: [PATCH 0/5] mm: vmscan: fix kswapd writeback regression Date: Thu, 26 Jan 2017 13:44:01 +0800 Message-ID: <007c01d27797$34178790$9c4696b0$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIqvSH7Qdc6ObwofxWFBpD9FSVAbKCZsyXw Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On January 24, 2017 2:17 AM Johannes Weiner wrote: > > We noticed a regression on multiple hadoop workloads when moving from > 3.10 to 4.0 and 4.6, which involves kswapd getting tangled up in page > writeout, causing direct reclaim herds that also don't make progress. > > I tracked it down to the thrash avoidance efforts after 3.10 that make > the kernel better at keeping use-once cache and use-many cache sorted > on the inactive and active list, with more aggressive protection of > the active list as long as there is inactive cache. Unfortunately, our > workload's use-once cache is mostly from streaming writes. Waiting for > writes to avoid potential reloads in the future is not a good tradeoff. > > These patches do the following: > > 1. Wake the flushers when kswapd sees a lump of dirty pages. It's > possible to be below the dirty background limit and still have > cache velocity push them through the LRU. So start a-flushin'. > > 2. Let kswapd only write pages that have been rotated twice. This > makes sure we really tried to get all the clean pages on the > inactive list before resorting to horrible LRU-order writeback. > > 3. Move rotating dirty pages off the inactive list. Instead of > churning or waiting on page writeback, we'll go after clean active > cache. This might lead to thrashing, but in this state memory > demand outstrips IO speed anyway, and reads are faster than writes. > > More details in the individual changelogs. > > include/linux/mm_inline.h | 7 ++++ > include/linux/mmzone.h | 2 -- > include/linux/writeback.h | 2 +- > include/trace/events/writeback.h | 2 +- > mm/swap.c | 9 ++--- > mm/vmscan.c | 68 +++++++++++++++----------------------- > 6 files changed, 41 insertions(+), 49 deletions(-) > Acked-by: Hillf Danton