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 B0C08C10DC1 for ; Thu, 30 Nov 2023 19:44:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 437A48D0029; Thu, 30 Nov 2023 14:44:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BF2D8D0001; Thu, 30 Nov 2023 14:44:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2604B8D0029; Thu, 30 Nov 2023 14:44:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 13E208D0001 for ; Thu, 30 Nov 2023 14:44:27 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D2E9640300 for ; Thu, 30 Nov 2023 19:44:26 +0000 (UTC) X-FDA: 81515647332.18.961E1C7 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf22.hostedemail.com (Postfix) with ESMTP id 2148AC0016 for ; Thu, 30 Nov 2023 19:44:24 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Vm24Fv+5; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701373465; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=U3RYUX/yot7BEqg2qxiSydsWLzUes1pFOIuMgweBXhI=; b=V+0fe4NrIvRpRjRJVE+L6xp0jwVgWCYpQlkDFuHGnuKFks90et38sIa5HeiM5f64d+WGW8 MLrASIcMnZxg83ekESbgR9UdeTW1i+H7NdBIb5AWxSSXugJj2JP/FlK5JzuRu/ipIGm/Ke G06j4UKEl9nA2Pnv660WzQwsRFIgMzE= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Vm24Fv+5; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701373465; a=rsa-sha256; cv=none; b=IPRmRSbgIMvDP0/UbQ/Da7WjDKBBbLHt8uFIsOuHK1f2a9do6AYpus5pScD/2CaF4hR0H9 bPEeqyUl0j4t0rj/G+RB0g+BWZeWAEf5gIFH2P8+2Kh5XMxlo+d7PX+jvynvr70b2Fr/8h vSlCC6QeurA11PiM+Rk4NHNhcxuflks= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 306EFB845C0; Thu, 30 Nov 2023 19:44:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01342C433C8; Thu, 30 Nov 2023 19:44:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701373462; bh=lVSnuH+tJnwYCxo7/cDHBwyalQ3cnS+JX2dNI0Wt3fU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vm24Fv+5VtVQZ+asYdfwlm8/G5iS7aYut/0Ux8Yn9Y31WRBaIRPvFy+UdGBsuAf8z ZQOvQEKERgjTFSYUf/bV9Tba2TgcUB5jEO5HsDLT/uWw3ga5vXmAuRWpjH1kjO2vVD +n+UF4D52Ypo62Cks9iGFeeJNOA2M4iIvsqYcG6bJ9rMM40U2lNTI2qrWe1ZDDCnw9 ph/C8GFl7oXO37ivvdgR/fog4e8PrKf+r80OsDPqTervKsj2HKoUBH2upOmNadTl3C kFmX0UVrbnw8hcz1e8pF2zbWnFm8mY8DOcsSXHGw5OkEU2iDxX5I3VFS3ZNeiKNHX6 5W/2ump3Xrbjg== From: SeongJae Park To: cuiyangpei Cc: SeongJae Park , akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, xiongping1@xiaomi.com Subject: Re: [PATCH 1/2] mm/damon/sysfs: Implement recording feature Date: Thu, 30 Nov 2023 19:44:20 +0000 Message-Id: <20231130194420.51355-1-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231130091426.GA13946@cuiyangpei> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2148AC0016 X-Stat-Signature: 71kwmam3p7fof1pdfubobdgmtwm51cq4 X-HE-Tag: 1701373464-649336 X-HE-Meta: U2FsdGVkX1/FqTkpPnIcZ2eGx2vEJ7wfw8lUUA7VG9OGmjjKLegrxf54JgpLbrP5BmmQGjsTSuzwpvbwvxOSaM3omGhfWd5pSa54wU0QlztQSHbHJg1nJzbgxcul65mkCV8wtvBvE2JTkT4RMv3mRcw1x3w8qA/UhPBjL1PjPgLoRqqTI2JO1ys8FdzsHgWbJ6pZ8brBQmK3pxbFttwRi1eA1i451EOS5yZKqkYYemiEcfZN54sUy2HiBa58CCARsgE79M5qaWpENxMWgsGhcJ0zdm/NhCvMGl6Gpb486zNcG7wRQDpGHH8dDe/L/pD37iDKBcW7MoDofos0iXDtPd9jqGe9WOZOCey/u/DCxguXNcim42IhQ3Er+uJQtzRGDOWd59JnypzLX5NUsoec/ea21LyHLVobaTyLoBHrSLNTGzhxo4V0QtkpDMlHyy9776ROcizdUa86VQqTQCKe3caq51ftq/9uI7QXEXTGC7uOtUp2aa4NSDDhzS9YTedmCrjbcERjeyotO6Fz8UOzq4FjRJXAE5UTzVK1ocKOrI+mFWFtC1dvyxFPB7q2DIrwFBJ4c1wcFQczgrUs+2lsf+MlsQ/+q/HntxUmnpjycoiRtSC8bw1YkxinR4A5fLsoeiJq5Z2cXhb8U7m8chWGSE+niOvBdp6CeiqDyulygE4BADfKgj4FZzTaMdkDKyZ/HjAh75w5NTukDnR4RE1RyUUnSF0B0ratgS8Jup0RCYLWWfvj9NlfCMpWa7Gg0P4BnpA9TdS3sj/Yx8FL6IRuG9eFf3jkS77wuTZXNhPboGMco4iKOe0gW88y1Orpmjr8d4BkwgoBejiWoQaRMxAXcH5I6yvflYiyk7pEi89Pk1cG6SpbA6pV6oQgH7Y4dePB1nxnnAHk1wnf5iKE/ajNkEeLH81pmXaiBQw5m8bQE/0ycVPt06OGVq6HtAHXcGAuulB2FI9tJ/eXQUtZXwZ 6AVfEd/C VhM0YlYAzK79mINlNl4S1jO/K90BpGz9DdY0bFwWUR9pNSmILRNRKeud7tKcjPEahcfX4/HvWD62m3JtiX31rDdUG18m4jcghHrqwtklAY/8rYYpNRD2qAi8zmMqCE/5VrFB04j1PMcBQ4mh2efhEXb2B5+ETH5F++C8ypMjREkRb+fthbBKHFo/1UUG7IG6+JpUSmqpv2q+x5YHvFO+NevtdNVQlCsat9769bRNHyIb+8Zu4x/CTnZbbi3zteLswzkivU3NA0C3Kf/z19Q4Ic4Inv+BsJ+mpnIGW X-Bogosity: Ham, tests=bogofilter, spamicity=0.001357, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Cuiyangpei, On Thu, 30 Nov 2023 17:14:26 +0800 cuiyangpei wrote: > Hi SeongJae, > > We also investigated the operation schemes you mentioned, but we don't > think it can fit our needs. > > On android, user will open many apps and switch between these apps as > needs. We hope to monitor apps' memory access only when they are on > foreground and record the memory access pattern when they are switched > to the background. > > When avaliable memory reaches a threshold, we will use these access > patterns with some strategies to recognize those memory that will have > little impact on user experience and to reclaim them proactively. > > I'm not sure I have clarified it clearly, if you still have questions > on this, please let us know. So, to my understanding, you expect applications may keep similar access pattern when they are in foreground, but have a different, less aggressive access pattern in background, and therefore reclaim memory based on the foreground-access pattern, right? Very interesting idea, thank you for sharing! Then, yes, I agree current DAMOS might not that helpful for the situation, and this record feature could be useful for your case. That said, do you really need full recording of the monitoring results? If not, DAMOS provides DAMOS tried regions feature[1], which allows users get the monitoring results snapshot that include both frequency and recency of all regions in an efficient way. If single snapshot is not having enough information for you, you could collect multiple snapshots. You mentioned absence of Python on Android as a blocker of DAMOS use on the previous reply[2], but DAMOS tried regions feature is not depend on tracepoints or Python. Of course, I think you might already surveyed it but found some problems. Could you please share that in detail if so? [1] https://docs.kernel.org/admin-guide/mm/damon/usage.html#schemes-n-tried-regions [2] https://lore.kernel.org/damon/20231129131315.GB12957@cuiyangpei/ Thanks, SJ > > Thanks.