Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2556993yba; Mon, 6 May 2019 07:59:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1cwdQH17NJaw9jUNixMZgjKwAUX5qN4VWWMGvi8GGWQD0V6zxkwOQCmqDVBsMCOFGSbQg X-Received: by 2002:a62:ee04:: with SMTP id e4mr7111777pfi.232.1557154792787; Mon, 06 May 2019 07:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557154792; cv=none; d=google.com; s=arc-20160816; b=MkdzkQJ8ChT3BfkPtqfg41CWPiDhfYxIl9M3Koy8QI1ibn7yEYYk3C/8MuEPSiLbqd wHMG/yl37GI71lsqALw5iitKa96cS4WR0dhDDjz+HY1o77UISsxG7OoHqnquLnahOBaC +HrGwXK1MeUR4l56vfWAHU/pIv7Nf9Xb/N0TJXKVtorZf9598H/fQvee/r30ntJQeXs2 li5BqT7vlFaisXzcNX+2Dx1xT2jPWOAsa3sw6NWbfCZcX9aijnIxasQdGSKeZe7WsDH6 fPJ2/RTFZVYpNgQFKW0Jm21jFJFvUPetOKIX9f4FhKk+BNC/ZoL8t3sETQJBQW+BHxHz 8PRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KsZcNzF1hybdUscCtnXpBh/F254onDMylJHf8yLDCZI=; b=MKSzqmgLsVV9Md4dOONUunnB5Awbbs+fCCjrZO2blJHucBIpB59EeSr2Dp3a1L86yR oxEA31sLEE+vvyHdGPkGI9Emal/4FnYwRMsxZOu5q5542L7TwNZ29uAZiKL4ISLEOw9X wW8T5HGk6yt6qyNjV5WcpHDeqOYsnLK9nhuSx5fYwpZ/Jg4H9avweuT+r/LpO0FjP4em 1y8/ev6bg6XsNAycRDVcTxzwBgu6EaO5KCIgCYCXuI+YrfzDUO3V4TWMFsUzd0SrJwCJ Bb0t/AWNNM452s7QuNVy+/sQ33aBp74zbqfMUG58SjhOk87YHFXdht4Zw32xL13C1pSj XJvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=x3BFXGD8; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h29si15307316pfd.180.2019.05.06.07.59.37; Mon, 06 May 2019 07:59:52 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=x3BFXGD8; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728706AbfEFO5c (ORCPT + 99 others); Mon, 6 May 2019 10:57:32 -0400 Received: from mail-pl1-f170.google.com ([209.85.214.170]:40713 "EHLO mail-pl1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727705AbfEFO5a (ORCPT ); Mon, 6 May 2019 10:57:30 -0400 Received: by mail-pl1-f170.google.com with SMTP id b3so6499170plr.7 for ; Mon, 06 May 2019 07:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KsZcNzF1hybdUscCtnXpBh/F254onDMylJHf8yLDCZI=; b=x3BFXGD8/emXf5QlCrkujCa+PcJkvQN9xszX7tdTYH90aT3XTCMaOe3K68c7JRmL4N PaynnQ0d5Kz8wipUcBEIe//4NdtuUtittkvJr70GCPT/WuyV9Vz8AQzWngVc1rn5CD90 6A8L+TWxtZbQBdL72kK4/oLteDbFe3ZokokuKMv2CEt8vE2RO3TsNkEREaF6nci78oJJ z813KcEivWw1mvOwB3+/VpVuBuNbM9UAD8rTf0VabAJA/WouLrSW+lPFFpurm+JAikXS JlkpmQNX9dj3NaGzoaHKyLEWOUFzv1f28csn/BCkETIoKCEIESbq3cbFLbU4Yfwuw9km uW0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KsZcNzF1hybdUscCtnXpBh/F254onDMylJHf8yLDCZI=; b=Tx+5I/yLXwH7Fqxo6mkM+XkSEnpLZ0jtT+kr+M5ygvBr3yK4zhXM3I/i9JC8neL/5T l59unIUtrccZzTgqk8Mo1WsddWgZhN6NER+WQb6UIqLQRdB2xq9F81667UM/iJTFGo2Q bLcP1AGAWu96geKD/tC5tUo2mmaj8BeEja69xnaoOvRIc6ZaTyjRibF0uuK2adMZlLFq 9eQyUOIhmtE7uv7TTJgTERJ3EHzDXNqpEDvq9CYAns9W+Tu4dehK3cZzSH70ps3zZUHt 2mGFe0VtDihRLN1IwuSC+vWvDkNgOKLJUSU7fuNK88OxINOtPcjgs7omH+A7KyTenP8F V2RQ== X-Gm-Message-State: APjAAAVyDcGKWmPHNY5eDdhRa89DWbar3+nkfT3bjeMiuf/vYpzbUbWk Hs3rQOB8W9biyXbusslyZ4CjVw== X-Received: by 2002:a17:902:2825:: with SMTP id e34mr33208399plb.264.1557154649848; Mon, 06 May 2019 07:57:29 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::3:32a0]) by smtp.gmail.com with ESMTPSA id b77sm23821195pfj.99.2019.05.06.07.57.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2019 07:57:28 -0700 (PDT) Date: Mon, 6 May 2019 10:57:27 -0400 From: Johannes Weiner To: Zhaoyang Huang Cc: Andrew Morton , Vlastimil Babka , Pavel Tatashin , Joonsoo Kim , David Rientjes , Zhaoyang Huang , Roman Gushchin , Jeff Layton , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [[repost]RFC PATCH] mm/workingset : judge file page activity via timestamp Message-ID: <20190506145727.GA11505@cmpxchg.org> References: <1556437474-25319-1-git-send-email-huangzhaoyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1556437474-25319-1-git-send-email-huangzhaoyang@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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]. > > [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.