From patchwork Mon Feb 19 19:44:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13563017 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6084AC48BC3 for ; Mon, 19 Feb 2024 19:45:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 27AD16B0099; Mon, 19 Feb 2024 14:44:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 22A516B009A; Mon, 19 Feb 2024 14:44:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 053BB6B009B; Mon, 19 Feb 2024 14:44:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id EC2D06B0099 for ; Mon, 19 Feb 2024 14:44:49 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id CEFD1A03FA for ; Mon, 19 Feb 2024 19:44:49 +0000 (UTC) X-FDA: 81809581098.27.5805754 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 4212840011 for ; Mon, 19 Feb 2024 19:44:48 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=rN+wAd4r; spf=pass (imf12.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708371888; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AH50pB00vL1ssxOtJIF22yMyJ0UUCrycixUityu75ko=; b=YPVLIvjSejUSfq03Xe6a4vg7ypeCAHMnv4cEaFj7ckSYApRMbFUbGxhdcYRKCITOyu1o34 jJnRxPPL1qZ2bsENyH+x/jtKxa5PQeSkp/7EMlCtOH7bFdt+UaqkzRgiK+6IcVRpqcKVzF uEWM/NKB5MTiFfCTK8l6jEa2uxfk6WE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708371888; a=rsa-sha256; cv=none; b=cNFnTNsVp3uakAenvI+Hem1gMyOiyFJJSiOkaStnOE6mPLPtj8NtyssdupTWbjGGOP4IVi V7JByNgkSf6v31pG3PPMpNQjVZWgtLIjrrIlNT5GzPraJLvmyGPNIeWDXzWCZwEnRdClXa UALs7tK96Gx00JFoSwr70bmpzL46y00= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=rN+wAd4r; spf=pass (imf12.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EE03860F76; Mon, 19 Feb 2024 19:44:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A133C43399; Mon, 19 Feb 2024 19:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708371887; bh=dE+jqLZYW9QB5NiFklbDnZHaYSFDuOnT6wibaYvQ7fQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rN+wAd4rUpHbmoSCSt+/pVijeH1M2J+z3ioq9IiqpMA7SQFSRjct47t4BrxCbYLzm g+NTWKrJdapNMH3m9ClPNCicsC8FXavIYUJ+PTZpM3XOUKOjufVIRPa+f6MVCL8FKx mnvvP4UR8ztDA3EZAIC758uAZSZn6xL0EAMZAUfFtGXapQSihyvtpmetzNaC/Kghcx UNloo8Ow4xzXJiJmt/6CbhAsy17pIVqzgkj0XUIKlijM/hF+Tkk2+/az2jLdwG67tG ZGw7C9Tdx2lPuF00Kfz/OfYDrG79xQFFIGBkn/Tpc1eB2mhLP1THJX3eXJLAQ/kPEA eQzcGIUVQS9rA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/20] Docs/mm/damon/design: document quota goal self-tuning Date: Mon, 19 Feb 2024 11:44:26 -0800 Message-Id: <20240219194431.159606-16-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219194431.159606-1-sj@kernel.org> References: <20240219194431.159606-1-sj@kernel.org> MIME-Version: 1.0 X-Stat-Signature: 6ypqxhy8nqy99dq1n9tnqdnubyz95zji X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 4212840011 X-Rspam-User: X-HE-Tag: 1708371888-942049 X-HE-Meta: U2FsdGVkX1/9e8qdwHCgGePRh+j2cZchUSVIsl8jkYeb0KCNg/l0S3Oh9/bHTSms9dvI//g8mk08CMRTSGXmgu+lImqnpHIMNDGldHgIgYhWlH2Ma82utXEa/G79Opfm6jHR7eOGpxJJ76krN7yNlupqV9Aqi6CpXBraxzdt7H8U6n90vxvc5t+pXk1V3z+KQFe2k5Z58gTQ4gsimxvDNufko6BCfhZ15TSf9BT47hwvmisl0PUnAmSBXZvIKbemFX1oDI4KXQZoakd0PAxh4W/n6+QlPYZDo2yljr6if6rCqlMjGZ9hgcN1AB35WxQNp8S7wGwKnoSbmXsNKRdgucOhLyg/XcKrQoK8eTVa1rR7aQ1RKTCUrlucOonSQlLsYT2MW1LCp2ub0d69IBNaDYR3oae64AMUqKPAvd8nnKB8hA6712Hzbo5vIbP9LkwffFkTaijYwLd4Wd1JUVGDdIPZ4fjz3hJLsZOPJQVDw/glK2v0HC4GaSkXJmOI518heqsoYF8XMSqvBGUTi3JzHsOJNEj9bIMAGEZ2DpUJNiBWEsUGBw/6xZZ2fg5dIRtL7S+oqSCX5qqwKl6vDW0jz+YhzePJo98hiWWl8NdqyUIvrfxIlpXfNBIEAgHiK85WRoLmEnG4IKpHpiV6d6W1Y3yE6Yj0rEHFMUNktOvzsNMplWCdAvq02bpqrV2mpu3c+UflfAezWlvdiWFaqBnWqEa7wfT2nuKDF66KhXVnZoiuESIbmscv1yWPvyivkPtcu3l+rSt0RLolYw3RZ4TG83yDJt4NzQOU82y01dDn1uhqNpkK3H/FGIMwjqxzOlTcezzvum1fWtuw64kn4QlIjPppk+GJfCL17/RyKVnJ1OrBedaRoVZjEeP7oP3TGqDRn+0Yi8PKKTLk/QxVTRVBxLogozthLb2/YXWOIVJDFJk5Wt+fbYuqyoNlpMDTL5KETRDUEG3sVPjDpAPOF8N w3I2H5X2 CXhRh1bhx98DOoMWd9gI7L4x5qfIhqJn40rEX6LaDo+UIvklUjMfgf/eOyCpHUFNHHzo6+zxWdAh1JTDF5JzR9LruZiJyoVlU7Q5+Hybtb0bR99/2X9FY2DZZuKk25t3ZuMOM9C7m+mOIxIapVuOYZf2WY7bqdpYnGtEIUrIOqbtIja8PAEX1QQx/XZdWy2LpIoHr/gvIPZ1nuspwpQYrpC9IvPiSliZwF3TOlw5s/MAUK43vGEKgpDFqKw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000061, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: update DAMON design doc to explain the quota goal self-tuning, which can be used by setting the goal's metric to metrics that kernel can self-retrieve. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 2bd0c203dcfb..8c89d26f0baa 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -398,12 +398,28 @@ Aim-oriented Feedback-driven Auto-tuning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Automatic feedback-driven quota tuning. Instead of setting the absolute quota -value, users can repeatedly provide numbers representing how much of their goal -for the scheme is achieved as feedback. DAMOS then automatically tunes the +value, users can specify the metric of their interest, and what target value +they want the metric value to be. DAMOS then automatically tunes the aggressiveness (the quota) of the corresponding scheme. For example, if DAMOS is under achieving the goal, DAMOS automatically increases the quota. If DAMOS is over achieving the goal, it decreases the quota. +The goal can be specified with three parameters, namely ``target_metric``, +``target_value``, and ``current_value``. The auto-tuning mechanism tries to +make ``current_value`` of ``target_metric`` be same to ``target_value``. +Currently, two ``target_metric`` are provided. + +- ``user_input``: User-provided value. Users could use any metric that they + has interest in for the value. Use space main workload's latency or + throughput, system metrics like free memory ratio or memory pressure stall + time (PSI) could be examples. Note that users should explicitly set + ``current_value`` on their own in this case. In other words, users should + repeatedly provide the feedback. +- ``some_mem_psi_us``: System-wide ``some`` memory pressure stall information + in microseconds that measured from last quota reset to next quota reset. + DAMOS does the measurement on its own, so only ``target_value`` need to be + set by users at the initial time. In other words, DAMOS does self-feedback. + .. _damon_design_damos_watermarks: