Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5858972pxu; Wed, 23 Dec 2020 07:13:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7DKCTHmMHkp/JcBqv/QdYPKPE3gdkl3zSABQ5rou4BgBE4DPqjj5ZoXQCBO3qgtagnAFB X-Received: by 2002:a17:906:b793:: with SMTP id dt19mr24411348ejb.120.1608736425553; Wed, 23 Dec 2020 07:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608736425; cv=none; d=google.com; s=arc-20160816; b=qP+cHkTKFu1XZX6qT5u75CFVb1zQi9C/HMRqal2L0zW3b1CuxrKttwc3mfLb2YR0/a upZa9HBmoYSpX3w9mYUREuF8YDM//Q5IzOfTLkkT3rjWEUvVefmWuPt6VvElTAUTzi1x m4IQ2kYjCZVNjWMwzw6x2RBpaoNeWLsTdGbdj8nK9mlExF6nWQICycz3VprZf8houePL WDQ7U6zv79IsNXoQO7UV9qAX8pSOdU2LCGvYm2IzH0y88g7H0xmNZUu3eVKmLXszUxPb mWqtmIizBKn//bznwl95krgwHP1mvOEMB+Y4w/ziAK0w24WUv4pZOD52auBpX7TW/PHV ILOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=egw/xLacmMD2e5f/vTJE3VtQ/EXWGuBWWN+BXr+Sh0k=; b=MqOt0rP9fdr+T34KcnMdMLsQydI/rkSV+k1A/mu358c6RxQ1lWgRlWSycLEgYHwI3J mt4LJPwKnI4URV7LUou1jeUotn3zjozrbrfu8WIIU+hTyQblgfsyYcrdy8TAii0jAVKz 69j0dcNXIMY11ZsjP2416rIewBrHhSJZ7d2aeSXWRxmbIT35rGjuQfSC1SO9WjOHXlDX 0IZ58E8oB91sUMgW4TW/jFxzyNFp72ebIN3T3xqYxDFamavSpdJ//b7egitnYGosIpmp SpSbqVqwphFYGUSnaGpbeKM1oV0S4OrRMAvmLQYixDfIrOaG1NMT4ERFQgJ7nBeyO8Mw 8Ouw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=N2E8GJRq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si13870211edj.73.2020.12.23.07.13.23; Wed, 23 Dec 2020 07:13:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=N2E8GJRq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727179AbgLWPMO (ORCPT + 99 others); Wed, 23 Dec 2020 10:12:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgLWPMN (ORCPT ); Wed, 23 Dec 2020 10:12:13 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBD29C061794 for ; Wed, 23 Dec 2020 07:11:32 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id o17so40863957lfg.4 for ; Wed, 23 Dec 2020 07:11:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=egw/xLacmMD2e5f/vTJE3VtQ/EXWGuBWWN+BXr+Sh0k=; b=N2E8GJRqhSTPKnuAjN8SBP/d6LsyNb+QVP3ubBEHmLKnHoHszm1ziwTh4FVJ5uGZMH O5QYdARFclQJ5DY9DKbHo8Tt9HhJpnnKWXf6kanYzdeXM1cGf0xKn/5uBnoRqEbpKaz4 h+DkMk/BkuRvrKxYjnukcZVyUqOJgwidlqx+Zwbbvwp0rNFu53YKWdZDbzjcXcUMOPSq WHtL0v2N/FpXSAjCFOr+XpzkKSh3iGGZ/UwSziBM6HZIK1Lozv+JM+msX4SPcwVZIsDz HQp1a3Px81H9Gu72xrHGXj/Ji+TspU3qa/WL3TKbew/TnjEPyFEcK3dbaKdHOOQ0xeLG T4hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=egw/xLacmMD2e5f/vTJE3VtQ/EXWGuBWWN+BXr+Sh0k=; b=VZHHeg0vZ/OgE21r3pR+8aogOeUEbj/IODoTnVgYzdk2wevGb4I09oPCoAfron47C3 HNlzt4D/IpAwC+BeKz9O1Yr2fdVqTl3+s4U96OiUAkJzVM2maGspBdZ1QuAHMU90W2Cn 6hjOwUaQ4M+AaOKJyHlGnPk6uUMOKy+LtrUtVvuwGBee2YOE5U7c1O3Akl4Ux84W6R3W xipPRJu7L2516qkUjJw0cWUPJSFIkQ1WfaBFRVC0b8XqAZlvXtHCZruQ6N8Kk77baLZ1 6pWlNHSHXpXvQtSD0InYxBbFXL3BEOp7zMI7HQiMBdD5w9LX4FSVohC3JrvY6uA39Z3e dnAw== X-Gm-Message-State: AOAM532XCBFrf7qk+2ktah77TYQWz8p0R3+PLg9if7rNjnP18goWOcdJ +9FOU0m2zDOBmxjOIN7nSXvVSY2BhPqbUI+X7Jy5mw== X-Received: by 2002:ac2:46d4:: with SMTP id p20mr10513632lfo.299.1608736291077; Wed, 23 Dec 2020 07:11:31 -0800 (PST) MIME-Version: 1.0 References: <20201215115448.25633-1-sjpark@amazon.com> <20201215115448.25633-5-sjpark@amazon.com> In-Reply-To: <20201215115448.25633-5-sjpark@amazon.com> From: Shakeel Butt Date: Wed, 23 Dec 2020 07:11:19 -0800 Message-ID: Subject: Re: [PATCH v23 04/15] mm/idle_page_tracking: Make PG_idle reusable To: SeongJae Park Cc: Andrew Morton , SeongJae Park , Jonathan.Cameron@huawei.com, Andrea Arcangeli , acme@kernel.org, alexander.shishkin@linux.intel.com, amit@kernel.org, benh@kernel.crashing.org, brendan.d.gregg@gmail.com, Brendan Higgins , Qian Cai , Colin Ian King , Jonathan Corbet , David Hildenbrand , dwmw@amazon.com, Marco Elver , "Du, Fan" , foersleo@amazon.de, Greg Thelen , Ian Rogers , jolsa@redhat.com, "Kirill A. Shutemov" , Mark Rutland , Mel Gorman , Minchan Kim , Ingo Molnar , namhyung@kernel.org, "Peter Zijlstra (Intel)" , Randy Dunlap , Rik van Riel , David Rientjes , Steven Rostedt , Mike Rapoport , sblbir@amazon.com, Shuah Khan , sj38.park@gmail.com, snu@amazon.de, Vlastimil Babka , Vladimir Davydov , Yang Shi , Huang Ying , zgf574564920@gmail.com, linux-damon@amazon.com, Linux MM , linux-doc@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 15, 2020 at 3:57 AM SeongJae Park wrote: > > From: SeongJae Park > > PG_idle and PG_young allow the two PTE Accessed bit users, Idle Page > Tracking and the reclaim logic concurrently work while don't interfere > each other. That is, when they need to clear the Accessed bit, they set > PG_young to represent the previous state of the bit, respectively. And > when they need to read the bit, if the bit is cleared, they further read > the PG_young to know whether the other has cleared the bit meanwhile or > not. > > We could add another page flag and extend the mechanism to use the flag > if we need to add another concurrent PTE Accessed bit user subsystem. > However, the space is limited. Meanwhile, if the new subsystem is > mutually exclusive with IDLE_PAGE_TRACKING or interfering with it is not > a real problem, it would be ok to simply reuse the PG_idle flag. > However, it's impossible because the flags are dependent on > IDLE_PAGE_TRACKING. > > To allow such reuse of the flags, this commit separates the PG_young and > PG_idle flag logic from IDLE_PAGE_TRACKING and introduces new kernel > config, 'PAGE_IDLE_FLAG'. Hence, a new subsystem would be able to reuse > PG_idle without depending on IDLE_PAGE_TRACKING. > > In the next commit, DAMON's reference implementation of the virtual > memory address space monitoring primitives will use it. > > Signed-off-by: SeongJae Park Reviewed-by: Shakeel Butt