From patchwork Sat Sep 16 02:09:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13388072 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 293C6CD37B0 for ; Sat, 16 Sep 2023 02:10:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B4D3A6B040E; Fri, 15 Sep 2023 22:10:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD56F6B040F; Fri, 15 Sep 2023 22:10:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99EC46B0410; Fri, 15 Sep 2023 22:10:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 86E9A6B040E for ; Fri, 15 Sep 2023 22:10:06 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 53D461607E2 for ; Sat, 16 Sep 2023 02:10:06 +0000 (UTC) X-FDA: 81240830412.17.9C47936 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf27.hostedemail.com (Postfix) with ESMTP id 59DC940011 for ; Sat, 16 Sep 2023 02:10:03 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VOW72m4+; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694830204; a=rsa-sha256; cv=none; b=4Kcfk+MdtVDga/8ecHqhK2zsi3TmIQMmQ9LYJYfNRvcPOA+83W82t/s4H4kwuIbCi3plwW FeOiKXr1/IQphxhs1Rs97hqMMhPFapfOro0+WGQeppKYI5YP0H6eMftDSU6PRWpWeW80Iv c8/hn2Br0+zf6cxLeiz/NXgJn9o7Pn8= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VOW72m4+; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 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=1694830204; 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=XMv7ZYg2RAYZEyI+n5LIQn6oa94Zk4SRuNBtg0vN5u8=; b=QquRAu/iL9QwQwuMqDieR7dWk5OJkhWpmgcaELK2xj74eWLS6c+ktYKbC6ucsjMjrJ0o2p iFdJsTVGGZ0DreGw2Ud3lgGa13/uJOJRkZ4PCofuZDwsUkn7m+NeWfuW0JQBR1YwP3nWU4 +z8ErAHeKKfVQ6Ac7UH3Oa1DUkik3Xk= 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 sin.source.kernel.org (Postfix) with ESMTPS id E8A10CE2E60; Sat, 16 Sep 2023 02:09:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0623C433C8; Sat, 16 Sep 2023 02:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694830198; bh=DNLoykVfcLunzlqLq92ppaTwpNSuqGnLy/p/x4HnboY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VOW72m4+tcRyIHubvfGta2PK60I+MtD4+v+Xr+eH0EemTaxQPuTpCGCkUMLnjCAa+ o/2hmGpyllSeicIhd3FysLe0WsJ8ETtGUxFa7DFAmLgljTuv8bSbEQX785z8vISz2W ULi87aU+zbisxJZKBJ7bMQ5GwcLGJYKr1vBzMsiUzRCaqaatj7WjHpB7n5/570XMYj QjUNjvbxGcwD9TPVr7FBbPoMwNYPLh3eRe/8kKkE8me85m9jNJL4GfTQoKudWnzImQ vsDZ2/2R8LpB8aAXw+R0ARwhL5AEaBGZAzoS/PYxAr/WWECQg4TsDtiObwoyz/ZEpc mD1gZAGqr5wfQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/9] mm/damon/sysfs-schemes: use nr_accesses_bp as the source of tried_regions//nr_accesses Date: Sat, 16 Sep 2023 02:09:38 +0000 Message-Id: <20230916020945.47296-3-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230916020945.47296-1-sj@kernel.org> References: <20230916020945.47296-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 59DC940011 X-Stat-Signature: r9hojjrsxigybq8yhakm6kg6rwaoaxhy X-Rspam-User: X-HE-Tag: 1694830203-321628 X-HE-Meta: U2FsdGVkX1+a1ZyUxfKhSMcts/y4K36FVGfY6bcZUEBhcoJHLwPAZd70KphIHRr0tPRACSYBq2/Ci4niI2qk2qWpSiA3a+38yWfBAHLIpxsDxZx+/jrnuNH/tTAV/k9jk5vS4RlTtaocyH/w0OxUV37b4v+EUoNbTe49QolCgEOWUYn5saNPq426phvvq5YMkuH2w1E0c7S94gKayfqXfKCqW/YyzIvLcgXQ4nOUvVGBaGihXT/EgtjvWagn+b1HbtLF9ezun3SfL0wtbVexiucnP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AXmn0+qz2O3hOPqWBgmdLo7rUd 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 used. DAMOS was actually using nr_accesses in the past, but it uses nr_accesses_bp now. Use the value that it is really using as the source. Note that this 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. Hence there is no behavioral change from users' perspective. 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;