From patchwork Sun Sep 10 03:40:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13378439 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 B0949EEB580 for ; Sun, 10 Sep 2023 03:40:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 12DCC6B0124; Sat, 9 Sep 2023 23:40:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DD0A6B0125; Sat, 9 Sep 2023 23:40:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F33FD6B0126; Sat, 9 Sep 2023 23:40:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E664A6B0124 for ; Sat, 9 Sep 2023 23:40:55 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B76E0B429B for ; Sun, 10 Sep 2023 03:40:55 +0000 (UTC) X-FDA: 81219286470.15.378EE27 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf17.hostedemail.com (Postfix) with ESMTP id 2925E4001C for ; Sun, 10 Sep 2023 03:40:53 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=LrXyTntt; spf=pass (imf17.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694317254; 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=VstW81SbC7u5K0M0K9pnwi/H/CdzQ2pt3D78JsLyr+A=; b=Fm1PHdjqoNqpZQ9MR6skzvUotFXagXziRBd9HIabn6Y21lkgzkwyFg/CJ2fXx4aQR/f4gp 98x/1mYoCw7IzUHoWiX53Ex3Y3xj9Uyzo5C4WKiaW6YKrkijYF8RSe2AQpJfvbedzFSHZV R/C+1SHJVuFNb68QkgojGwOReTA72Kg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694317254; a=rsa-sha256; cv=none; b=B/nAuIp5hUmrc363HyNVNRu2I8BY7Bfy8ssj/YRfuHCAGQaCEESuPvmZqEje95TkHZ3BZx 06lm4lKjz7h+JsWdOtsEnF6yNu0q4JKo33wVKX0OskbuG5D+P/wnamYh3fH6edQ19LpRVs Jicjv2fLOlUmvXbLsSnx9Zeo8KHHHgo= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=LrXyTntt; spf=pass (imf17.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4DF4060C55; Sun, 10 Sep 2023 03:40:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 606FBC433C9; Sun, 10 Sep 2023 03:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694317252; bh=P7zQCwnjvNM/0KUc4+YEr5PqkR+all9uO1LM0PE/RX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LrXyTnttdpLzVeZIEYQ1KlPf1eGSXzz5UV1gKdhzO3/x5aa0WKFyKpbq5vjX+2YPa k1Gdsop+MdQM08S0rG5L+8BsW1Pl12AMmtn0AU7TlzZBlbItisrpjdTgcYeBdIE7H2 8UpeGBcJO685O3hytod/LaJ+8cyLzSi7hJiW0WJsCjt5e9C3PV77c/bVTk8jtsn/zP 8AMzsjEInb8mB/y5NWGGMGe6Bf0+IRcXNYw873mvEdT4tZ40aBQ6Yc4MWa4npct0Oc TgvrV+xEAsxQJR7081G3Y3uW2HmYFPbRPRSitFZnTa/nS8H+fVV2natp1V34kA95J2 5TBv/I1QLkwJQ== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC 2/8] mm/damon/sysfs-schemes: expose nr_accesses_bp via tried_regions//nr_accesses Date: Sun, 10 Sep 2023 03:40:42 +0000 Message-Id: <20230910034048.59191-3-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230910034048.59191-1-sj@kernel.org> References: <20230910034048.59191-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2925E4001C X-Rspam-User: X-Stat-Signature: 1kbjgwgba7aikydtocrxqtrta9y6wqms X-Rspamd-Server: rspam03 X-HE-Tag: 1694317253-26914 X-HE-Meta: U2FsdGVkX1/Vl6XcR8WVxe0ou7+i980SRyk2s66ASoivkfUEcg3IcCuZkjj8ySoenNutu1jdi7j7a74cNNLrnZ4pPfLQGusNY8OE6ziIzfcR01HRZTA8m5sZ0Ww8IZvK0tBjWEg84PocQjmyrRGUlaCD4cLzvXHj/VEGPBK97K7DBUPNPNv0dd35Me2P745MBv+QEbsX8i6lLwJmxBCmIJbGja6gnxEkEcrmwUjHsvv+eq5dFDMDyX4F2XMpFBX9vnkAwbx7mrWtb96b/9AIWewiX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8jIW X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: DAMON sysfs interface exposes access rate of each region via DAMOS tried regions directory. For this, the nr_accesses field of the region is being used. DAMOS was using nr_accesses in the past, but it uses nr_accesses_bp now. Expose the value that it is really using. Note that it doesn't expose nr_accesses_bp as is (in basis point), but after converting it to the natural number by dividing the value by 10,000. That's for not making unnecessary confusion to the old users. Signed-off-by: SeongJae Park --- mm/damon/sysfs-schemes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 527e7d17eb3b..093700f50b18 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -31,7 +31,7 @@ static struct damon_sysfs_scheme_region *damon_sysfs_scheme_region_alloc( return NULL; sysfs_region->kobj = (struct kobject){}; sysfs_region->ar = region->ar; - sysfs_region->nr_accesses = region->nr_accesses; + sysfs_region->nr_accesses = region->nr_accesses_bp / 10000; sysfs_region->age = region->age; INIT_LIST_HEAD(&sysfs_region->list); return sysfs_region;