Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3354987yba; Mon, 6 May 2019 23:07:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiPzpJpvTXIcEL68zh9jyOhURk2oYQfrMt01T6ondvwufYofevMLrFoBpBjQ5Kj8HQyddp X-Received: by 2002:a65:6449:: with SMTP id s9mr6904473pgv.90.1557209246165; Mon, 06 May 2019 23:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557209246; cv=none; d=google.com; s=arc-20160816; b=LBlTl47UkGOlLsJVJt9JUfqcyC5Fg5T5aTGW/SHUBxZjKF9REK62QHjMUHnFSd7vL2 B1pPFKZg4ncUN1Do43n8PwvI7nZC27f3EB8cABVHpUydDotrcipsPSPLYxv7q1/ELdTu 01JaDW11mdIMGStuCD1j2ov43XpeUO1Vm4DHDiwZYvzsjb/2dGudyyyD1DFVRsnEuawg MFvnHNX/BDJMOGE7vanym6OuJz1ACJ/erSOIJXPhVn0osukVkmQeHcAXeO3n4/jZom1K 3PaD1G3HodKN2QGIaIahiJT6MTRyzHOAA6iNiVLQw9b6lbjgSHPJiGqfT/4sXdC8JE09 cYaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QZm07w2nSCiVVM+WjYPWUvz7wW+nL7XT9qvn8eYdy3A=; b=NDcNiiYmlUGc1T8SJ0NyDeY90vSDKO6fMu0667FNY3XCQkY3ULEUv+kwDxMpafCDa5 h1JOQgor3L+8F2cb3D6e7FCKwnm27KFjryPw5+V9udMqd/Texft/oA+NjXa+8wBUKhVS nuIBUqiuF//xP1t1Z4RCnLHnVFWZ6C3EPwOcQRqPZMsucu44Zdi+x+nkvNomJ9Fm9ziY wXKG6UKAPgSuV7Orq4IK1X7GqsqtCktmWymxliqAAkWGIDdVA1GSDM0GW2f+L0Q1G0wd bCzz7RmOuoDmzcCyQpTZ9wxfJSQmsktwVSb174Dk68dnmB2adfmO7kEws/FvwZPP8c/w 4sMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s8dO8ROD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si18267314plq.328.2019.05.06.23.07.10; Mon, 06 May 2019 23:07:26 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=s8dO8ROD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbfEGGGY (ORCPT + 99 others); Tue, 7 May 2019 02:06:24 -0400 Received: from mail-ed1-f47.google.com ([209.85.208.47]:38702 "EHLO mail-ed1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726964AbfEGGGX (ORCPT ); Tue, 7 May 2019 02:06:23 -0400 Received: by mail-ed1-f47.google.com with SMTP id w11so17545123edl.5 for ; Mon, 06 May 2019 23:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QZm07w2nSCiVVM+WjYPWUvz7wW+nL7XT9qvn8eYdy3A=; b=s8dO8RODm3uMkCQw7BIWmMyABI0C1pYr2apMhdPiSkFP6bbNhtgHKr3/jYpzpeh4JJ qwhI+K6TykibR4CMsBrAXVJTbJKuBZJxieq+hk0SBdOWQh30lWltBeOlxCAYN3W3G5kf lHJxVYgKUtWlZNbmP/kBOLWFozOI16ok5/HpgPqAspD1694ZK8lLWKY32QBFhOlFJ5Gb Z5Gp7Uaf0qpz+W5mdgvizxUtiDNUVZP1LP2Du8LolUcjwpIkcJe0gm2itU6o2ojjsTz/ k52m2uroKyHEfQtmox/LagM79E84Bwt57rIT8sBl8XjO3UfftnHVGgavNSvDjJoN0lP5 5gzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QZm07w2nSCiVVM+WjYPWUvz7wW+nL7XT9qvn8eYdy3A=; b=FIa5T/Lw9UDTZQ9SM/ACk2fZ0pcaDSlGTtuRmaBlNXmLhipod6WuT45vudGoEyuZC+ WfxYLSLLECQjE+NXjCNGKY9W/yCXXA8pzwNOX7FwW1nA4aAhnfCXM+QrCeRu71ktSLdP zgGp5he7OC/wkmeEgT7kJaS9pW3tujlZ20E7SXNFeK/tWEtNX3UsOsYcx2cU7pXZg0CH FggZt3PRo012DBqTLedlWlHYuC8uxtdZcOQrC/xebtojCpIg3E+hvxbvD0I5wKLQADiz DRzamvYuXXtPbkQx/NQyfXdEZZO748tBRqUK0GMt7YagpyFhDlrrD2iw8ozvIqU+qE7R sRCg== X-Gm-Message-State: APjAAAU52GSEJuDwCbcoFs9PZn62g7uDDm1SWfe3u1vE4tnPXMBwykUR Y0vKeuEv4+tPC4crasO5L/qNjUrQrtizXDwN9i8= X-Received: by 2002:a17:906:1903:: with SMTP id a3mr22284151eje.37.1557209181270; Mon, 06 May 2019 23:06:21 -0700 (PDT) MIME-Version: 1.0 References: <1556437474-25319-1-git-send-email-huangzhaoyang@gmail.com> <20190506145727.GA11505@cmpxchg.org> In-Reply-To: <20190506145727.GA11505@cmpxchg.org> From: Zhaoyang Huang Date: Tue, 7 May 2019 14:06:09 +0800 Message-ID: Subject: Re: [[repost]RFC PATCH] mm/workingset : judge file page activity via timestamp To: Johannes Weiner Cc: Andrew Morton , Vlastimil Babka , Pavel Tatashin , Joonsoo Kim , David Rientjes , Zhaoyang Huang , Roman Gushchin , Jeff Layton , Matthew Wilcox , "open list:MEMORY MANAGEMENT" , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 6, 2019 at 10:57 PM Johannes Weiner wrote: > > On Sun, Apr 28, 2019 at 03:44:34PM +0800, Zhaoyang Huang wrote: > > From: Zhaoyang Huang > > > > this patch introduce timestamp into workingset's entry and judge if the page is > > active or inactive via active_file/refault_ratio instead of refault distance. > > > > The original thought is coming from the logs we got from trace_printk in this > > patch, we can find about 1/5 of the file pages' refault are under the > > scenario[1],which will be counted as inactive as they have a long refault distance > > in between access. However, we can also know from the time information that the > > page refault quickly as comparing to the average refault time which is calculated > > by the number of active file and refault ratio. We want to save these kinds of > > pages from evicted earlier as it used to be via setting it to ACTIVE instead. > > The refault ratio is the value which can reflect lru's average file access > > frequency in the past and provide the judge criteria for page's activation. > > > > The patch is tested on an android system and reduce 30% of page faults, while > > 60% of the pages remain the original status as (refault_distance < active_file) > > indicates. Pages status got from ftrace during the test can refer to [2]. > > Hi Johannes, Thank you for your feedback. I have answer previous comments many times in different context. I don't expect you accept this patch but want to have you pay attention to the phenomenon reported in [1], which has a big refault distance but refaulted very quickly after evicted. Do you think if this kind of page should be set to INACTIVE? > > [1] > > system_server workingset_refault: WKST_ACT[0]:rft_dis 265976, act_file 34268 rft_ratio 3047 rft_time 0 avg_rft_time 11 refault 295592 eviction 29616 secs 97 pre_secs 97 > > HwBinder:922 workingset_refault: WKST_ACT[0]:rft_dis 264478, act_file 35037 rft_ratio 3070 rft_time 2 avg_rft_time 11 refault 310078 eviction 45600 secs 101 pre_secs 99 > > > > [2] > > WKST_ACT[0]: original--INACTIVE commit--ACTIVE > > WKST_ACT[1]: original--ACTIVE commit--ACTIVE > > WKST_INACT[0]: original--INACTIVE commit--INACTIVE > > WKST_INACT[1]: original--ACTIVE commit--INACTIVE > > > > Signed-off-by: Zhaoyang Huang > > Nacked-by: Johannes Weiner > > You haven't addressed any of the questions raised during previous > submissions.