From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5324C433DB for ; Wed, 10 Feb 2021 07:12:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3560364E53 for ; Wed, 10 Feb 2021 07:12:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3560364E53 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7E2FD6B006C; Wed, 10 Feb 2021 02:12:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 792236B006E; Wed, 10 Feb 2021 02:12:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 632C16B0070; Wed, 10 Feb 2021 02:12:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 49E036B006C for ; Wed, 10 Feb 2021 02:12:45 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1AAD618575600 for ; Wed, 10 Feb 2021 07:12:45 +0000 (UTC) X-FDA: 77801490690.05.09DE612 Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) by imf05.hostedemail.com (Postfix) with ESMTP id 92E2DE0001AA for ; Wed, 10 Feb 2021 07:12:43 +0000 (UTC) Received: by mail-il1-f178.google.com with SMTP id o7so966407ils.2 for ; Tue, 09 Feb 2021 23:12:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=q3AI3PxYvElwnsak10yIQDMqaAMIiPeIHqC/YROvbiU=; b=sOYXbBDOj0cvSmQ6bcRtVtTgrod13gbBEFBUxEqPIoYbY2nbXakEVTXJrmf9/NGP67 0jWEdxIDJyFDXQ38ZEWwM3Gpf+szpYPjDVhXybB4di0jJep/H/LH2DP/82rxc5gt4IiY nvVsRVtHqOw0hJzgoGxBTng053Y/30K3WmE5SBLGiqyC7Qi34ZiuqrRgZl1MnV7M+TzT 00vlFnGlWF8jQN4yIUZWrQMUk3uDT8CPKRwkO+U/CisWWF1mqa6K1jA46/MhLFBT3ZPy xSyKZA0gIdDmDtkN69QQnu7kqd/pexfXiK+GDy2hTX6+PyjViFfRhPkTamA9zKXmmAJ8 U4PA== 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; bh=q3AI3PxYvElwnsak10yIQDMqaAMIiPeIHqC/YROvbiU=; b=hfi79iPtWRJ4NuVGerp464d1a3EfRviOAqwLLhDdR41gPNHGpu1ALzROaEwbbwLNib N7C9HaD0FJISVkJNZAXl13Aan7kv5mm4O37FG4er6/mjOLKJiLU1orldIXW1zabtXBk5 oK+PtJynvIdErB9mdvvB+GChhUG8u748QlUSjxVjWtwwKtSo0lMGYFZyd9aC9ZlSOo6w 8DWCyhhnMvbzusfdyDWoY51CymFeEOJBMMSvquj+XvnWwPj7zQXtrRTqGuHnxsi3Drtg HijJMirsd/fPH/9KgKYsvacA5F8VKqJYRqzUHFlYosQYY6U6vRLRPs6YJE0675/+aWSy C+WQ== X-Gm-Message-State: AOAM530wkV7dLa989SC2NGjIgoGCy9CSdlMgN8mF7U7SLzKShXu0g2Vq wx/x1TuhdpHiy8UZuTwf7S6C41g2UFaupg== X-Google-Smtp-Source: ABdhPJzyYJ7qhaqf0tnYOjDHZBz2QGuva1Dj6ve1vhEpdlIBVskFuFjkso6YpHw/gTg5vcQDc0nR2A== X-Received: by 2002:a05:6e02:1a4d:: with SMTP id u13mr1770493ilv.176.1612941163487; Tue, 09 Feb 2021 23:12:43 -0800 (PST) Received: from google.com ([2620:15c:183:200:985b:af79:841f:dd9e]) by smtp.gmail.com with ESMTPSA id a14sm572533ilj.39.2021.02.09.23.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 23:12:42 -0800 (PST) Date: Wed, 10 Feb 2021 00:12:38 -0700 From: Yu Zhao To: linux-mm@kvack.org Cc: Sonny Rao , Jann Horn , Matthew Wilcox , Jesse Barnes , Linux Kernel Mailing List , page-reclaim@google.com Subject: Re: [page-reclaim] Augmented Page Reclaim Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 5umjq7r46xm694of3bsdiw7hi5ncn91r X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 92E2DE0001AA Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=mail-il1-f178.google.com; client-ip=209.85.166.178 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1612941163-25213 X-Bogosity: Ham, tests=bogofilter, spamicity=0.005981, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Feb 09, 2021 at 01:32:58PM -0800, Jesse Barnes wrote: > > ====================== > > Augmented Page Reclaim > > ====================== > > We would like to share a work with you and see if there is enough > > interest to warrant a run for the mainline. This work is a part of > > result from a decade of research and experimentation in memory > > overcommit at Google: an augmented page reclaim that, in our > > experience, is performant, versatile and, more importantly, simple. > > Per discussion on IRC, maybe some additional background would help. And I'll add more details to the doc included in the tree once I've finished collecting feedback. > In looking at browser workloads on Chrome OS, we found that reclaim was: > 1) too expensive in terms of CPU usage We have two general metrics for this item: CPU time spent on page reclaim and (direct) page reclaim latency. CPU usage is important to everybody but latency is also quite important for phones, laptops, etc. > 2) often making poor decisions about what to reclaim We have another two metrics here: the number of refaults and the number of false inactive pages. For example, it's bad if pages refault within a hundred of milliseconds after they have been reclaimed. Also it's bad if reclaim thinks many pages are inactive but later finds they are actually active. > This work was mainly targeted toward improving those things, with an > eye toward interactive performance for browser workloads. > > We have a few key tests we use for that, that measure tab switch times > and number of tab discards when under memory pressure, and this > approach significantly improves these (see Yu's data). We monitor workload-specific metrics as well. For example, we found page reclaim also affects battery life, tab switch latency and the number of janks (pauses when scrolling web pages) on Chrome OS. I don't want to dump everything here because they seem irrelevant to most people. > We do expect this approach will also be beneficial to cloud workloads, > and so are looking for people to try it out in their environments with > their favorite key tests or workloads. And if you are interested in our workload-specific metrics, Android, Cloud, etc., please feel free to contact us. Any other questions, concerns and suggestions are also welcome.