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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2E2EC54E58 for ; Tue, 19 Mar 2024 00:51:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 389C16B0087; Mon, 18 Mar 2024 20:51:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 339A76B0088; Mon, 18 Mar 2024 20:51:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2285C8D0002; Mon, 18 Mar 2024 20:51:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 134126B0087 for ; Mon, 18 Mar 2024 20:51:43 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D16B2140C32 for ; Tue, 19 Mar 2024 00:51:42 +0000 (UTC) X-FDA: 81911960844.26.25FADC5 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by imf30.hostedemail.com (Postfix) with ESMTP id EF54280002 for ; Tue, 19 Mar 2024 00:51:40 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=QE4Od87E; spf=pass (imf30.hostedemail.com: domain of yuzhao@google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710809501; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ubavkzthuO7FFM43XgPG5WP9PAb9aevt0/P5aVLiPkg=; b=HMM7j1+EwO6Hq2X7TwyAIRnj+/sk5UQ3bIpLfjP/79fbjeakAis1u1IFHMmip8is+PXCfE Pm4GMrcnOcr0A8pHFa67KyR1tC3D8uxJGGYnuufeOHkClK89CBzEF+JV3khhCnflp2np7q n0iiOJ/gTE4A7qdZsXA+1B6yH8QQ2kY= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=QE4Od87E; spf=pass (imf30.hostedemail.com: domain of yuzhao@google.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710809501; a=rsa-sha256; cv=none; b=rQf25lbSZM80e1FrOMpAjs06MYCABC0bGEVtf2Jaqno0mpgMH4nNKQfPP8EUNlm9kukyRP MNQgwcB65PPu3e7TS0NqPuopyno5uOJg4WuimDhQucJGiajApau8SsA3YMMYuyyyLxztb6 IqbALEiNAZiksebI4QB2TEao8WrR8aA= Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-41428b378b9so16345e9.1 for ; Mon, 18 Mar 2024 17:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710809499; x=1711414299; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ubavkzthuO7FFM43XgPG5WP9PAb9aevt0/P5aVLiPkg=; b=QE4Od87Ee7x0+cyx5xsuO8ocS1lL52/qj71AIep9XIx5qvxFTTbdMMiI1zxciwiFJL advSuV8i4hGdKotqSL9RprXriQ0vVDdTNNWlvTOfgsQwkI820FXPJa7MPAzW3cTqrrTS f/wccSSe7r1R+za7H1Em9ctmIS5bYV8PhGFwGD61y47KJZgjh2EWINgODGnqTuuna7w9 k9VDXxoh9d122CNidz6DJzSXV7889nuL447GLJWMOGgJsEagLvj1rkfdhLGfKH6c8H8e QqMvk8cGdHihXt6ETksvIaVblaMDNyYxuZlmSLdbK2cULdGck6qyS/rZ1wmwD1aobO3z 2n+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710809499; x=1711414299; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ubavkzthuO7FFM43XgPG5WP9PAb9aevt0/P5aVLiPkg=; b=Hld1Zol83Am3xBkw23woiC/J5uucIF1US8lznOLxk1HotuF/u/ocAtcOfvtRX3Ibv8 BFfe1GNryU9jaKDA+maCDzcocYhV7LFOYpmCSuR3dPzCr0wyDQ5ehNhzBHQmEepMIGHF cVelo/QS7M/yPutu/8ctpmSnZBGG5tt45+TIUJNSqfKqPmpT+N2E+iGG5QfEZstSFowo KoMoJB6kTi11AqhvXVgChJQVHzVRMIbRrGGvz/iKLmbOISNeSxXnxOT4XSyZFjhRMoux nZVcACYzuWiyQXoJ5ao4mCNz6xgYWULcdms6C801hnUNOMsxhU++kb7UZhZ12rA9Rh6n 5Low== X-Forwarded-Encrypted: i=1; AJvYcCUdMYPILmtkJrqkhP1p58+c4yvtqxgwvruRAOiSn2M5xd6eQ3Zq5WkT/kROvb94XrtgUMsAhzyf9V1Er/igmdVm/Fo= X-Gm-Message-State: AOJu0YxFIpuLiBWmanQeQ7/gZt0tOLyeXRnoYO95Txjrc/Fh943hMLnG KAezH8LD75YHgWfG8UVpRsTPTFpevWltBobqm9G/LOVN/s0WwcwzXolMfUrHEOvsmcKOs2svy7Y fXqMLXtDPTvHty01lTANdTd/Iuoa2gbukFl39 X-Google-Smtp-Source: AGHT+IHfRln6v044hZGAlSuMPi3J0FOHg5vrtS307mpMoHwBCb0TtGiONlvOul2Ord2/xXZWPGRPnOrWFfjX4JJ6H5s= X-Received: by 2002:a05:600c:1da0:b0:414:8b7:638 with SMTP id p32-20020a05600c1da000b0041408b70638mr97055wms.4.1710809499211; Mon, 18 Mar 2024 17:51:39 -0700 (PDT) MIME-Version: 1.0 References: <20240318132848.82686-1-aravinda.prasad@intel.com> In-Reply-To: <20240318132848.82686-1-aravinda.prasad@intel.com> From: Yu Zhao Date: Mon, 18 Mar 2024 20:51:01 -0400 Message-ID: Subject: Re: [PATCH v2 0/3] mm/damon: Profiling enhancements for DAMON To: Aravinda Prasad Cc: damon@lists.linux.dev, linux-mm@kvack.org, sj@kernel.org, linux-kernel@vger.kernel.org, s2322819@ed.ac.uk, sandeep4.kumar@intel.com, ying.huang@intel.com, dave.hansen@intel.com, dan.j.williams@intel.com, sreenivas.subramoney@intel.com, antti.kervinen@intel.com, alexander.kanevskiy@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: EF54280002 X-Rspam-User: X-Stat-Signature: u9hn7rw5jefr8stou685d1o98x5s467i X-Rspamd-Server: rspam01 X-HE-Tag: 1710809500-305989 X-HE-Meta: U2FsdGVkX1/7PsaNcHFZukptD0O5L6Utu5DwT8WJeGIGp9g0nT1jY7P7NoYHfWsSWwkULV2em+I908R3pS2DZdH/x1oPeGLRyk+HQFQTDdv/+AVziNhz6Qicd9UXB8t4lMCy4ztrnMikoIBUGlVsHgSFEa6XzwAErYej3yu/JAWHcDT1bw4htHaWaJVU7+8Pw1j5gzutr0CUfgAoPgLRmpKZEeBR99gHMJ5qT6uxekJjn696XlB/9Cnc1E/aSaDNqnBjgEFH29lx7jm+/wClbySgCwPe+eFpphKJK7HIy8x5XEdHyRO+TfGFlPZhMQ7hc3FBo5VLUkyEL5vyjEmbr78/5O3SQIDM+iXDBYONdfAxVD3HNQUUkTNI4zsrudNOVi2MMTb9JXA5G8ekrOISKX1I9hYSMBE4T9B2JpKpFs598qo+jL4ZmyUtE53Y8CiA0yMG/hE7fBQIq9DHnAUBqthRyY/wUws7VCNCHtM1RiaPOR/0sNHhNGVVzW6p5jT5Y/aCXRud1M6gIJ63EH5yW5aCL8XcjacAIgJQCcUXRBlj3zmysA8CtlvVAeKMifPbwosCN2i+D605y4DteXM4P+EBndXpvKpb1difpOgxFWq7Xs1iXwdAwvPJyya+lvcIthzPkOtR5aN1tgezrtct39yHg8dbbI/GiKmQeog0g57GEjjpeL6OeK3coA8e+8uAcu2sYe8dUYSGaYYJ67PGRgR1FtojpiGPsv6m85DiBrAD1E/MBZCgJkA5mV3P9LZPFVmTRZ6kbVcQfH8/oqtwiwrSIugVWs3HChRLVDuRDwlTY5xtQq3K4u+rnAeUsY4zyfbqCHw9Q6Mt7asZ4Akdg1LysccDoDArlUtDhXnqPcbFLtxHq+1HOegxVtlq1Pnwu+iIM8Rw+MRvQT+O3G39Bt801xMDOawO0RAW0BKhBtdO0j9dkvnpQ1ugVXipe5aQ/OiQ5EdRm/mkKigxhx7 veQRB2TK YYFESi667euaebznAARGqGdcKbZR7/jAhlixASE2TqRDdo/xXv9IAMFaYJpVUV6q958WZIroVg3JwOsusXvlqSUkAL3itt1q7jWYP4jRDy/9gLn1o+5ag/TdyZJylNiO+lTWGfDgHjlTHnjFjwVU0MtbFUvXIiw+luCgB1LSyrDvXhEXnP+t0FrMYN4P2kN2BBBbhCsUdyAjzcamoCNXy3MHvDL411yIiUXkgh9S9YIrVXWBLONT+U0t+o8oAtQasTucjfqFppL3vjGa3/hyteG1favtNUc2pa8OQLHvfDEWIR0GFaAXCcqXCC+fOPt7qh0sm+VkmEYVnIY0eo2utjMf8p02ATlbQHdViRagDF1+TmGrLMcrb1muEXk2+pz5ePLNQ65E/cxVOGwRqtkkyOrM38jD+813CD3vuw7YtFMQji89+Ef8jeGKjWQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000040, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, Mar 18, 2024 at 9:24=E2=80=AFAM Aravinda Prasad wrote: > > DAMON randomly samples one or more pages in every region and tracks > accesses to them using the ACCESSED bit in PTE (or PMD for 2MB pages). > When the region size is large (e.g., several GBs), which is common > for large footprint applications, detecting whether the region is > accessed or not completely depends on whether the pages that are > actively accessed in the region are picked during random sampling. > If such pages are not picked for sampling, DAMON fails to identify > the region as accessed. However, increasing the sampling rate or > increasing the number of regions increases CPU overheads of kdamond. > > This patch proposes profiling different levels of the application=E2=80= =99s > page table tree to detect whether a region is accessed or not. This > patch set is based on the observation that, when the accessed bit for a > page is set, the accessed bits at the higher levels of the page table > tree (PMD/PUD/PGD) corresponding to the path of the page table walk > are also set. Hence, it is efficient to check the accessed bits at > the higher levels of the page table tree to detect whether a region > is accessed or not. For example, if the access bit for a PUD entry > is set, then one or more pages in the 1GB PUD subtree is accessed as > each PUD entry covers 1GB mapping. Hence, instead of sampling > thousands of 4K/2M pages to detect accesses in a large region, > sampling at the higher level of page table tree is faster and efficient. > > This patch set is based on 6.8-rc5 kernel (commit: f48159f8, mm-unstable > tree) > > Changes since v1 [1] > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > - Added support for 5-level page table tree > - Split the patch to mm infrastructure changes and DAMON enhancements > - Code changes as per comments on v1 > - Added kerneldoc comments > > [1] https://lkml.org/lkml/2023/12/15/272 > > Evaluation: > > - MASIM benchmark with 1GB, 10GB, 100GB footprint with 10% hot data > and 5TB with 10GB hot data. > - DAMON: 5ms sampling, 200ms aggregation interval. Rest all > parameters set to default value. > - DAMON+PTP: Page table profiling applied to DAMON with the above > parameters. > > Profiling efficiency in detecting hot data: > > Footprint 1GB 10GB 100GB 5TB > --------------------------------------------- > DAMON >90% <50% ~0% 0% > DAMON+PTP >90% >90% >90% >90% > > CPU overheads (in billion cycles) for kdamond: > > Footprint 1GB 10GB 100GB 5TB > --------------------------------------------- > DAMON 1.15 19.53 3.52 9.55 > DAMON+PTP 0.83 3.20 1.27 2.55 > > A detailed explanation and evaluation can be found in the arXiv paper: > https://arxiv.org/pdf/2311.10275.pdf NAK, on the ground of citing the nonfactual source above and misrespenting the existing idea as your own invention [1]. The existing idea was purposely not patented so that all CPU vendors are free to use it. Not sure what kind of peer review that source had, but it's not getting around the reviewers here easily. Please do feel free to ask any 3rd party that has no conflict of interest to override my NAK though. [1] https://lore.kernel.org/CAOUHufbDzy5dMcLR9ex25VdB_QBmSrW_We-2+KftZVYKNn= 4s9g@mail.gmail.com/ [2] https://lore.kernel.org/YE6yrQC1Ps195wPw@google.com/