Message ID | 20221026225943.100429-1-sj@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp524593wru; Wed, 26 Oct 2022 16:01:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7BesotSWEjPpgTzhWveqxirjmV4F7rsCvUaP4BDw2KhABrqwGTGEHJMoBtVEx/oh/W702f X-Received: by 2002:a17:90b:164d:b0:213:6a84:2529 with SMTP id il13-20020a17090b164d00b002136a842529mr1539047pjb.32.1666825304849; Wed, 26 Oct 2022 16:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666825304; cv=none; d=google.com; s=arc-20160816; b=GFBadJLa9XmvRZ3N7yAIp9HvcKV7tSfIHAGT99RLIlp2ZDXKAfYyxu+oJ4tGGeb8F5 pUJPVE5RYWdz6F6kiqkwbdT8lDpmvgpHn8fWlZaK8yJJgp6hkMsTV4zkrzGPcdKjqYEv 2fkhqSwCx0FpUYlGnOQ239fRPXyM3AI1lyvDaaY868Pd8Y19Xp0i0JEOXKH+vgQaiJax REDUOWPCcaldC6QMlBGbNIchD3SnYhuRJWbuAj7d4w6+ubtaAi/swXpADB23ndohfV9p G1ruuMElGsDouvcdhtEoZDGvSEh7VVYCOOHlT6ukzKmnQtJi8qLLuhdafmRYRjmiN0TF 8Q/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 :message-id:date:subject:cc:to:from:dkim-signature; bh=kboEvSiM5b5lZy4Ai7WQjYzWPxLprwOSxCDhDapZDHI=; b=JEJlakgGovfCy1qax+PDM29YE5Oh94o/34lgjHDt1U/ldFY5vYx7xvvduSVqJp337f cIP4zULwmZmn60B48bkWZ6NHD1KFIKQrsVIl5hr+BGBVA9XXpWz3+7dCDhNdUpbrJFFk cflueCscrFU15i/jW6we3JQyHCVWDUA9e2oOeMniBW8ZrTFnd1d95jfnhujoZpWknetU I7zM8mE5ohPUa8P49V0uBLyOiRKtzYApR467NjU7nIXzfZcuwEaF0yz9XRBWDszbeO6T ZDSboUxMKg2HjdxLyrVCDhcZ8AgZX2pP5l9Wusw21820uhLMp57bXOrNz+swn992yRgz Op9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QuZyRMU3; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a655189000000b0046eb96a9955si7957588pgq.576.2022.10.26.16.01.30; Wed, 26 Oct 2022 16:01:44 -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=QuZyRMU3; 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 S233941AbiJZW74 (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Wed, 26 Oct 2022 18:59:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233491AbiJZW7y (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Oct 2022 18:59:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE62813E39 for <linux-kernel@vger.kernel.org>; Wed, 26 Oct 2022 15:59:51 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9957AB82456 for <linux-kernel@vger.kernel.org>; Wed, 26 Oct 2022 22:59:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF248C433D7; Wed, 26 Oct 2022 22:59:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666825189; bh=A1xog9/JoTImuQjfC8/0jRefs+jLn853oqIp5j+8x/c=; h=From:To:Cc:Subject:Date:From; b=QuZyRMU3886vYVE9gsZJ/b9p/OupKMJkvflDE3O8Tpf3rT5z/+aX0QHbWjjP63vHI LZZkgA1vu7Blc2LCxWr051ayX6l1dQzGNlUL11HVCOqYob35Z4MQdCHEbmTsLu/OyB oEFhko1EMhCPAhvgco50a17N4c2GLd3zLbQX5aUF3Tw9tdHQIThpqd1lEOfqWs6BrF fFmwJYzqRWJSM/T/Sygfc8AFO+/lFSWw6Yd5HXvNxx3XnO1gghW1eOgrY2tyxGsHP2 vHdKZ9Xa2YTSV6GkqtaUY+96KMC++26CXgZM1YYvQddsPVWBm4PNdV/jcfkCzbT+oC STlJEMnhT2gNA== From: SeongJae Park <sj@kernel.org> To: Andrew Morton <akpm@linux-foundation.org> Cc: SeongJae Park <sj@kernel.org>, damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 00/12] mm/damon: cleanup and refactoring code Date: Wed, 26 Oct 2022 22:59:31 +0000 Message-Id: <20221026225943.100429-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.6 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747793010587895231?= X-GMAIL-MSGID: =?utf-8?q?1747793010587895231?= |
Series |
mm/damon: cleanup and refactoring code
|
|
Message
SeongJae Park
Oct. 26, 2022, 10:59 p.m. UTC
Changes from v1 (https://lore.kernel.org/damon/20221024204919.18524-1-sj@kernel.org/): - Add 10th patch, which splits schemes sysfs directory implementation This patchset cleans up and refactors a range of DAMON code including the core, DAMON sysfs interface, and DAMON modules, for better readability and convenient future feature implementations. In detail, this patchset splits unnecessarily long and complex functions in core into smaller functions (patches 1-4). Then, it cleans up the DAMON sysfs interface by using more type-safe code (patch 5) and removing unnecessary function parameters (patch 6). Further, it refactor the code by distributing the code into multiple files (patches 7-10). Last two patches (patches 11 and 12) deduplicates and remove unnecessary header inclusion in DAMON modules (reclaim and lru_sort). Note that this initially posted as a part of a feature implementation RFC patchset[1], but separated into this patchset as the amount of the change is not small compared to the feature implementation change itself. [1] https://lore.kernel.org/damon/20221019001317.104270-1-sj@kernel.org/ SeongJae Park (12): mm/damon/core: split out DAMOS-charged region skip logic into a new function mm/damon/core: split damos application logic into a new function mm/damon/core: split out scheme stat update logic into a new function mm/damon/core: split out scheme quota adjustment logic into a new function mm/damon/sysfs: use damon_addr_range for regions' start and end values mm/damon/sysfs: remove parameters of damon_sysfs_region_alloc() mm/damon/sysfs: move sysfs_lock to common module mm/damon/sysfs: move unsigned long range directory to common module mm/damon/sysfs: split out kdamond-independent schemes stats update logic into a new function mm/damon/sysfs: split out schemes directory implementation to separate file mm/damon/modules: deduplicate init steps for DAMON context setup mm/damon/{reclaim,lru_sort}: remove unnecessarily included headers mm/damon/Makefile | 6 +- mm/damon/core.c | 262 +++++---- mm/damon/lru_sort.c | 19 +- mm/damon/modules-common.c | 42 ++ mm/damon/modules-common.h | 3 + mm/damon/reclaim.c | 19 +- mm/damon/sysfs-common.c | 107 ++++ mm/damon/sysfs-common.h | 46 ++ mm/damon/sysfs-schemes.c | 1022 ++++++++++++++++++++++++++++++++ mm/damon/sysfs.c | 1152 +------------------------------------ 10 files changed, 1399 insertions(+), 1279 deletions(-) create mode 100644 mm/damon/modules-common.c create mode 100644 mm/damon/sysfs-common.c create mode 100644 mm/damon/sysfs-common.h create mode 100644 mm/damon/sysfs-schemes.c
Comments
Hi Andrew, On Wed, 26 Oct 2022 22:59:31 +0000 SeongJae Park <sj@kernel.org> wrote: > Changes from v1 > (https://lore.kernel.org/damon/20221024204919.18524-1-sj@kernel.org/): > - Add 10th patch, which splits schemes sysfs directory implementation As mentioned above, I mistakenly forgot adding the tenth patch of this series in the previous version. Could you please replace the series with this version? Please note that the 'synchronous damon_{reclaim,lru_sort} enable/disable' patchset[1] relies on this patchset, so this patchset should be applied before that. Sorry for your inconvenience. Also, please note that there are two minor DAMON documentation fixes[2] that not yet picked in mm-unstable. [1] https://lore.kernel.org/damon/20221025173650.90624-1-sj@kernel.org/ [2] https://lore.kernel.org/damon/20221024174619.15600-1-sj@kernel.org/ Thanks, SJ [...]