Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6993085rwn; Tue, 13 Sep 2022 12:03:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR7FP3VjTU64bgDnlHYvajhU0P0vIZShCZekL9XrZUUNtf+HCSr52mdRl+iR3Y6TPjMGlDJP X-Received: by 2002:aa7:df8b:0:b0:44e:882f:7c5c with SMTP id b11-20020aa7df8b000000b0044e882f7c5cmr27387314edy.418.1663095797835; Tue, 13 Sep 2022 12:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663095797; cv=none; d=google.com; s=arc-20160816; b=icL4r9aU6VYkBAP2O8zzw7VzxXPAc11t0bmyWYtyzmTunjT6svdsdLnyH67jglzDKG 1AaQ0F0Acnk3RNo0UUOhq2xrwa9GZRitFiF9J/WILLZsYboAcxhuScJuMNaFTyAnk5qr QAfXgdgTTzPWITdkXDuinzAfrIZPwSMJYTLljcJARdpfCagh0napye9nhANsnbNIE6kn vK94xg1Xi/VyhnDmMk7td+XPwQyERCaEJa3HlaGVc+snEOwxzHZq6+xdlUyxM3k01ryF vLAxzR06iAvbZnINDl9vKsRtY/m9Gy/yLBL+UJmYKU5Wa2DvdWPHbHcHhSDDkKWV191/ 7uYA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=c2Z6SQm5TS7CtHRyNQPVSgSxYsSCbwFH1RKx81iLjkQ=; b=tip3EzNhJyBRIkn8jaqC+Hd8OBnzuxbl/XCsR2YqxKIHwbvC6/h1xchKr1MUYcNt5A +77yqWgi6Vj5SdZq6rUl9G4rjZdeHHRbYuFuh2SvBqx0gPt7uTGJzDv9ej/5AzFY08E+ HT2vkv7GpoZCixIEhFWMQmU7f/O8waaq+FkWXZI8GCunFPrUOSHqhW9k9QtR2HxrfqP9 sK7FlDwcF/Tgd4stQCFwybt5gq0Rch7hA/1gBYnYa0w9GdmZpYfhd6YIiPMLreqgp7UG iDKwfLpn8PAnPx2jS7rshEqpsPt3U4SX/ohZKentqPJAQEa6EvhVIKWeyLaLVBeZPYLn srcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ZH1Dt/WE"; 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 ga32-20020a1709070c2000b00730a4424a40si2985510ejc.160.2022.09.13.12.02.49; Tue, 13 Sep 2022 12:03:17 -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="ZH1Dt/WE"; 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 S232321AbiIMS1I (ORCPT + 99 others); Tue, 13 Sep 2022 14:27:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232136AbiIMS0p (ORCPT ); Tue, 13 Sep 2022 14:26:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25AFF24F10 for ; Tue, 13 Sep 2022 10:44:52 -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 585C061520 for ; Tue, 13 Sep 2022 17:44:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B4D8C433C1; Tue, 13 Sep 2022 17:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663091091; bh=LTJFQvu3fbUeoBlxoYkTj8tKAF1KlT7wckZz/6RxiTk=; h=From:To:Cc:Subject:Date:From; b=ZH1Dt/WEu+RKqwakhbFJdLk1LRaoAY6d4pBecFD6CWCBB29RD8d9bRfAAAaeBSX6C J0CX8Ug8EdBVLn/vyrwrvjm02pykj6JLmd5iCoKLbASMe8H/WM5CLDwpSejRPuVtTN lvcEW6KKG3POEsv3eX4pnhNGTUUf63tgNuj57ns8zhNcA1yk6GUgjyj0AFn/RFU1+z N67qc4s3i7+lq8pKR5UiAleJFeo8yg6V+JellPHu7HT/z8PGh5kzu6qYyHhGq5LpJr 7qxKE/2WauPs0gTPhIMQgSC70NQ9yAnw/CYd6n8B3QQQemnkB1pSDK2UOZrSRczE20 Fn+UI+hVckl0A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 00/22] mm/damon: cleanup code Date: Tue, 13 Sep 2022 17:44:27 +0000 Message-Id: <20220913174449.50645-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 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 code was not so clean from the beginning, but it has been too much nowadays, especially due to the duplicates in DAMON_RECLAIM and DAMON_LRU_SORT. This patchset cleans some of the mess. SeongJae Park (22): mm/damon/paddr: make supported DAMOS actions of paddr clear mm/damon/paddr: deduplicate damon_pa_{mark_accessed,deactivate_pages}() mm/damon/core: copy struct-to-struct instead of field-to-field in damon_new_scheme() mm/damon/core: factor out 'damos_quota' private fileds initialization mm/damon/core: use a dedicated struct for monitoring attributes mm/damon/core: reduce parameters for damon_set_attrs() mm/damon/reclaim: use 'struct damon_attrs' for storing parameters for it mm/damon/lru_sort: use 'struct damon_attrs' for storing parameters for it mm/damon: implement a monitoring attributes module parameters generator macro mm/damon/lru_sort: use monitoring attributes parameters generaotr macro mm/damon/reclaim: use monitoring attributes parameters generator macro mm/damon/modules-common: implement a watermarks module parameters generator macro mm/damon/lru_sort: use watermarks parameters generator macro mm/damon/reclaim: use watermarks parameters generator macro mm/damon/modules-common: implement a stats parameters generator macro mm/damon/reclaim: use stat parameters generator mm/damon/lru_sort: use stat generator mm/damon/modules-common: implement a damos quota params generator mm/damon/modules-common: implement damos time quota params generator mm/damon/reclaim: use the quota params generator macro mm/damon/lru_sort: use quotas param generator mm/damon/lru_sort: deduplicate hot/cold schemes generators include/linux/damon.h | 34 +++-- mm/damon/core.c | 87 +++++------ mm/damon/dbgfs.c | 15 +- mm/damon/lru_sort.c | 303 +++++++++----------------------------- mm/damon/modules-common.h | 46 ++++++ mm/damon/ops-common.c | 4 +- mm/damon/paddr.c | 29 ++-- mm/damon/reclaim.c | 220 ++++++--------------------- mm/damon/sysfs.c | 12 +- mm/damon/vaddr.c | 4 +- 10 files changed, 246 insertions(+), 508 deletions(-) create mode 100644 mm/damon/modules-common.h -- 2.25.1