Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4959603rdb; Fri, 15 Sep 2023 19:18:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHj5pCvXbw/wBHI0ABoKS7Dz8Md4K3k928fg9H58TNZadOQC1e/v+/V9vvKfPnaUtoP9iGk X-Received: by 2002:a05:6a21:3387:b0:130:7ef2:ff21 with SMTP id yy7-20020a056a21338700b001307ef2ff21mr8112748pzb.19.1694830684057; Fri, 15 Sep 2023 19:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694830684; cv=none; d=google.com; s=arc-20160816; b=FdEn16c1Z1s080an34dreiGQRXdbsNYGlnIjOFrpffgMk/4cwxaNtOk/xLS1N/vjsc f3x9NhGh7nNkdnWvJepcQwcnKXPfHFbN2/lD+Y5rnKWxKED47RHOldNl+av1wnSkYhKT tm1Y9WVJMZiO8hMAKZYpaXxlqCUXZ0REPsM3rEgYOS+FYrjC1IvYATb2GEaQGQHdI4vM aqFWfedrmPBAWKyveL/vgJslR6wi1/AEvFyKujttE3N7Ry/HMIZMLG7C5ShXyH//tIJb TkqXa/p+CgHRO2tivlFvjicmNyANUQmb9Y/weS+rAhNZBNPjXuoxuPDulfBojSWPXpYI xb/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XMv7ZYg2RAYZEyI+n5LIQn6oa94Zk4SRuNBtg0vN5u8=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=bcJPiV0wIazDTury1Q8WND4TW7zABfZWB8FJVe/z72BkZcl5AwLF64fYBVoTA9kwip igPw5+Qzj/+9ps30NYWoqkR54mBrhI5YnpVuM1nWPZJplFGBK0PDpyjZAIuXams9KzFV QYjVkPjquS2TYM1oV2eq1x5z6SPN4u2VS9HqBs6NtTHdBBOaJJOUvUjeeiIF77rCQQLs JxwTVOAPyfGf3WCBGQxHam4E93PeGijHV+FISr5mnm12BvlC4C6rI+QmuKhveXN8KKOm Ji8twKponOFA1rVStRoVhJao+5ZhEOF5lgs+y2DVCCwtHIDwBXWh+ZumkPWDowET7nkM CmeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VOW72m4+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id o66-20020a634145000000b005777bea0b5esi3984772pga.901.2023.09.15.19.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 19:18:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VOW72m4+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 61F93846B6B0; Fri, 15 Sep 2023 19:11:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238348AbjIPCKY (ORCPT + 99 others); Fri, 15 Sep 2023 22:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235779AbjIPCKD (ORCPT ); Fri, 15 Sep 2023 22:10:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9889B173C for ; Fri, 15 Sep 2023 19:09:58 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 15 Sep 2023 19:11:20 -0700 (PDT) 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; -- 2.25.1