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=0.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 222F9C433FF for ; Tue, 6 Aug 2019 11:07:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE5F620C01 for ; Tue, 6 Aug 2019 11:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565089673; bh=RKPqUyovBeWGLYto43tOHtrBXa5EcKyes0A+CROFwnw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=qvtVwl+ZuTdpXOizmBa/gC8fhDKCtiaMJzyxxoN61H8TA76swbSVFTmp11rw5Ou/9 No1PiyJs/HDlcQryvcQZ9+R2617Htc/fPFN+UwTayeVVJAm6Gc4xhMcXmlMDSraiAj ssep/AY5jMnWprUocsN69LruM8C7dQXpn2SBBao4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731289AbfHFLHs (ORCPT ); Tue, 6 Aug 2019 07:07:48 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:37839 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728845AbfHFLHs (ORCPT ); Tue, 6 Aug 2019 07:07:48 -0400 Received: by mail-pf1-f195.google.com with SMTP id 19so41316496pfa.4; Tue, 06 Aug 2019 04:07:48 -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=tBmS1JSg6R7dIdS7tcKHXNzn/jUBrwmVmbb/LUzYkA4=; b=FKiohG4pWZeA/Wi7DBC/9npqkDrHpyRoEZz0rJr3UUucKs69b2m0OSmC0nKoqoEBW7 5a5fisl81W7ayWltjhWVDhYcauX5oI8qjT4HtPAD8MYvTTn2BUR7Z+/ra9jmsBm5ygxl coLvx5hCepcasDv3Ne7A33Zn9x+18/WPTkwpxyTWKXEQavMv1FfQZWEk9n3vFCWxJKBz 8xgjqJToD3aUbClZjNybApCSYfWR+J9s7Cr5z2gCs2zn7kfaA/XDfENps51XKzcC7h+v MMuNw3N9Qr5VXXVcVPES+JzklSH8uO3a+z/VBP70OotlcR+ykPpu1CCL5PGcPfSbf/4h l5DA== 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=tBmS1JSg6R7dIdS7tcKHXNzn/jUBrwmVmbb/LUzYkA4=; b=n46lLmHUD02u+QOH8gDUai8ueLbAFlpSYO8K/nCKYO3wW/pzFwpn7wHPeE03XzaY1A y3LxlscdgWZeYcl9V1NZa1R+BX33QRHMRdNa/5TasbN3dKiOpeefEjHtsGsHidi/u+sP Q4B64GeQzjdh7+8D4gzCvqk/eGcYKRxQta3U99wbp3pipxF9rQGoqpCYxguqBBvAgLpt 9xBb0/x+mFT2NeR7bLhHpCKdA71crke1AGlY1h0Labj0lJClFn8+H4SkXywmG/YBeIZr Gr+/B1Dac75riAfylY+PdRBOEqycsJDqyJC3IGLSvWM58msxjGTbBTJ+6+DP2LN9Fwim qMwQ== X-Gm-Message-State: APjAAAVehhtL+8+HYdXUWxAQjhF7lJWprQ+P1magMdYfeovNdIttr39w h5ZitJkQK/qwjhRT3Zcwfwo= X-Google-Smtp-Source: APXvYqyN06dee+YCHt2A2RzCyf1hHdHxVyVKw3mol+ZH/H3Wfu7dAX7tuJm7I+hqEodTVg3369khvw== X-Received: by 2002:a62:3895:: with SMTP id f143mr3075201pfa.116.1565089667635; Tue, 06 Aug 2019 04:07:47 -0700 (PDT) Received: from google.com ([2401:fa00:d:0:98f1:8b3d:1f37:3e8]) by smtp.gmail.com with ESMTPSA id h129sm82492287pfb.110.2019.08.06.04.07.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 06 Aug 2019 04:07:46 -0700 (PDT) Date: Tue, 6 Aug 2019 20:07:37 +0900 From: Minchan Kim To: Michal Hocko Cc: Joel Fernandes , 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: <20190806110737.GB32615@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190806104755.GR11812@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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.