Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6979105rwn; Tue, 13 Sep 2022 11:49:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR67WKHlxtjdawp1oGHQV5fxrGHkKngyrq/+uIUlwqEtxPNRq4JvYo47vhLp2WXtRo/FHD2g X-Received: by 2002:a17:907:5ce:b0:730:bae0:deb with SMTP id wg14-20020a17090705ce00b00730bae00debmr23523995ejb.181.1663094939791; Tue, 13 Sep 2022 11:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663094939; cv=none; d=google.com; s=arc-20160816; b=juFcagi2Mm0qKpqiVw/qtiGQSPDuEErInge2NK7P0vslWC0c5VFIfKB2zXXMHQ/V1Y kfKdePqE4q0tXiU4VUKsNdBEQ3blpnmnrGi8W1me9yXQxzZPzQ79eFJ7e092nQMZ4+sH 6xphBGWxJsSlp3eAQINScLztfmw8gcfb1acWdpMHsi29DHNsolI+ozE1C37+XbLaoBrS Wga49arMwRGrVHQVUOfm9GF/oT/WP7zJUHsHa8sGu5i58251/5g95cKKdHlWQnZa6JD0 8mVQzurWThVfYrYaqvrcHFRelNLo+9zIbdaNVPVAjEUNk35aqCvUcyZk0QcXfd/Bn5C3 RJdw== 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=FvlGGAIV7dmxLifiXypUmUMsrgiTIgpUTYDiHGHWPPM=; b=wDvRsgjC9xKeD2vbILrTEEdC7uDT9YrLWIi9nD8tuuChhonYp7A/r1rPQzxKRKUMcQ 7DXXqTEgaV8V089Fj/gBlzQ/Qdcs2PiKDthhcJoFhe1gpIOqAnTdKz6uwAAivOqgHPcs I3KQZEHxSklD+Dz9ktO1jtAQIy043KmAK8CupTXB4Wh8jEBE7Mmo11fVFW1xXDmyp0FR x1vMeqDjWVVs9aa9tD2/TpEVdWCQvHDBe8RHLCPV94PFzWTdqK6DBw1JUl0TBt23ApyS l1Q+aScQd37jJO5t3//3JBLU1x66LW7v1RAt+J8De+VgEhK9PkvFn7RP+wF3SYkwexDT mcUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mjrzuvWz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 3-20020a508e03000000b0044e274977f7si7196959edw.413.2022.09.13.11.48.34; Tue, 13 Sep 2022 11:48:59 -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=pass header.i=@kernel.org header.s=k20201202 header.b=mjrzuvWz; 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 S232636AbiIMS3U (ORCPT + 99 others); Tue, 13 Sep 2022 14:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232598AbiIMS1Q (ORCPT ); Tue, 13 Sep 2022 14:27:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C85B6BCFD for ; Tue, 13 Sep 2022 10:45:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ECA3661547 for ; Tue, 13 Sep 2022 17:45:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02E44C433D7; Tue, 13 Sep 2022 17:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663091106; bh=9TcztpKUfo8rJO30rUXY908EwJFNjnWv9MscjxP6KRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mjrzuvWzKjr0o1tHWC3oa/x8CqWNP5PZKYZP/XDN92cM7jK70J4mKUV9vausd238e riryqkMtUWxyD/gX5tYUkxQ3P/3zszg9T3RTTLtE0phE7ILox45K92oYXyhMSPTCOk CUNOQPWXe34ewcWLx1MgGlrJyzyOtADspV8a+qY/3IG+E/X81uLk0fLip6jGYk58PE FkgLBer7nq3bHOUfHrrTi3o8B4uGR+XFGVk2qGgBqPc6twV724Olv2YWOMdKH8HKky vCgcKNxYMVV143k4OapjzmPrZd+gqTrVaC9FHYff8un/H22Cc6xjvgRvM0iApFhA0P HixvJiwLik+1A== From: SeongJae Park To: SeongJae Park , Andrew Morton Cc: damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/22] mm/damon/modules-common: implement a damos quota params generator Date: Tue, 13 Sep 2022 17:44:45 +0000 Message-Id: <20220913174449.50645-19-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220913174449.50645-1-sj@kernel.org> References: <20220913174449.50645-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DAMON_RECLAIM and DAMON_LRU_SORT have module parameters for DAMOS quotas that having same names. This commit implements a macro for generating such module parameters so that we can reuse later. Signed-off-by: SeongJae Park --- mm/damon/modules-common.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/damon/modules-common.h b/mm/damon/modules-common.h index ed973e0770ae..3e99810b4689 100644 --- a/mm/damon/modules-common.h +++ b/mm/damon/modules-common.h @@ -17,6 +17,12 @@ module_param_named(max_nr_regions, attrs.max_nr_regions, ulong, \ 0600); +#define DEFINE_DAMON_MODULES_DAMOS_QUOTAS(quota) \ + module_param_named(quota_ms, quota.ms, ulong, 0600); \ + module_param_named(quota_sz, quota.sz, ulong, 0600); \ + module_param_named(quota_reset_interval_ms, \ + quota.reset_interval, ulong, 0600); + #define DEFINE_DAMON_MODULES_WMARKS_PARAMS(wmarks) \ module_param_named(wmarks_interval, wmarks.interval, ulong, \ 0600); \ @@ -33,5 +39,5 @@ 0400); \ module_param_named(bytes_##succ_name, stat.sz_applied, ulong, \ 0400); \ - module_param_named(qt_exceed_name, stat.qt_exceeds, ulong, \ + module_param_named(nr_##qt_exceed_name, stat.qt_exceeds, ulong, \ 0400); -- 2.25.1