Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp304568lqi; Wed, 6 Mar 2024 19:00:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVK5x+CcRhWo5BLnnm6ZRVqGz6BbJrZIOFfJFl+ERYKviH6ibbOuN/Bk0nxcJAvqDY2GB0ivkw7wiSvu5ElJ9rUjNsGfDfnyNhQWwU13A== X-Google-Smtp-Source: AGHT+IGu/FWSYZNwhBYGl0UHlRgj4e/8WY5ReiMcoiY7lbm/ekVvGpgVM5uScp39vuZJ++YMB0dY X-Received: by 2002:a17:906:ca5a:b0:a45:ac0f:38d8 with SMTP id jx26-20020a170906ca5a00b00a45ac0f38d8mr4139890ejb.15.1709780434119; Wed, 06 Mar 2024 19:00:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709780434; cv=pass; d=google.com; s=arc-20160816; b=LURxuMBJ32iappnIOPUJBEMFTstH9ON8e/zxG6jdBaP6QyPrLQxGNM2k1Q6O1a97wI Y6BtsBZb86dac0T/cKtETClLOmu7vZApaY5UQy2zdrVEJLp/7wzduhqFQxH+Ea9qYABh 8Q4kfoLF7YDZ7GAP6Os8CziYNJZDue24zcMmEcxb6GC1BtaL6+U40rDdvN7v+vqkkcmk 9IEOFrPWVm4n6Ak7SfQNq+zzitbyxYTm72tn6STF3su7r+/xy8tIZ+6SlU61LKlD5po7 Y6v885SnaYAauBxf9Lzg9LHLRed0M3NiJe6tMB2MJZpsDsGbKDDnUjRmhYm3aP1Gxu9q 2Z1w== 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=eqAIFcD1itZH8YCcDK2SRUkGgYN7x3jlMaujj1UkxWs=; b=wzz43GCh97bSRMW/tLLFgQ4UkAV9IS2rAEBvW/okYrKc3XnfGa9j1IuJHWo1n3JMKt OCEJUa3D0KLrrHHdc1RxwEAdJ8wyVhoVrwIme93WS6oJCUOb2w93Dhu5tmGfreJMLba8 Eli6344bNPiPqQ6HYqCX/CWgY7J7B0fhORlI49YGcJc7a4XKdZsd7MpkP7Ge/YnAR6hh 0nZ0qGouUWxXlsuo5pabKY3pCHQuAZ3lIcXsO0ZiubCUznZai0faEC/tM343nUTMmgmk vI29wvST2omZ94lNU3GrbVQerbzkRun82eN/PyIFM+zi62nSooNjO9KlyV4TrxzwdoUk SJGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xfvl0OYl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-94896-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94896-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id sh30-20020a1709076e9e00b00a45c683899asi565739ejc.825.2024.03.06.19.00.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:00:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94896-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xfvl0OYl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-94896-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94896-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AE0B41F241A9 for ; Thu, 7 Mar 2024 03:00:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63F2ADDD3; Thu, 7 Mar 2024 03:00:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xfvl0OYl" 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 8F4EB5C82; Thu, 7 Mar 2024 03:00:19 +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=1709780419; cv=none; b=OIHB7HQdWlmUn9HyGeEWaWoEG03ByJWmkU7iRY2ZGP5XQpT4jx0CXf0ee7N1x/xGodxSwKdS23oORrGoWW0tvMmoAYxFYJee31aNCjznVOTNxT2GI8nb3ciF6J+UlYl+s/0cgNAx5ggNTOd/maagGCZ0O0BiVZkogTZhjA+JV9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709780419; c=relaxed/simple; bh=LO88k+dd/BebwXvUzvdC1iypWVc1Mb6U9juVYlKD5Nk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r4lnhhcKpsfvQbPy3pMx09kcZIRTbuLqMla5/mjjY/fdTEow8WM4tdjn5jnqT4H2Sg0gsqBOQlXxuLyHiNqlF+KuMFTToZfdLSIKkUuBNiTIdY8HUURKpm6JCXzIt+cmQJxY9L81WXmf0Ddgx1wsB/Kk4o1u5Zd55lcBJo4LC08= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Xfvl0OYl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C52C9C433F1; Thu, 7 Mar 2024 03:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709780419; bh=LO88k+dd/BebwXvUzvdC1iypWVc1Mb6U9juVYlKD5Nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xfvl0OYlXalMPZ5OQy3u2by1UcGM63J6lYhw6OnPh5BnjI7XbNx9yehBIe98iibpT mVEKZQGkrZK0nQgcWw/M7VsDKZGgiUz/6W5vvgcZScmUgyu7T75nOC9STn59mm8Bte mJfbJOPDheRHml1ByYZpQbHQdeRj120Sjddcr/1nHUd70BI54sCBVgXEXYJketb0Jt z9IUEX3UDo9GyhOR8XDgyW5k+0gxOUQs29Ld4RSIAngv7MO0XbF7f8apdD49lPDFvA NZyTKlEO/ta8kLgllFMMiE92wUPs0XsSDFR+vGs9TLrlKLcicF3HkPvRcWv7Ffq43e QpdZFfAX9k+5Q== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , honggyu.kim@sk.com, hyeongtak.ji@sk.com, kernel_team@skhynix.com, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/3] mm/damon: add DAMOS filter type YOUNG Date: Wed, 6 Mar 2024 19:00:11 -0800 Message-Id: <20240307030013.47041-2-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307030013.47041-1-sj@kernel.org> References: <20240307030013.47041-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