Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3767215iob; Mon, 2 May 2022 05:19:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGx67X7GllakZHwCz99GisJdlnYWBKhMu0Sof2Rk5ATa11/Kas7unqMLSBfnmN4v7+8Nmc X-Received: by 2002:a63:2c53:0:b0:3c1:7367:3a0 with SMTP id s80-20020a632c53000000b003c1736703a0mr9483798pgs.516.1651493950425; Mon, 02 May 2022 05:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651493950; cv=none; d=google.com; s=arc-20160816; b=oP2/aGcug/JBc1xzPJWFr4Y/BH/s6gKTI2WQihK2QOCHq142aNIAWmn6PN6poQCEPL EXbanz9gzCcqhblG04T1WpKtI0HJcOVrj++3IYi2uy1tvx2ZWqNiKEQXvn+6ZLgDzRma kUfUtt9XEbHYboSygzBpZz5xXiyB4Zl37ZFw5/gBreQo5XaJE66mmeQgFSce5vyF68FV WZbEnXTvMM3xKcgAj0Dx1C95MMTFrQLSuyTZSrpzdUQCVm7+V4HOob5LYW2QR/87xjtj RFwBXYu1QFZf1FLM/AeNprlzA6W3d4jeNoX2fm4PWYCg78fcFrJx4cJ0XhiP8C8Wgmj8 cgJA== 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=8GeTnfRRXFLVpA7bKgOz1ca0eUlo1eqrTScYBBFYF+k=; b=d/JLTNSygzReN6O8lEkbuGItyssR6ORB8/jbqw/2l6GXnoSiER7udjqK6Cr7DL11hf UgqX1tiK4GxxJ4kRLZ5tS+kD93ew8dgweLLFwdx4RmadRHZcI+Juo7fwgkl/2Bm3N/08 A7ndmt+GI/qfgEKM+ZoZShk6mi7YVn8GyXBRQxYMJV/FEFaeDAYsh3CoTd3dBgJTYFR6 NmCLRflyvqHLAcx19ojWQB51OOEsiYMNjrUy9OFBX7JwnHYSny8LbyXKuG/SXZo65911 Z/O+ZGSlx9e6Sn6lC7EfcQiq/EArc1Yk9xDUY0blqCOpqpczZYWuy37FRvfZ/H1Q29Lg p3LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YTO3+Oe2; 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 w7-20020a63a747000000b003816043ef0dsi14469568pgo.258.2022.05.02.05.18.55; Mon, 02 May 2022 05:19:10 -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=YTO3+Oe2; 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 S1378464AbiD2QJg (ORCPT + 99 others); Fri, 29 Apr 2022 12:09:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378476AbiD2QJf (ORCPT ); Fri, 29 Apr 2022 12:09:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CB0AA27D9 for ; Fri, 29 Apr 2022 09:06:16 -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 9DAB3622B1 for ; Fri, 29 Apr 2022 16:06:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86FFEC385A4; Fri, 29 Apr 2022 16:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651248375; bh=kX9wsxrQF5lo48sgREIAhlQjmVHS6gEUXUOxmfhc2II=; h=From:To:Cc:Subject:Date:From; b=YTO3+Oe23DUpJby3UQFt6WQjolYvkbKIlw89mqrhDDdaCVv4nwL6QFV3oWJRed/8s 9EEDmRuXfUL172NyzyO1UdvIHu/6yktJrRYik3aUFb09BKWT0+8XypBwx6NZOILOEP OHf55HbePzWVybtM/jiQKMZQBUiAkM4/oXmKGnfFf0lzAfA7YNYkcbOEl6ZSxEayJ2 29GKZkA5/KccwgKjg26flvFuBN5+0ApmWsaOSCsIvRtbfZRIcjjNAP+ElbXLsJwggr eRWMjgXul/LAbJeREhtZlZobSG3YpcILygXUwak783ccmhyIDr0i9rFBVHF5Cr3+eb tnUywfvPBOpYw== From: sj@kernel.org To: akpm@linux-foundation.org Cc: linux-damon@amazon.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 00/14] mm/damon: Support online tuning Date: Fri, 29 Apr 2022 16:05:52 +0000 Message-Id: <20220429160606.127307-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.7 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: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park Effects of DAMON and DAMON-based Operation Schemes highly depends on the configurations. Wrong configurations could even result in unexpected efficiency degradations. For finding a best configuration, repeating incremental configuration changes and results measurements, in other words, online tuning, could be helpful. Nevertheless, DAMON kernel API supports only restrictive online tuning. Worse yet, the sysfs-based DAMON user interface doesn't support online tuning at all. DAMON_RECLAIM also doesn't support online tuning. This patchset makes the DAMON kernel API, DAMON sysfs interface, and DAMON_RECLAIM supports online tuning. Sequence of patches ------------------- First two patches enhance DAMON online tuning for kernel API users. Specifically, patch 1 let kernel API users to be able to do DAMON online tuning without a restriction, and patch 2 makes error handling easier. Following seven patches (patches 3-9) refactor code for better readability and easier reuse of code fragments that will be useful for online tuning support. Patch 10 introduces DAMON callback based user request handling structure for DAMON sysfs interface, and patch 11 enables DAMON online tuning via DAMON sysfs interface. Documentation patch (patch 12) for usage of it follows. Patch 13 enables online tuning of DAMON_RECLAIM and finally patch 14 documents the DAMON_RECLAIM online tuning usage. SeongJae Park (14): mm/damon/core: add a new callback for watermarks checks mm/damon/core: finish kdamond as soon as any callback returns an error mm/damon/vaddr: generalize damon_va_apply_three_regions() mm/damon/vaddr: move 'damon_set_regions()' to core mm/damon/vaddr: remove damon_va_apply_three_regions() mm/damon/sysfs: prohibit multiple physical address space monitoring targets mm/damon/sysfs: move targets setup code to a separated function mm/damon/sysfs: reuse damon_set_regions() for regions setting mm/damon/sysfs: use enum for 'state' input handling mm/damon/sysfs: update schemes stat in the kdamond context mm/damon/sysfs: support online inputs update Docs/{ABI,admin-guide}/damon: Update for 'state' sysfs file input keyword, 'commit' mm/damon/reclaim: support online inputs update Docs/admin-guide/mm/damon/reclaim: document 'commit_inputs' parameter .../ABI/testing/sysfs-kernel-mm-damon | 7 +- .../admin-guide/mm/damon/reclaim.rst | 11 + Documentation/admin-guide/mm/damon/usage.rst | 9 +- include/linux/damon.h | 9 + mm/damon/core.c | 89 +++- mm/damon/reclaim.c | 95 +++-- mm/damon/sysfs.c | 382 +++++++++++++++--- mm/damon/vaddr-test.h | 6 +- mm/damon/vaddr.c | 73 +--- 9 files changed, 500 insertions(+), 181 deletions(-) -- 2.25.1