[RFC,2/8] mm/damon/sysfs-schemes: expose nr_accesses_bp via tried_regions/<N>/nr_accesses
Message ID | 20230910034048.59191-3-sj@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1487899vqo; Sun, 10 Sep 2023 01:31:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJDLdzYj+Gc76sW1kWvxJIzPjmydn2ji1DPKFLOBx+lblsjRXel3cMQNasSDBb1V+T0Syv X-Received: by 2002:aa7:c696:0:b0:522:cef7:83c3 with SMTP id n22-20020aa7c696000000b00522cef783c3mr5759324edq.8.1694334681441; Sun, 10 Sep 2023 01:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694334681; cv=none; d=google.com; s=arc-20160816; b=vUXh12LjGR9i61wexgL014+b67JWONf4lFL+BU9NOpq4b/KbKNcFnfN+bNmBVRSidv ClUR+mOhhuGpD7+W7N13hZS/jfvTF31WkdGhhNdUVKrsc/6ZBOC2Cu56FgD9G2k4Jy1U 0oXLkBPtQJVtclFdRVlZlJ2XS3Y6ABNHuIf/l2L2HJO0ae8Uw6Wydz7Ep7R8jIfRSRUb MJNqtqtS3XOOAsBm4qfLeMYepUu2Bsd1+JDWboaXxPYfgZ3wk7EDL4rvDLPY3OP4E8Pu QvZmW+k3QGxEuXWXN15PLJtKGhtXtQ2WU581SuzSRdkpydiAiiSEwXjP4skzljTCwbGY 19Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=VstW81SbC7u5K0M0K9pnwi/H/CdzQ2pt3D78JsLyr+A=; fh=vqNpWvtrgKyqgLywmXrl7l1d0QUXOIwW93A3X4awQbI=; b=dfb4hwnKDBuYKlgTuNhWHpqpP1KDCSEKWT7qwmtl5RirL4HSAA6A80vrO1Pz/ayVFe u6ZHUR2CKEs5LrxEQr4XVXH+bhl5Yol99gj1avlXkZyUQ1SzqI+GA7//vKSjtb88uwNR cWjf49a399zYrIiju4I6og0lQTsWWqn/J8btYD19HarQJY/33PZon/YDDRyJsEXeTV/5 Xn1b8YBXVHjMC9SINqlC5XBDs4YrpziNm78JWN4svX/nyQ8YpQ5uAok7La6CfyVQnW8Y IYxjEEcN1lJHtBqcM2/OphhhzvtFAT+5uXSylZ0sb1/S3TNTXiH6szTXjHwBhhIFMz/j pPYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=LrXyTntt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m12-20020a50ef0c000000b005234f46af0csi4445809eds.128.2023.09.10.01.31.17; Sun, 10 Sep 2023 01:31:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=LrXyTntt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344807AbjIJDlC (ORCPT <rfc822;toshivichauhan@gmail.com> + 14 others); Sat, 9 Sep 2023 23:41:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237566AbjIJDk5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 9 Sep 2023 23:40:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 552391BF for <linux-kernel@vger.kernel.org>; Sat, 9 Sep 2023 20:40:53 -0700 (PDT) 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 <sj@kernel.org> Cc: SeongJae Park <sj@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, 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/<N>/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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776638682714874195 X-GMAIL-MSGID: 1776638682714874195 |
Series |
mm/damon: implement DAMOS apply intervals
|
|
Commit Message
SeongJae Park
Sept. 10, 2023, 3:40 a.m. UTC
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 <sj@kernel.org>
---
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;