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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham 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 86BB6C433E0 for ; Wed, 23 Dec 2020 15:11:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2F9C32332A for ; Wed, 23 Dec 2020 15:11:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F9C32332A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AA8538D002D; Wed, 23 Dec 2020 10:11:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A31CD8D0026; Wed, 23 Dec 2020 10:11:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8ABBD8D002D; Wed, 23 Dec 2020 10:11:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id 6E81A8D0026 for ; Wed, 23 Dec 2020 10:11:33 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 39F9B2478 for ; Wed, 23 Dec 2020 15:11:33 +0000 (UTC) X-FDA: 77624886066.22.horn19_260a93427469 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 1C6B418038E60 for ; Wed, 23 Dec 2020 15:11:33 +0000 (UTC) X-HE-Tag: horn19_260a93427469 X-Filterd-Recvd-Size: 5582 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Dec 2020 15:11:32 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id m25so40729643lfc.11 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=jgCo1HmRSLIAvYe2IQfMzpf8BnBbwl8WJg5z4ls3UsRl7zck1nsFL24xUhpAw6ZEhX FgvjqG5MWucOsxN9T/J5Q5zGaqKiUDnHovRncC7V030iVACnI627YfzhjYDSFLA77J1Q 767SvaZ/PJq66a8/rX1PvmHneiJK3poc1rDpwSRNgugEthdMOsacR/ApPE70haFGOIvz r7cCiLw8MsNQmS06UqDW6nSRQEsmYkeLHfMnzt7rtXZv/Dk4ZBQndVshlGxwSEjsEhkh rOWEIKKbm2HmoX++8MW1HJB99Pkl/PYpSS/WyUnrRwsegSStkimXwhuiqiPmOzfmECD4 r0sQ== X-Gm-Message-State: AOAM531fJjFUrM6mJAtjf33vXyhMnkFeLffVrFHYJoDM1AhgA0TVgC1f tnlvDK8stb/nn8upzEWloA3fyXFC3BNTDVNNnJkSvg== X-Google-Smtp-Source: ABdhPJwR5CYgLfIjGQWp8Hkg+C6401rdK+2U3UYtjausgns/0Q+26AokHwtlZUkC/U4DcAuM9/TLGSFpYc+lVAeKgHg= 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" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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