Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1147006ybl; Tue, 13 Aug 2019 08:05:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5izBow+RCz2Wtgbv8sIVXJw+gXKimMSzuAONyTmt1Df4uoQ4SUPMwFfStVC5Eq+9c9Njy X-Received: by 2002:a65:62d7:: with SMTP id m23mr34913950pgv.358.1565708759160; Tue, 13 Aug 2019 08:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565708759; cv=none; d=google.com; s=arc-20160816; b=XgaF7BT5Knljv7GUgHnzOuJ84ri8GpsYef+6Q9BHoISXScW1+50iE5pFH/1AD6ZUnH PGpiuZZBOClUWDtyHW3R6R+IBPs/zK2HmaZrP6XOYU9z3GjDS95nlAVhgejU85E1i9Kv kC0Vrx/43NM8jGhyr7fa0XIhIqbIyFRlTPwl4ZuxsOlxK6PvBkLEykAXwTv8YJ9zmty/ P6R36ZxGMpQ2cjXfT/7UD42yN/vSH6ZfMBjC1aUQFjvxColD3ujgLg5fy0wfQkW+cSs5 uzcpwcQld1/IuDUqgVtxaz25OgIfCEVjzMdSyr4iiQ+zDA5qOkFhmXf6GUVisIhHoy0Z Ctsg== 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=6bghUdoagqeWn000vfgWTvaqoNsqbkFwxRBLejGa3j8=; b=W3fQA7TzVlRwkKont0ZTSA9T9md4Xp47co4Kuqd/NJ+Rf5P7UyitkUn7oQOmu7PlKG nb6AgLBB+0XmwQ0vaKWOOVhaeNDWHsxriIdyjf/tW2jMLNip6ikSTPCvOG/SE0N+fkYF FQI2Tote4QaAXTTXehSOw75yVxc6W8w3guf1fOE8JuOcXc8WOlnE6qHOZtaQz4wnP/DL gwcczA01uzhyLLV8VCtv0RXAHn20oPkPX8GjnZXaGtTYrfw86nD4HZmz/GOvIRbKJox8 oRKx6xa7AoRCKnxZy/FtBeZkxYoWLUrb/NmLJD2Z985XXzRX/PS8/O/IAt2sx6YviksI Q6Jg== 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 v3si1123292pjr.26.2019.08.13.08.05.39; Tue, 13 Aug 2019 08:05:59 -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 S1729779AbfHMPEx (ORCPT + 99 others); Tue, 13 Aug 2019 11:04:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:54418 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729474AbfHMPEw (ORCPT ); Tue, 13 Aug 2019 11:04:52 -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 098ECACC1; Tue, 13 Aug 2019 15:04:51 +0000 (UTC) Date: Tue, 13 Aug 2019 17:04:50 +0200 From: Michal Hocko To: "Joel Fernandes (Google)" Cc: linux-kernel@vger.kernel.org, Minchan Kim , Alexey Dobriyan , Andrew Morton , Borislav Petkov , Brendan Gregg , Catalin Marinas , Christian Hansen , dancol@google.com, fmayer@google.com, "H. Peter Anvin" , Ingo Molnar , joelaf@google.com, 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, Robin Murphy , Roman Gushchin , Stephen Rothwell , surenb@google.com, Thomas Gleixner , tkjos@google.com, Vladimir Davydov , Vlastimil Babka , Will Deacon Subject: Re: [PATCH v5 2/6] mm/page_idle: Add support for handling swapped PG_Idle pages Message-ID: <20190813150450.GN17933@dhcp22.suse.cz> References: <20190807171559.182301-1-joel@joelfernandes.org> <20190807171559.182301-2-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190807171559.182301-2-joel@joelfernandes.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 Wed 07-08-19 13:15:55, Joel Fernandes (Google) wrote: > Idle page tracking currently does not work well in the following > scenario: > 1. mark page-A idle which was present at that time. > 2. run workload > 3. page-A is not touched by workload > 4. *sudden* memory pressure happen so finally page A is finally swapped out > 5. now see the page A - it appears as if it was accessed (pte unmapped > so idle bit not set in output) - but it's incorrect. > > To fix this, we store the idle information into a new idle bit of the > swap PTE during swapping of anonymous pages. > > Also in the future, madvise extensions will allow a system process > manager (like Android's ActivityManager) to swap pages out of a process > that it knows will be cold. To an external process like a heap profiler > that is doing idle tracking on another process, this procedure will > interfere with the idle page tracking similar to the above steps. This could be solved by checking the !present/swapped out pages right? Whoever decided to put the page out to the swap just made it idle effectively. So the monitor can make some educated guess for tracking. If that is fundamentally not possible then please describe why. -- Michal Hocko SUSE Labs