Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp547575pxb; Tue, 19 Oct 2021 08:10:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5CY22GRTtf2MxNtc3RPlV5vfDCBHBulQB3/LL05rysIKouzLDKKEupr0MTqrz1MRBjMEv X-Received: by 2002:a17:90a:9291:: with SMTP id n17mr338384pjo.243.1634656215935; Tue, 19 Oct 2021 08:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634656215; cv=none; d=google.com; s=arc-20160816; b=iIR//EaYN/HiWgWmK+YxJzetOFz/C7l531cmUqSoK6pnanT9QhB4Ad7Nx/bfruNYEE //aqNW6rZwaW4C5IAuTUYfE60WhtSW3YPrK26A9QEAe7FcA9fBWorynKP2HdNMqYgR/9 z2upoVHGCFNAwCplDeYeNuCRKo2wQFVVRTT5paxoD/PwzRbKC/OsH+8T6KFsvaRQUkJW 6slcVlDMfZpYlv7MHs370/zFWGLthH0lt7FR+sHaVJjepMJ5rC64ilkyNXSFtExB36JG bP7QOe8Ts7640m4mV9jIwtfbaqlYwGq/i3sbPQuq5ouBtGn2dJ2206w6euEivbq0tpUV YRIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=kgqzN0T9wf3pxA3EEr/S8HmfhZSvZTLOHiQ02ht1HII=; b=oSPjZkRhIPr03DBqNy+KTKhbtPTMwbB6zghvc7qif387l30QBUgGQ9LCNVZYN+lOl0 hrhO1NE8yFmMswqEbpzzg+lNc9OkmDrbbtE5wz54w921wzkeHXSm7LWMPM01uLBILA5M BkNuiyMzzwfquBtz1UJsK0VRE0x7Sbk5cyBDddzQ72ujka+n0E8EjLy5AhB40MVdHx5c WdBPIWGg+9pDnZpUWr4bjeZl0bhfPk9EeEc/FpFC68jbv2GBcNKkm6oUq1rr+Vs99f/b f9TrxqwCqMy3f4rfRTrxrGg2D3vkg+JCv14zCiT36N9sIL0uscwTV6jAZkbfkSukXV29 q8pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IOJ9pwnq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si22389082pld.185.2021.10.19.08.10.03; Tue, 19 Oct 2021 08:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IOJ9pwnq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234379AbhJSPKo (ORCPT + 99 others); Tue, 19 Oct 2021 11:10:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:58484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234145AbhJSPKX (ORCPT ); Tue, 19 Oct 2021 11:10:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1464761074; Tue, 19 Oct 2021 15:08:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634656090; bh=iF1JOxpLe76ro1DEIbOYfa4rEmjRCyhN4+ev6UUfQ5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IOJ9pwnqZfijT/1FLPXFtTWWX3Y6OjXGsatP3gBQ6p1SoecMVIo/EJMXZxh4adORh PMvDSqT6uKNtj+YwY44+KIdQYgWaaaqtFwQrzcVgVC8hblk3/LQzFvbEVLdTEuHZ/c 66ERdsKRgDHjb0kOPV3EP7v5RPysB0s7Tqw0KIR5ooOrqTyTrClw+DgHOCELAe5sdv qtFRV9V+hGNQeD7/gWFJLPXB6UJ/JK9Q49EqSScVGLfRGrjPPKAyz4/8X1nZ/lXGT5 fEW6kVfWs3vjHaz463B5LubfVJJatBS2G6d9eVifYF1kK+pnbQscQMUUC1pKy7wtMm CbuGDz40V0QZg== From: SeongJae Park To: akpm@linux-foundation.org Cc: SeongJae Park , Jonathan.Cameron@Huawei.com, amit@kernel.org, benh@kernel.crashing.org, corbet@lwn.net, david@redhat.com, dwmw@amazon.com, elver@google.com, foersleo@amazon.de, gthelen@google.com, markubo@amazon.de, rientjes@google.com, shakeelb@google.com, shuah@kernel.org, linux-damon@amazon.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/15] mm/damon/dbgfs: Support watermarks Date: Tue, 19 Oct 2021 15:07:28 +0000 Message-Id: <20211019150731.16699-13-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211019150731.16699-1-sj@kernel.org> References: <20211019150731.16699-1-sj@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit updates DAMON debugfs interface to support the watermarks based schemes activation. For this, now 'schemes' file receives five more values. Signed-off-by: SeongJae Park --- mm/damon/dbgfs.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index 9f13060d1058..6828e463348b 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -105,7 +105,7 @@ static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len) damon_for_each_scheme(s, c) { rc = scnprintf(&buf[written], len - written, - "%lu %lu %u %u %u %u %d %lu %lu %lu %u %u %u %lu %lu\n", + "%lu %lu %u %u %u %u %d %lu %lu %lu %u %u %u %d %lu %lu %lu %lu %lu %lu\n", s->min_sz_region, s->max_sz_region, s->min_nr_accesses, s->max_nr_accesses, s->min_age_region, s->max_age_region, @@ -115,6 +115,8 @@ static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len) s->quota.weight_sz, s->quota.weight_nr_accesses, s->quota.weight_age, + s->wmarks.metric, s->wmarks.interval, + s->wmarks.high, s->wmarks.mid, s->wmarks.low, s->stat_count, s->stat_sz); if (!rc) return -ENOMEM; @@ -195,18 +197,18 @@ static struct damos **str_to_schemes(const char *str, ssize_t len, *nr_schemes = 0; while (pos < len && *nr_schemes < max_nr_schemes) { struct damos_quota quota = {}; - struct damos_watermarks wmarks = { - .metric = DAMOS_WMARK_NONE, - }; + struct damos_watermarks wmarks; ret = sscanf(&str[pos], - "%lu %lu %u %u %u %u %u %lu %lu %lu %u %u %u%n", + "%lu %lu %u %u %u %u %u %lu %lu %lu %u %u %u %u %lu %lu %lu %lu%n", &min_sz, &max_sz, &min_nr_a, &max_nr_a, &min_age, &max_age, &action, "a.ms, "a.sz, "a.reset_interval, "a.weight_sz, "a.weight_nr_accesses, - "a.weight_age, &parsed); - if (ret != 13) + "a.weight_age, &wmarks.metric, + &wmarks.interval, &wmarks.high, &wmarks.mid, + &wmarks.low, &parsed); + if (ret != 18) break; if (!damos_action_valid(action)) { pr_err("wrong action %d\n", action); -- 2.17.1