Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp40425ybf; Thu, 27 Feb 2020 15:37:03 -0800 (PST) X-Google-Smtp-Source: APXvYqyjSWA+c7Q/CEcki+jqPw53b4Lsd/w/SBtsuMhRbXb0Y4s3e0IzkEo2b4zbZ03DIeTbu/sT X-Received: by 2002:a05:6830:1d4:: with SMTP id r20mr1047174ota.107.1582846622895; Thu, 27 Feb 2020 15:37:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582846622; cv=none; d=google.com; s=arc-20160816; b=cV9YjVQXhRGFLvTbpKXjvJbcO8GaBq0pEPBcVPPmtAvLidwkKASMZPsEkAufmEu6yY FXtV5nOj5pqaW0Mb/Gl3iVX8HWbtf1c5Pm/gKSbC6M3+D2Q3y6KxhOAHmVOnC/fwyweF 71syrpI13lQc+WgK4ZqoW6bhT5GtotPpP0A1tjyahfP60Tn0UrNefyeDZLwgUZVlGkUm GG7BCznmOT8GKFKGNJzrcOg5luziZ+EEhfhId22YqTb87C7ZOHBTsgi7EA0OQLIZ9IsR iHrxnS/3Dgt+AGxP5PkznCuuoyZhIvWtUiDfTFJSRMDEWIOWNasWRqzs1L+WrY3TCGiR xpIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=KKcee07VdDtNbKV5MDpwdxP98sqOs6wTZtEt7ghJXCQ=; b=NO5ANjk/WVOSL8pg8UGKw/ua53QcTTukzfOGV4oU31fudtQ9+f1yuVn6CzevTZSzuu s68LyaFCTFLCPpRbeq8rFmApiOt2TNESO+6iXEogWmzBIUC7PiO04EkJ87ZPXK+lkw8O lhjCjQ7xoAaxmHghdLqr2yX13VePNWk4GHe+HjmAVWRc24L7LZBA+EbvfqHwP5G5T34Z btxnDHRmHBov6MKchxHlGOFTxLgktXnSXl3x4fXrDjPUtrrUC12/1IY6aYirteAlWP3Y 1r6Tx7NcJusLP85c2r6iOKRD0aLUccZPX7EXIKhu/onmiUdwQiJci7CV+NJmbtHXOpPT zCFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="tvo+AV/g"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si485486otn.118.2020.02.27.15.36.49; Thu, 27 Feb 2020 15:37:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="tvo+AV/g"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729812AbgB0Xgl (ORCPT + 99 others); Thu, 27 Feb 2020 18:36:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:43290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728993AbgB0Xgl (ORCPT ); Thu, 27 Feb 2020 18:36:41 -0500 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63EB82469B; Thu, 27 Feb 2020 23:36:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582846600; bh=5WYsINO5sNEHyaFQwn3i+MXTlgu1tZ++rR45XVTJQpk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tvo+AV/gfIOFHtQN8+WJBG3+9u2Emcse9ki/xDK1Mvgj3t6C9O91qTsWwmh8YFCCM dW6hNKVSPqbuBv5Eht+sGvhfFVFcmmz98CQhjLzpqNZGWY3uQTPhrT1LaVJ7pk43uc RijK5fz8xP23y0dlZMJIStAxUb14AhNElU69adwY= Date: Thu, 27 Feb 2020 15:36:39 -0800 From: Andrew Morton To: Johannes Weiner Cc: js1304@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Hugh Dickins , Minchan Kim , Vlastimil Babka , Mel Gorman , kernel-team@lge.com, Joonsoo Kim Subject: Re: [PATCH v2 0/9] workingset protection/detection on the anonymous LRU list Message-Id: <20200227153639.951d6a42080e8d4227872e64@linux-foundation.org> In-Reply-To: <20200227134806.GC39625@cmpxchg.org> References: <1582175513-22601-1-git-send-email-iamjoonsoo.kim@lge.com> <20200226193942.30049da9c090b466bdc5ec23@linux-foundation.org> <20200227134806.GC39625@cmpxchg.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 27 Feb 2020 08:48:06 -0500 Johannes Weiner wrote: > > It sounds like the above simple aging changes provide most of the > > improvement, and that the workingset changes are less beneficial and a > > bit more risky/speculative? > > > > If so, would it be best for us to concentrate on the aging changes > > first, let that settle in and spread out and then turn attention to the > > workingset changes? > > Those two patches work well for some workloads (like the benchmark), > but not for others. The full patchset makes sure both types work well. > > Specifically, the existing aging strategy for anon assumes that most > anon pages allocated are hot. That's why they all start active and we > then do second-chance with the small inactive LRU to filter out the > few cold ones to swap out. This is true for many common workloads. > > The benchmark creates a larger-than-memory set of anon pages with a > flat access profile - to the VM a flood of one-off pages. Joonsoo's > first two patches allow the VM to usher those pages in and out of > memory very quickly, which explains the throughput boost. But it comes > at the cost of reducing space available to hot anon pages, which will > regress others. > > Joonsoo's full patchset makes the VM support both types of workloads > well: by putting everything on the inactive list first, one-off pages > can move through the system without disturbing the hot pages. And by > supplementing the inactive list with non-resident information, he can > keep it tiny without the risk of one-off pages drowning out new hot > pages. He can retain today's level of active page protection and > detection, while allowing one-off pages to move through quickly. Helpful, thanks. At v2 with no evident review input I'd normally take a pass at this stage. But given all the potential benefits, perhaps I should be more aggressive here?