Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp149074ybd; Fri, 28 Jun 2019 16:34:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwe7aTqhQAYaaJRXoSB8CLR/sN3W0jLVeeZslyja8r/94j0eIqLeubUe9gle6ixQkN1afmb X-Received: by 2002:a63:fb4b:: with SMTP id w11mr11559730pgj.415.1561764886886; Fri, 28 Jun 2019 16:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561764886; cv=none; d=google.com; s=arc-20160816; b=mNCawTz/5SjRKGeocJymGoxGGuKOt04KoMmADx4KxDkTmhT4AdIHztQlHupezgc4cP rJ+iWss9q35AT+BAgABiga1gWWN+ndZIMFKJ5R0s8ZOCZzlMJ05/OGa1T9ObuTqD8jvL CPy5f5sHaIC5ZxfEGpYaCOVjwEWnXDuXShpxdVnN8iCLzTW8G7tcg4QwCKt8kJ4a4ATl XHyjwdjtVu5t4DCgynxlkxGAFitQhd/4CdW40upMywjz2/4+dPHC+CY5ToMCBv2G+VfP tKf5N3NwvA9kPsAYCVKnEM/f96SjbB+emiiPXw84NBOGAyBMHx4GoWPbfsyTyPXG5sNW Qh2w== 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=KrgrAoIPZ1LQ1VyQOLNmxmRQwkVpu3ldX8C9irBrRvU=; b=tKwy/9i1AlzAFIc+cNY3kqb2YLvIKf2J90rupRK2nG/GmJhOorvr8OwaXQr9vD1euM DQUGCDmsoz5ij0MdvjPTXl/n+xJEV72gMNbqBvWeAZSFo9jMAyFVjZU7FGTKla7dkZXO Bun9FmliPJSrx0iuy3TfzKmtq2mldP/lnzPfq3GkXJLHYtp9wNyh2/0godPtL/NCpnW9 PtL7UDAF42GQr2yQnmYgc5xFHrE+Z+m3rsoem8J4BLXSVF7rdQeNa92G6gqU5PORph5Q t30LBaNz4Rr/HAc3g7DSCxwkS9WkSQAabw6gxydiKPj8Tr7UdcTxZQxj4UPlY9y7uIM/ u9VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FuXCRWTA; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h194si3823354pfe.214.2019.06.28.16.34.30; Fri, 28 Jun 2019 16:34:46 -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=fail header.i=@gmail.com header.s=20161025 header.b=FuXCRWTA; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726977AbfF1XeU (ORCPT + 99 others); Fri, 28 Jun 2019 19:34:20 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:32906 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726672AbfF1XeT (ORCPT ); Fri, 28 Jun 2019 19:34:19 -0400 Received: by mail-pg1-f193.google.com with SMTP id m4so3253399pgk.0 for ; Fri, 28 Jun 2019 16:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KrgrAoIPZ1LQ1VyQOLNmxmRQwkVpu3ldX8C9irBrRvU=; b=FuXCRWTAM+9ahhxbr5qRNj6BgsiLoHnFWtS3E/mbYN3VEM9nacepKLwqukT6/a5DpQ 8rGhoiGM77FVD5YSg8amgM2e4bGYcfvJ08VPz2iRAFW1jvApJZis32GTE2YhY2CrzFnP PC+VYJ7ZGK9aw2KYLwsjRaYWsB5cW7yQMB+9w29z9p5XaMDx2Q4u1ua1sLOdrpFU+b37 EBXaa+OuUBn754W/1n1g2dWtzETfkn4sIt5Y/iN25C7NyOh3z2jCx+cNqAuK9kol6iOY oLXTY+eCtjUWMYBkPYAGHguhSSluwdMytMAf09GCumQXseLeqXfzkVpgpU1EzbNO/C30 qpYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=KrgrAoIPZ1LQ1VyQOLNmxmRQwkVpu3ldX8C9irBrRvU=; b=VgEv4DuiWOFSm5/cB6cvm/l0Z3NCoFE8j0xIqD8VbULt7LRWsq2WnEH55HdUad/p4n FpM+KcTYYvnyhGogCRMfADDplk1dmRQrcCmOKo8pjdyra0J3P75J31aNNEfhXNEPJgtg 5K00G8rYlAJQAE9Q3LhsudQaOtP5PDkU6wl3VaaNE0AWEDAOaxczYKNOwx+dkM4yN5Tx 6gXWcjBFVXcRrrTvqcSYwW83QLiPceWrWKYZuZVqoHXVe5E3CZX4gcdQoJZd359Cambv rlA3lxgNBiti7Cze5BWWNwsJ7wAhcxuoONGoIQWxuIdZ4Tbflgvc8apuQW7bYqAt0SSG WIhw== X-Gm-Message-State: APjAAAWUzzTJWxFscW9khBXxNGfRH4sAAj+aBkbKJgj0NVcNY5NwtDlB seGHqkU24WYIjcpdDz7xljyes1K2 X-Received: by 2002:a63:5b1d:: with SMTP id p29mr11179249pgb.297.1561764858832; Fri, 28 Jun 2019 16:34:18 -0700 (PDT) Received: from google.com ([2401:fa00:d:0:98f1:8b3d:1f37:3e8]) by smtp.gmail.com with ESMTPSA id e6sm3320634pfn.71.2019.06.28.16.34.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 28 Jun 2019 16:34:17 -0700 (PDT) Date: Sat, 29 Jun 2019 08:34:13 +0900 From: Minchan Kim To: Johannes Weiner Cc: Kuo-Hsin Yang , Andrew Morton , Michal Hocko , Sonny Rao , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: vmscan: fix not scanning anonymous pages when detecting file refaults Message-ID: <20190628233413.GA245333@google.com> References: <20190619080835.GA68312@google.com> <20190627184123.GA11181@cmpxchg.org> <20190628065138.GA251482@google.com> <20190628142252.GA17212@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190628142252.GA17212@cmpxchg.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 28, 2019 at 10:22:52AM -0400, Johannes Weiner wrote: > Hi Minchan, > > On Fri, Jun 28, 2019 at 03:51:38PM +0900, Minchan Kim wrote: > > On Thu, Jun 27, 2019 at 02:41:23PM -0400, Johannes Weiner wrote: > > > On Wed, Jun 19, 2019 at 04:08:35PM +0800, Kuo-Hsin Yang wrote: > > > > Fixes: 2a2e48854d70 ("mm: vmscan: fix IO/refault regression in cache workingset transition") > > > > Signed-off-by: Kuo-Hsin Yang > > > > > > Acked-by: Johannes Weiner > > > > > > Your change makes sense - we should indeed not force cache trimming > > > only while the page cache is experiencing refaults. > > > > > > I can't say I fully understand the changelog, though. The problem of > > > > I guess the point of the patch is "actual_reclaim" paramter made divergency > > to balance file vs. anon LRU in get_scan_count. Thus, it ends up scanning > > file LRU active/inactive list at file thrashing state. > > Look at the patch again. The parameter was only added to retain > existing behavior. We *always* did file-only reclaim while thrashing - > all the way back to the two commits I mentioned below. Yeah, I know it that we did force file relcaim if we have enough file LRU. What I confused from the description was "actual_reclaim" part. Thanks for the pointing out, Johannes. I confirmed it kept the old behavior in get_scan_count. > > > So, Fixes: 2a2e48854d70 ("mm: vmscan: fix IO/refault regression in cache workingset transition") > > would make sense to me since it introduces the parameter. > > What is the observable behavior problem that this patch introduced? > > > > forcing cache trimming while there is enough page cache is older than > > > the commit you refer to. It could be argued that this commit is > > > incomplete - it could have added refault detection not just to > > > inactive:active file balancing, but also the file:anon balancing; but > > > it didn't *cause* this problem. > > > > > > Shouldn't this be > > > > > > Fixes: e9868505987a ("mm,vmscan: only evict file pages when we have plenty") > > > Fixes: 7c5bd705d8f9 ("mm: memcg: only evict file pages when we have plenty") > > > > That would affect, too but it would be trouble to have stable backport > > since we don't have refault machinery in there. > > Hm? The problematic behavior is that we force-scan file while file is > thrashing. We can obviously only solve this in kernels that can > actually detect thrashing. What I meant is I thought it's -stable material but in there, we don't have refault machinery in v3.8. I agree this patch fixes above two commits you mentioned so we should use it.