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=-9.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 051E4C4361B for ; Thu, 10 Dec 2020 12:06:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 607C623D9D for ; Thu, 10 Dec 2020 12:06:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 607C623D9D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 896116B0071; Thu, 10 Dec 2020 07:06:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 845996B0072; Thu, 10 Dec 2020 07:06:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75B166B0073; Thu, 10 Dec 2020 07:06:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 623DD6B0071 for ; Thu, 10 Dec 2020 07:06:53 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2291D1EE6 for ; Thu, 10 Dec 2020 12:06:53 +0000 (UTC) X-FDA: 77577246306.27.roof62_440a77b273f8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 0748A3D663 for ; Thu, 10 Dec 2020 12:06:53 +0000 (UTC) X-HE-Tag: roof62_440a77b273f8 X-Filterd-Recvd-Size: 3934 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Thu, 10 Dec 2020 12:06:52 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id w5so3256079pgj.3 for ; Thu, 10 Dec 2020 04:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OWa3SUaQxu3j5FIpQIe/p+QzMyJ2FyQxKyFo8cDSpHo=; b=V96KHfuAA7lz3IMZVg2gJdQn8dsc2BXeMiTeV00VzCzwIeC8oYipDfVGdykg4CTmJ+ cldxaeujqtnSgODpbPGEiP3itaYp1dmC2rYRZ5Q776Wd0SduzodpuIYtO1rUqGVLFUoG aV41cn0WZFK0daTpUS8u9jdj+vSb7sD0uxGOstqOnycmDH+uSWpfxQ7E7IOWPqqb6lZR zMLMQzFbHSO340QP5qnB+BlipKyC55O2QkfeozwzWf7MZJ9f9UatEhHyXIWASgH7WjUi 8fJMOc9UVqYN7FCi5Cjbik66B8oN+/4XoNNVOQysmhvJ5ErEIKgQNcRudITp6S6Ejwor q4mg== 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=OWa3SUaQxu3j5FIpQIe/p+QzMyJ2FyQxKyFo8cDSpHo=; b=fyw8lCdsIjGHNP8dt+a7b3cGOy3G/SE+QowR1VDJfZtrydUv+xpeaBPCGguoafZN2o ZzTHrAKqS9NNBgfelvAUgmPyYol020F7h10o8j/bFeAViFc5ArkKHbVyAWC5rYvIgX16 DQFTzAHEZROpOrlJVjiWMSSDZwVXgI5KQA+9NlCOO6abvZpM2e04ZnxHFZLMPCaxpjRG T7VmE3gwVP5q/gQEvppOQTXuNEBZattof32SZCvZFGArmRAkH5MxbCNOs3OK7F1azg89 qELruJRFYcfoN39iqiuQlZLlYx/WeGTmRM0bavN0TmrWfyu1PlGqusxXXDdQuoLdgeYn Hd+Q== X-Gm-Message-State: AOAM533PGI+jom2syZDwVm8m/SAd1IW3N6LPk8JwINblst/JsLdPhtR9 tkc7916x8mfZUNtZaDX/s/I= X-Google-Smtp-Source: ABdhPJyZlS3+15ZEC5t5+LkuVM3zxUal0OQSRddW/Y6N9zHth+z1EOWVcUAJg8gKht5y8jWLJLOlbg== X-Received: by 2002:a63:2242:: with SMTP id t2mr6301433pgm.428.1607602011689; Thu, 10 Dec 2020 04:06:51 -0800 (PST) Received: from js1304-desktop ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id y10sm6224480pjm.34.2020.12.10.04.06.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Dec 2020 04:06:51 -0800 (PST) Date: Thu, 10 Dec 2020 21:06:44 +0900 From: Joonsoo Kim To: Yu Zhao Cc: Andrew Morton , Johannes Weiner , Vlastimil Babka , linux-mm@kvack.org Subject: Re: [PATCH] mm: don't SetPageWorkingset unconditionally during swapin Message-ID: <20201210120554.GA19730@js1304-desktop> References: <20201209012400.1771150-1-yuzhao@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201209012400.1771150-1-yuzhao@google.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Dec 08, 2020 at 06:24:00PM -0700, Yu Zhao wrote: > We are capable of SetPageWorkingset based on refault distances after > commit aae466b0052e ("mm/swap: implement workingset detection for anonymous LRU") > This is done by workingset_refault(), which is right above the > unconditional SetPageWorkingset deleted by this patch. > > The unconditional SetPageWorkingset miscategorizes pages that are > read ahead or never belonged to the working set (e.g., tmpfs pages > accessed by fd). When those pages are swapped in (after they were > swapped out) for the first time, they skew PSI (when using > async swap). When this happens again, depending on their refault > distances, they might skew workingset_restore_anon counter in > addition to PSI because their shadows say they were part of the > working set. > > Signed-off-by: Yu Zhao Acked-by: Joonsoo Kim Thanks