Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp947792lqc; Fri, 8 Mar 2024 17:53:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUt9ofWaaKMz60dvMwWS7QK0SXNNvJZDX94Ib8kk4lSmqlEnBYBXO9wBtheYboRqD6Wi/UUJKGV9hMZjrKS2adqwlkH3dNqJyNs5NCa+A== X-Google-Smtp-Source: AGHT+IESjxAUPHUoIcMwoa6MT/w9cG3y/+NR9z4sdCUlN/Hmo5DqOgIbyW29Xn2ss/oT7AH4+fdt X-Received: by 2002:a05:6871:29c:b0:221:416:1df9 with SMTP id i28-20020a056871029c00b0022104161df9mr909823oae.23.1709949200499; Fri, 08 Mar 2024 17:53:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709949200; cv=pass; d=google.com; s=arc-20160816; b=NPB8AXf6+ndYJVEt8mLudwNGlGM8vKV33fQ0o41jofbU6e0uKlPPxnnnsRhDlQzRKd iTupjYYS/l3Atpfa4UO0/GtDOW9kBe4MsO4ut5gnV/l4FuKf+37mhWRxUOumCmJkyDih QtrShAKW9bXJRRjtUneQnhNJJkM4eZRu9pEAD9BaZCMLNScGw3f/g+hUcdrRpNoyMkVF EN2SaNe6oMLCoeA3AXazugaNbpfIjEx0hJil1trTs/tmt6KAUmZfJvPm0pglQRZDOH86 S97hs8zC/Kjs8FmVfe4CUIGfVDThOzcvgxnfz6J/+BYnpySFIvn1yheBN06hvozBiaK+ 4Kuw== 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=mLS7Mc55mFQ4GnN547qoofA5tnx+J8LSeNfoQBgZ7bw=; fh=8GcrWnrh130FKz+HGjruzeenflRGycBQDiswOK3KSog=; b=J2FGmFIhv/wij0emKTkD+iF7p5BS8r3nzZyVr1Dkgw5WM49DCT1W+rfCHBP1tFv/9s hSLvMzjH67QyQH96q/uEa8e4VEt8udGRB+unNyeySL9vDqowCLfyNmwlkCZFZ4sibksz DqQQKYU0vZXiZkLUgpFkLhWUgUUDecZSyl0RU0wOajIMZzj5FQtjN5lL2DIF8k0tyhli /bTRimFxTjfbjCyB5B8tuBDB4aWMZYKKvzP5P6HhZdj0PLg3gjVLhNwDCQeU7uDfc3In edlN39FN8hxdVHHNTNGNfjsAO97GO2rxPZYOj4kaASGM9WZxq7HCGaFvopp831mG3rRT 1MVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XdAyec9x; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-97740-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fa18-20020a056a002d1200b006e67bf06180si72569pfb.185.2024.03.08.17.53.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 17:53:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97740-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XdAyec9x; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-97740-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97740-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2A462281F1C for ; Sat, 9 Mar 2024 01:53:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCB63168C7; Sat, 9 Mar 2024 01:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XdAyec9x" 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 EF4872CAB; Sat, 9 Mar 2024 01:53:13 +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=1709949194; cv=none; b=ODXR3X7Vzr6EWp6AfVGoi3J+mIJvplZaWnSnReXRffbZ335Gp/XRfeOimED6UpscntHqi/5QRdKRnbSUMqajQNjKiXE9lnlU35hODvQx0fUioeBal0aBpmkDmRaFbXWMvpBOIqxUAHlbpHJMo/wTadBHCQ40l9UYXYDmgrv/Q0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709949194; c=relaxed/simple; bh=2knyzT26kc/AoacFUv5gxCg0MX3pdvSH3cxpNCbbYtc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g/cYqauO0d0BOAQiQwAUFo+HgT+7KovEWM9Sd+Y3HWUb5Zrwx8vkjoCa16ns/VhmvgJpqtOruH9CSiHBwGYDJmJ2lXr+Am/MTZRDpDYTIMx44MH0MoqL+WN2vRUnhJCbjifHf/oyJjRnfrq0KHNTu8x+lMEVrFJzOn69C254Qec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XdAyec9x; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0E0DC433F1; Sat, 9 Mar 2024 01:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709949193; bh=2knyzT26kc/AoacFUv5gxCg0MX3pdvSH3cxpNCbbYtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XdAyec9xU/ehyjyfJwe7qad+5r2egSexq8GXPXFLTw/wvmpAHxSLb9RsAXp2iJfHl AXLYRsMDs6Iv7r/wcMsKA1sRKlctdDv2IIEIj9m2XN6gH+qWydxczRmjCSDaOZYCFi WtLIoXdBINcFQOhRbPZvZ+Mk+b21HMlxN/Yp4J1pxNPLMJrSuOkozvhfpEaXph9ZJM qVpnfq/JyxY5OENt2OkgvaZe1SRgD71Ipd4m5Oh0K3imAJY2vU4YKYNpsP9EQFxt5D TIhYCU5jAf/IPZGjCb8J1jEFZM+EYRal1W2oYpiy/Y2wn0jjet/1EZ85l/CJPcVUDF SSIH04uWuZnAg== From: SeongJae Park To: SeongJae Park Cc: 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: Re: [RFC PATCH 3/3] mm/damon/paddr: support DAMOS filter type YOUNG Date: Fri, 8 Mar 2024 17:53:11 -0800 Message-Id: <20240309015311.45954-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307030013.47041-4-sj@kernel.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wed, 6 Mar 2024 19:00:13 -0800 SeongJae Park wrote: > DAMOS filter of type YOUNG is defined, but not yet implemented by any > DAMON operations set. Add the implementation to the DAMON operations > set for the physical address space, paddr. > > Signed-off-by: SeongJae Park > --- > mm/damon/paddr.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c > index deee0fdf2e5b..52e4be7351cc 100644 > --- a/mm/damon/paddr.c > +++ b/mm/damon/paddr.c > @@ -209,6 +209,9 @@ static bool __damos_pa_filter_out(struct damos_filter *filter, > matched = filter->memcg_id == mem_cgroup_id(memcg); > rcu_read_unlock(); > break; > + case DAMOS_FILTER_TYPE_YOUNG: > + matched = damon_folio_young(folio); > + break; damon_folio_young() doesn't reset the Accessed bit of the folio. Hence, unless something is resetting the bit, this damon_folio_young() call will repeatedly return true even if there was no access to the folio since last check. We should implement Accessed bit test-and-reset variant of this function and replace this, or call damon_pa_mkold() when 'matched' is 'true'. I will fix this in the next spin. Thanks, SJ > default: > break; > } > -- > 2.39.2