Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3975254ybh; Tue, 6 Aug 2019 04:27:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoa538NEdx9++ktQNxOzNCJj2Rdgu5sCCxGqR6zzNgFgTbX3fHVXt/8/U5Ef8Xy2NeDcBE X-Received: by 2002:a63:484a:: with SMTP id x10mr2594472pgk.430.1565090841567; Tue, 06 Aug 2019 04:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565090841; cv=none; d=google.com; s=arc-20160816; b=fw/555d+pKIyEYeOL+942hd2THl03wA62U1aRjJD+JunHif4T0t5N6lf5ZvTu+V5RM YZKPwHbZUuPuZs+bf91Qp9sELFp+jSlvDge2eo8O8ePVBO02xfmvsbawIocRlY/sm6m/ 0yx/PVREZebQdwhtGjto/O7vlxeS1DLk7CgxWpCK8OxXVT5NvG5uOq4wQ282zH1pcV4x /ln6gtkrqoudD4tip1VHRNI/nV7FGBGO2Aw89QAO6Pkzk6CO7jh+NIjWlfG5bei+YFU0 injW885PnmMrr1xb+4GQbtaeYVodHlKAcSRiLGNdqPhkvP/g90O15iVhjoeA4oorSw5Z 3IqQ== 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=eQDxozI2qjukpUkcofnkYlDLvFKSd1P/XqoYuWp8Iko=; b=VB0C1Ucnop4a1W2MHeV/6OWMQCULZ8cgz7fWeDESnjYnYwveJUO1wUJR6+BPIkIN0j HdUYyJVnwu13FrGwuROVASgwuJDcDkk52zQMF3OxjE1lzdAdQE5Pdb7W69iEYW78hCjA EIGmxgPjKjeTLvNM1ZZVIxaSk9ThELIdlU/UxFZR5JNVY0iJaS9SG4Tfo9QngmW1BJNQ Q2nBb228qPsAXDtfC61+ORF0/Io1gbU8QQpxAPlWuKzyM7LicBmYsf2ix/tNeRuoxI9l WLUJifb3+gnJKZ6klcR2FGDcMlavmNHhXtCUT+vS8qftFeGJFEheLzHYF1kGQhsszDcZ L/+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=KdWHadNe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b41si42960331pla.409.2019.08.06.04.27.06; Tue, 06 Aug 2019 04:27:21 -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=@joelfernandes.org header.s=google header.b=KdWHadNe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732724AbfHFL0J (ORCPT + 99 others); Tue, 6 Aug 2019 07:26:09 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:38100 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbfHFL0J (ORCPT ); Tue, 6 Aug 2019 07:26:09 -0400 Received: by mail-pl1-f194.google.com with SMTP id az7so37726463plb.5 for ; Tue, 06 Aug 2019 04:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eQDxozI2qjukpUkcofnkYlDLvFKSd1P/XqoYuWp8Iko=; b=KdWHadNeW6pa2dnhFD6vGAJeFuZ4bU94l8h5hGmJoB6iVklb97AFdq2hkigQMM5/UW duwzf5xlAas4hj7F57fOHGW4Fbh0eAqKIwiEUMntWH0rzszBSsXQxg7vmdW0vXnYKvIV u177tjd2FQ7ASDBdqt2QwZ/5p/Ocdpipr0UPw= 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=eQDxozI2qjukpUkcofnkYlDLvFKSd1P/XqoYuWp8Iko=; b=iR1F76b7NfaVtIKttegJ2xvOaosUa8GQzn6YkwJbkQSWNAja3b4MN5/DFsAP1EP4lN WzkqFdEA0ut5OT41agDM1wdAn/DKi/GQU80HlFYbEkyOB2p+eI/MSZQqNlpOkE8fapLD 8piANTIWTFlDpvn37pfB4nY1NOOxOK/Qe5xocQtURgAqN1aoi+8X/KHG76zZtG0Q3eEI y/qNVVpV7qIQ/ZUYg6H79VxVMXCE/wKZFFzlxDaPYET/ZGkk7S1H2U2k4DwvByCUni1F VgGSfjWqj59zej32sbEIB8lb41DEVOtq0HyAb5XDFKV/QM8EeKfc6XYie5KYQZwEGbmn 0Lvw== X-Gm-Message-State: APjAAAVSy138xI29E7t23MBehtuD9su5/RLYAFj+4CMO+GTLRNLSLytV m2fjamT9v8oks8HUffpVAufspw== X-Received: by 2002:a17:902:a413:: with SMTP id p19mr2767311plq.134.1565090768446; Tue, 06 Aug 2019 04:26:08 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id h14sm113010833pfq.22.2019.08.06.04.26.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 06 Aug 2019 04:26:07 -0700 (PDT) Date: Tue, 6 Aug 2019 07:26:06 -0400 From: Joel Fernandes To: Michal Hocko Cc: Minchan Kim , linux-kernel@vger.kernel.org, Robin Murphy , Alexey Dobriyan , Andrew Morton , Borislav Petkov , Brendan Gregg , Catalin Marinas , Christian Hansen , dancol@google.com, fmayer@google.com, "H. Peter Anvin" , Ingo Molnar , Jonathan Corbet , Kees Cook , kernel-team@android.com, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Mike Rapoport , namhyung@google.com, paulmck@linux.ibm.com, Roman Gushchin , Stephen Rothwell , surenb@google.com, Thomas Gleixner , tkjos@google.com, Vladimir Davydov , Vlastimil Babka , Will Deacon Subject: Re: [PATCH v4 3/5] [RFC] arm64: Add support for idle bit in swap PTE Message-ID: <20190806112606.GC117316@google.com> References: <20190805170451.26009-1-joel@joelfernandes.org> <20190805170451.26009-3-joel@joelfernandes.org> <20190806084203.GJ11812@dhcp22.suse.cz> <20190806103627.GA218260@google.com> <20190806104755.GR11812@dhcp22.suse.cz> <20190806110737.GB32615@google.com> <20190806111452.GW11812@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190806111452.GW11812@dhcp22.suse.cz> 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 Tue, Aug 06, 2019 at 01:14:52PM +0200, Michal Hocko wrote: > On Tue 06-08-19 20:07:37, Minchan Kim wrote: > > On Tue, Aug 06, 2019 at 12:47:55PM +0200, Michal Hocko wrote: > > > On Tue 06-08-19 06:36:27, Joel Fernandes wrote: > > > > On Tue, Aug 06, 2019 at 10:42:03AM +0200, Michal Hocko wrote: > > > > > On Mon 05-08-19 13:04:49, Joel Fernandes (Google) wrote: > > > > > > This bit will be used by idle page tracking code to correctly identify > > > > > > if a page that was swapped out was idle before it got swapped out. > > > > > > Without this PTE bit, we lose information about if a page is idle or not > > > > > > since the page frame gets unmapped. > > > > > > > > > > And why do we need that? Why cannot we simply assume all swapped out > > > > > pages to be idle? They were certainly idle enough to be reclaimed, > > > > > right? Or what does idle actualy mean here? > > > > > > > > Yes, but other than swapping, in Android a page can be forced to be swapped > > > > out as well using the new hints that Minchan is adding? > > > > > > Yes and that is effectivelly making them idle, no? > > > > 1. mark page-A idle which was present at that time. > > 2. run workload > > 3. page-A is touched several times > > 4. *sudden* memory pressure happen so finally page A is finally swapped out > > 5. now see the page A idle - but it's incorrect. > > Could you expand on what you mean by idle exactly? Why pageout doesn't > really qualify as "mark-idle and reclaim"? Also could you describe a > usecase where the swapout distinction really matters and it would lead > to incorrect behavior? Michal, Did you read this post ? : https://lore.kernel.org/lkml/20190806104715.GC218260@google.com/T/#m4ece68ceaf6e54d4d29e974f5f4c1080e733f6c1 Just wanted to be sure you did not miss it. thanks, - Joel