Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp668520lql; Mon, 11 Mar 2024 13:46:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDJ+DWxf58jtu6f6s2mYKSeNjvv5F/ZWi6in5Fzi8dxq6mIWaAaZFeTS8zpqRildR9OBvDNcc3I+mw8YoNBcKf2zB/10P/NuS4tRgunA== X-Google-Smtp-Source: AGHT+IFYgJT3XQ6KKUUKiatWL7oXg/1gfLqfUFGmFVwHNr5dK578EhkOW1H1eEYIxV65xj12c1sv X-Received: by 2002:a05:6808:3d0:b0:3c2:51f0:5f7d with SMTP id o16-20020a05680803d000b003c251f05f7dmr1957833oie.15.1710189997441; Mon, 11 Mar 2024 13:46:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710189997; cv=pass; d=google.com; s=arc-20160816; b=dq9N3UXbyVSqTTj47DMOHWxVd6+qTjwsTxNQBtTEyN7j0BatqJU5aIUK4gZDH8I3rI A9U2RA2v7UdJIvQajAmj+2yTTNItBuF0MQ1/1ocOsZJ6GKJvH8aNYnH/31UhZ4Ng8A1l zDYnAfB7DqsouuA5HBs+CBMfevK2v2ps4NrmOia3JkD/SV9Pmza1bbIxfPrFpd16cNC6 z3H4s8EQPQqvz7WVNm2FZH5SMnsgb01mPYeEzeSH76lilzF1hhR0MQp4p1yMe1E9pqBH CvVSFhtcz5KpGwhWG9yX0ixrtQYLJ3JxqIX9aQhVngv13Ze/441pgUkmPeERI8aCsrvC PZMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KW7k2yEs1IhNFivzAY8dNuVjq4m3njEs7sEi/VP7zyk=; fh=E/hPYPMZffwpMkqvbMzuoLlOj7U1fatLsderTFwZRHw=; b=sVypcjXKGcQO0niOeWk7/sZK+iVeinQiQRe5vugXc7CWxS9eKS6q3EezYu8zHJUD+x 5dUKc1an2vh6Cc6699KzK/+ykyzR9JyUEi3rxFKaJ2e5UKE2HDpeLX3SzRrptuX7ijNH tM9gQuNo84sFXMJySaB+8ATpPWaZt7WHFBlz6j52MZRvwcChY0Ff0AP8Ws2/2if6DJmA yN4Y3GA6nrMwxdiZS5yyBV+/eU2ZGy5UC7upvbaARMVTzE0BAjZ22SBF/2m8MVKrvQ0r dPQN9JMgZn7CNeTsCeF/awMFSZLpsLuMLNChnvowWz85Qgm8i8U7cQVu4Q1aZZkAfirh jDhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uQNI7zWP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-99533-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99533-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id f5-20020a63dc45000000b005e2b17cb799si5512119pgj.267.2024.03.11.13.46.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 13:46:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99533-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uQNI7zWP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-99533-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99533-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EA1FDB21196 for ; Mon, 11 Mar 2024 20:46:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B316757318; Mon, 11 Mar 2024 20:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uQNI7zWP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3DB056B7E; Mon, 11 Mar 2024 20:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710189959; cv=none; b=IZxWL5Uqc5dWsjt2u8dGCeZ9JIdsjp9oeoYNQNhJlKukXc4Qz15YJurfg97PZQP2TYVdl/aaV7Jfl4zX3Px3FRAEvbNLEZ0++7cojkm7KvYRpauhEWsu2ueYzLMts7BZ9vk3kx4761Rplu6zRaBY09BJY4ZrqICxlWg34M6KhFo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710189959; c=relaxed/simple; bh=LO88k+dd/BebwXvUzvdC1iypWVc1Mb6U9juVYlKD5Nk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KTYBoIdyiEsq+fHvBrIgXAG8aWxN9TOzRFvP3XO2ZEIEv/jNhzGGsVlC0I/brVhxZ/aJMjADYbPUlFIETsQZOSfITiK5QQFHQkVMEkldmd++rFecR8rIYejFS1R7v6EvlVO/tEevSL2I1R3QF/Q1XgxHip5z0XYKr3lPDdU0eSI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uQNI7zWP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E78B2C43609; Mon, 11 Mar 2024 20:45:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710189959; bh=LO88k+dd/BebwXvUzvdC1iypWVc1Mb6U9juVYlKD5Nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uQNI7zWPftUXcAfchepbgu8pxGBdbSEAdCcgL0ZjBDDyDymzJz0oEGIjl1OL+4pOt vUUdgM/UGEUp+bWCp1PrYYONwHar+psVszUNLtPUFGicKlMIC14alMAomTeoLBXq4d XRX42K0XQUw+pfrz7kvEdLVuEeV3Ro1H5LszW9h9yE52XzWosaYdLX41fQc16Rm/7U 9vWI5p8uNYo+yyJbbQn9XLalmRiILMwr+Y+u9ct79phKv9T9KKMbBHoMZLtdJsYsdX Nm02cMdyHt7eixGAwW9mDAePdrQmDJY0NEfiaDstr/nBbSy7p+j7D6ofARR9C4OLZ9 wEqqUEnKRvp4A== From: SeongJae Park To: Cc: honggyu.kim@sk.com, hyeongtak.ji@sk.com, kernel_team@skhynix.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v2 3/4] mm/damon: add DAMOS filter type YOUNG Date: Mon, 11 Mar 2024 13:45:44 -0700 Message-Id: <20240311204545.47097-4-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240311204545.47097-1-sj@kernel.org> References: <20240311204545.47097-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Define yet another DAMOS filter type, YOUNG. Like anon and memcg, the type of filter will be applied to each page in the memory region, and check if the page is accessed since the last check. Note that this commit is only defining the type. Implementation of it should be made on DAMON operations sets. A couple of commits for the implementation on 'paddr' DAMON operations set will follow. Signed-off-by: SeongJae Park --- include/linux/damon.h | 2 ++ mm/damon/sysfs-schemes.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/linux/damon.h b/include/linux/damon.h index 886d07294f4e..f7da65e1ac04 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -297,6 +297,7 @@ struct damos_stat { * enum damos_filter_type - Type of memory for &struct damos_filter * @DAMOS_FILTER_TYPE_ANON: Anonymous pages. * @DAMOS_FILTER_TYPE_MEMCG: Specific memcg's pages. + * @DAMOS_FILTER_TYPE_YOUNG: Recently accessed pages. * @DAMOS_FILTER_TYPE_ADDR: Address range. * @DAMOS_FILTER_TYPE_TARGET: Data Access Monitoring target. * @NR_DAMOS_FILTER_TYPES: Number of filter types. @@ -315,6 +316,7 @@ struct damos_stat { enum damos_filter_type { DAMOS_FILTER_TYPE_ANON, DAMOS_FILTER_TYPE_MEMCG, + DAMOS_FILTER_TYPE_YOUNG, DAMOS_FILTER_TYPE_ADDR, DAMOS_FILTER_TYPE_TARGET, NR_DAMOS_FILTER_TYPES, diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 53a90ac678fb..bea5bc52846a 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -343,6 +343,7 @@ static struct damon_sysfs_scheme_filter *damon_sysfs_scheme_filter_alloc(void) static const char * const damon_sysfs_scheme_filter_type_strs[] = { "anon", "memcg", + "young", "addr", "target", }; -- 2.39.2