Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2491226lqo; Mon, 20 May 2024 07:31:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXRKUbhQJQSQ2dVoVysh3ihuQKXwezkd87QaBl2xomCABTbXDe7wDAadSBR7a7a1SlkODDHpQPsZoOSV4R8SOQEZ7KTgyCwnN7Gdxg3Q== X-Google-Smtp-Source: AGHT+IHut2+T3zTpUN6fMfRa8ZtGmaMM9Iegi8sjfWVAwglx+DkvcOiqazzkAhqkvM2RHZt92hvo X-Received: by 2002:a50:9e61:0:b0:572:e7ac:eeaf with SMTP id 4fb4d7f45d1cf-5734d5ccc9cmr19825655a12.19.1716215493184; Mon, 20 May 2024 07:31:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716215493; cv=pass; d=google.com; s=arc-20160816; b=PARPFwKc0vflJkbYe4s0irm86hb1dv6932iIKVk/lC38aqmz70D6bMPi+UDFi/xQsL euS5+mPrBXK778CoUoUkXdoapjoGk840P7UTztWGs4szjruGEQz0+jYdSaYXuudU2vfe S4qx/LlRYeq/f///tABPkD6h6iPK3xtoySoEskI+qIjHmlm3V+Tw/HjxTT/dvyyweRde DJCMpeywV4N8sCjYtaO7aff7L99hUlDm1qc1nfYS/BIaIx98GcZxHV52d8s9vj2/0eJ/ 4J0wM5NIqTtBxqUDKjmKsJRfin6TcR4p1VaCdBJqN+jrotNDdtKEErrVPKIeI6s2pE/W poUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=d+JsgoyJouVNGeodk33FzXnjKwnGHQfbLoITrru7PxI=; fh=MbBx5ICOm1lDQ3sLQ0oKPJYglHNCXsyD4iPCo/96mys=; b=YcDbNBvcuPlH5PyV5DlE29S7YwKLMX07onI37920bTV6BY//rWQDsQF+UWoaxmx2Zs lod3BUFHwwt1lDNdAdraS0gR0BxnB0Z0S8gb+F6B2hZKwcUTfWp3RkC7+N/tisyRyeQR Jhhb2g2BbH90sku1Awr9eHz1qf/fLcFEa4h7QwMqfrixYsgbFg0IGkVFDYwBPlrzbysy nNv/ZFRItDj+qCWcnnnApoGmIpZFi5GzkOJavZ3jrZSF+yW1CZD1qmUOi0+LGmErU5Hr jx11DkPlymaNU/tKWwW+ijGMTM3iMFY3UV7ncZuzJPInN5M2TUL8qHf3vls7sDSYpgJb whwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ajou.ac.kr header.s=google header.b=JY5jGjAO; arc=pass (i=1 spf=pass spfdomain=ajou.ac.kr dkim=pass dkdomain=ajou.ac.kr dmarc=pass fromdomain=ajou.ac.kr); spf=pass (google.com: domain of linux-kernel+bounces-183840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=ajou.ac.kr Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-574d1ad6826si9101285a12.166.2024.05.20.07.31.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 07:31:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ajou.ac.kr header.s=google header.b=JY5jGjAO; arc=pass (i=1 spf=pass spfdomain=ajou.ac.kr dkim=pass dkdomain=ajou.ac.kr dmarc=pass fromdomain=ajou.ac.kr); spf=pass (google.com: domain of linux-kernel+bounces-183840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=ajou.ac.kr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E26281F21C81 for ; Mon, 20 May 2024 14:31:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB2AD136E18; Mon, 20 May 2024 14:31:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ajou.ac.kr header.i=@ajou.ac.kr header.b="JY5jGjAO" Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 448E4136E03 for ; Mon, 20 May 2024 14:31:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716215466; cv=none; b=P4u9KBq8xV1Ih1N21ZWuZo+VeC02NMHuHQ+B98ApPJTApDhWOI07nTL4kQWiDdPSZ1TdksOvjXpOWJxpccrm1EU+JmYaXTaneMQtZ0cyCYVnNXk9NHFALAfMb/CooTAKIH+Zgw/tbfg9vzD4Nf0dpus4E5ws7PrJhEyTXqM56Dc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716215466; c=relaxed/simple; bh=mDA8v9G7f+U3FaSZiKaYOCWuZt/Ho55XYWskkCZ0qEA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Uhn4pAkLBgJiyCFf1IzzFQSVbwPm++TUFmEt4FIaJAZW3ATIs4eI6Hst3u0740cJk5xRH9UylA6tf0CHfarQlXS8P+mbp35loz/BzEWdiaOpF5hembeJ+AcWlHpXMe6RxXKYuWV8BRJgkBMojKt0moRf8tIf9KEqsbQU86LeiEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ajou.ac.kr; spf=pass smtp.mailfrom=ajou.ac.kr; dkim=pass (1024-bit key) header.d=ajou.ac.kr header.i=@ajou.ac.kr header.b=JY5jGjAO; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ajou.ac.kr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ajou.ac.kr Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1e651a9f3ffso72505125ad.1 for ; Mon, 20 May 2024 07:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ajou.ac.kr; s=google; t=1716215463; x=1716820263; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d+JsgoyJouVNGeodk33FzXnjKwnGHQfbLoITrru7PxI=; b=JY5jGjAOkUxwfNHjME4zhPFL/XhUIMwofRGWkoPhXCezBTaUg5WIM7jWIfh4sSGyyB gwE5Ou65kyGAW9jpSw5RhdLAVItc7Nk82RJvt46AbkjGbUV4N7mcdsMCpi9on2a5ht4Q XZ3viFgT+nPt6gbP7VV2mtBN+QqNZgp1dL4zk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716215463; x=1716820263; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d+JsgoyJouVNGeodk33FzXnjKwnGHQfbLoITrru7PxI=; b=o/j1EzaRjh4c+P1/xTLzTEANvbovI2dNplxIN8HQR4gMw0uLeCfUZY0BQ4drv2TUfC QYTjrDLek+9Qf/AzrEWlN7sk9aBr4aJ6HHIC6QKiroMedylDn/hkekOAHTyXOVyccXaS LApi27YS5CLCzNfriET03TXpuCnjD/2m3Q14GEI7gqU9cmAxHN40MezBxg8UNo8EjDph ZlpjRjwNOiMMzvLqWv4iagKsl9+5SRm/xFJVPLHV2qIDyUaJwqzeO+DmYwElRHMuYIGE 6Vtxi8m0MeEU6aN69CjVrqEbBa2K9Fp7Med+xrcGDinUzS0RQv/lmx0x+IG12YDyipCK Gbew== X-Forwarded-Encrypted: i=1; AJvYcCUzvHJkJOdMRCaHXiwc9HQ8kgTOKOt+7fahIwOBKmg3x08o5WKwVoqvgYIEgyQhztJiW2Yc2aC8rzPVgj6H/RdZIkoRxCExz5/6FqGI X-Gm-Message-State: AOJu0YwXoF8i+GQbyBbii3qeKeaUZJpTgsoCOJen7VDoJmBeRbi6fPkF Tljsf4pOjlASCLgut0j9VvhM3YpMLYIHQ0V8S8wwK/Fzo8qFowuCRPGqWmT/89M= X-Received: by 2002:a05:6a20:7486:b0:1a7:878f:e9a3 with SMTP id adf61e73a8af0-1afde0e6b38mr30695430637.22.1716215463579; Mon, 20 May 2024 07:31:03 -0700 (PDT) Received: from swarm07.ajou.ac.kr ([210.107.197.31]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2aa017dsm19714531b3a.96.2024.05.20.07.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 07:31:03 -0700 (PDT) From: Jonghyeon Kim To: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org Cc: Andrew Morton , linux-kernel@vger.kernel.org, Jonghyeon Kim Subject: [RFC PATCH v2 2/3] mm/damon: add module parameters for NUMA system Date: Mon, 20 May 2024 14:30:37 +0000 Message-Id: <20240520143038.189061-3-tome01@ajou.ac.kr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240520143038.189061-1-tome01@ajou.ac.kr> References: <20240520143038.189061-1-tome01@ajou.ac.kr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch implements support NUMA-aware DAMON modules by adding kernel module parameters. With this patch, DAMON_RECLAIM and DAMON_LRU_SORT can use this feature. Signed-off-by: Jonghyeon Kim --- mm/damon/lru_sort.c | 1 + mm/damon/modules-common.h | 4 +++- mm/damon/reclaim.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c index 3de2916a6..3e25a52de 100644 --- a/mm/damon/lru_sort.c +++ b/mm/damon/lru_sort.c @@ -81,6 +81,7 @@ static struct damos_watermarks damon_lru_sort_wmarks = { .high = 200, /* 20 percent */ .mid = 150, /* 15 percent */ .low = 50, /* 5 percent */ + .target_nid = NUMA_NO_NODE, }; DEFINE_DAMON_MODULES_WMARKS_PARAMS(damon_lru_sort_wmarks); diff --git a/mm/damon/modules-common.h b/mm/damon/modules-common.h index f49cdb417..b167bb24a 100644 --- a/mm/damon/modules-common.h +++ b/mm/damon/modules-common.h @@ -27,11 +27,13 @@ module_param_named(quota_sz, quota.sz, ulong, 0600); #define DEFINE_DAMON_MODULES_WMARKS_PARAMS(wmarks) \ + module_param_named(metric, wmarks.metric, uint, 0600); \ module_param_named(wmarks_interval, wmarks.interval, ulong, \ 0600); \ module_param_named(wmarks_high, wmarks.high, ulong, 0600); \ module_param_named(wmarks_mid, wmarks.mid, ulong, 0600); \ - module_param_named(wmarks_low, wmarks.low, ulong, 0600); + module_param_named(wmarks_low, wmarks.low, ulong, 0600); \ + module_param_named(target_nid, wmarks.target_nid, int, 0600); #define DEFINE_DAMON_MODULES_DAMOS_STATS_PARAMS(stat, try_name, \ succ_name, qt_exceed_name) \ diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index 66e190f03..31b8830a8 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -68,6 +68,7 @@ static struct damos_watermarks damon_reclaim_wmarks = { .high = 500, /* 50 percent */ .mid = 400, /* 40 percent */ .low = 200, /* 20 percent */ + .target_nid = NUMA_NO_NODE, }; DEFINE_DAMON_MODULES_WMARKS_PARAMS(damon_reclaim_wmarks); -- 2.34.1