Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3963497ybh; Tue, 6 Aug 2019 04:15:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVnHm9Diy9DzTt+KV5rxaTTW3+1joD6WCFwcUs3CkiiycaiOH7CltA9itm17sM1shPiDE9 X-Received: by 2002:aa7:9dc7:: with SMTP id g7mr3012083pfq.170.1565090156467; Tue, 06 Aug 2019 04:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565090156; cv=none; d=google.com; s=arc-20160816; b=KhiKM5Gbv05Ut5yGWLgxA6m5igIu47JJJQ4qnkVaDW1a7FpjEkaql7Dc+oj7eJ1ITH YwsC6Vru5JUhAEKa4Q/HPqSmQ66fqsDG5iwcIZzZW04oVXwtYwhAXb6s5XozuhCWUuyC SjIz4wTtMx2q7cJf+4+4psnzQtY9uex7vmRB4Nb7c9vdJkSqZzsoYdjD6O4EpN1Jgysg MPT2TNCu9509Ua82P+/gm4MUIXwn+P+bH1BX9J7Ns3BdrJ1oQm3OxpidRZRjDSCcuZIV a81/Q9NF2AdF0Q4dELKta6BFUBj9u8m7ABYKIysKm+YBdY8kZkJPbB9VO4DD49nulb4d pCnA== 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; bh=fF6B+fYbNKgMWIBPlhl7Rzen/V/44uBW9q6jS5dRh60=; b=dFw2D7H4JH64MMQN+8P1IN2r8Cn4JmsjdoKYJzR4Q9KBMIX2x9nLPNUuDK8rSKnvDG 5aIQvWWekI41RL2A5c6sUcwTEM8XxdiVt1F0ofuAVlR6KEBikkc8gn+rGEpwd1pa1nkS pA4OBLdaS1tZJhXWgp58yK0C09Urf7SiwXK2fd+1M1BalZJ4EsINDnEFcco5VKghY0NF AoLRV7fNzC1NNGSYU//5S7iI0xECW6XIx2U/qfBNQz0oR5IkBzpP3Z5G0e6XytSqNmJ1 lnT4+H+y1OqpF5b4qOgQOiRLrdD/gEgyBear0NN+e/1VMp6dWldvf0nl8ZBzg8/+iBeN Xk/g== ARC-Authentication-Results: i=1; mx.google.com; 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 p19si13245107pgm.485.2019.08.06.04.15.40; Tue, 06 Aug 2019 04:15:56 -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; 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 S1732697AbfHFLO4 (ORCPT + 99 others); Tue, 6 Aug 2019 07:14:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:49424 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730071AbfHFLO4 (ORCPT ); Tue, 6 Aug 2019 07:14:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 41BA7ABE3; Tue, 6 Aug 2019 11:14:54 +0000 (UTC) Date: Tue, 6 Aug 2019 13:14:52 +0200 From: Michal Hocko To: Minchan Kim 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: <20190806111452.GW11812@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190806110737.GB32615@google.com> 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 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 Hocko SUSE Labs