From patchwork Mon Oct 24 17:46:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 9964 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp614088wru; Mon, 24 Oct 2022 12:22:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Bzu4bpy2csbQYDO0YD12qsh9VAgY5yEIf0UvkrdSM0vU8tA0YERws26nTyLa+U/Gi9v9x X-Received: by 2002:aa7:c7d1:0:b0:461:2a82:497e with SMTP id o17-20020aa7c7d1000000b004612a82497emr20497637eds.267.1666639374409; Mon, 24 Oct 2022 12:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666639374; cv=none; d=google.com; s=arc-20160816; b=wc9QFAZ+h0tpYj+AU5GtYYr03saYxsWYS2WuueC2OPzlpG0t3+6Ai1aSiqnEQrLYxZ 3RuWi3BwLGZyBe4VjWurM7MyfMqlrYwQHwMDlguQXsjQHjENYZbd451rHC+b0K21yeVL RAC5DFlilIH5C/Cy9V19O4Mj3LNNibai5aN7X0SE+/oesoMImdk4yW56MBrgHxzjuxoj g1cZUPDpLQ0LdjzJAH6ZSkhfkBFMkuDSrAN47eTj9Vd+YHgHaijCprt+WbGhhphAzb8Q 0gIkaX2aILzR/SIKBmHO8ihB3vOaixSJFEwY6CrahTQMOSyYebIQkqDGo9B+y9EanzQ2 ovmQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SCKyNRY/90uoyc/wHqrrQ5eRjpGflxMtHjvnMUiUkTo=; b=eHJ4hg/iAmHKbHd5l7950PmyRY0Luu3Pvv3+AGi0KFXlfj5Je5F83s5YLlvj7RnEa6 c6D6uuOjhfBhJDL5j+pdA2o1PnnrcsjKVGMtMB2VTgqhR2BfmQ84FtkoBDUdFtJoFCWw m/vy7li+VJbtPepeY4N0r2BxTg8zE5Lj+Vhg48p53LjXyLFZmrZ78LYqgsoiSLC+fV9A S8tXQDoUbfvRgwRy6GstPHmnpvt4kHn+51R1AcuaUeeBmaeKzADrLcIu0r8ABo2sN7E8 Sv+q4bJz2tasO9ZhW1MXD7eYU159TK90gT+sMC7MRfVW9IlZKDl/EyEo+Ohme4GhorBd TBvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MLsERA71; 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 5-20020a508e45000000b00458cbb6b6easi609017edx.167.2022.10.24.12.22.30; Mon, 24 Oct 2022 12:22:54 -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=MLsERA71; 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 S233221AbiJXTNL (ORCPT + 99 others); Mon, 24 Oct 2022 15:13:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232994AbiJXTMb (ORCPT ); Mon, 24 Oct 2022 15:12:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2746918F0E5; Mon, 24 Oct 2022 10:50:56 -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 DC240B81142; Mon, 24 Oct 2022 17:46:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9C63C433B5; Mon, 24 Oct 2022 17:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666633587; bh=lV8oUGKGj7ZDIO/tmDfk1VdZPNBMnBKsnbsjH0pe+m4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MLsERA71D+0f1bI2hLFm02yZWXy7V4t4J5aBlCTtR7UBsixm3HQJ04xiUvdl+gWYW IR6ZBLnPq8d9XPQesG1OmXEH11O7o7Qi8vmRcuBUGVOExTPbnImg8uq0NYjIYW8SVC W1Lco5wuKDJg37THPKPkpDSBLdmcP+RyQoW0Fs2Q3rdyQwSdkeOhCAC3cN9Q2tT9Ls p4xuRqwCOdPp0jpN/i+04kihcUNFpWixl+ZB+apzgqC3Smw0s11nL6W4Z9Thki86f6 iFvzyNxQUxUv4vSy3cEK8xlyutYJfHWAN8qRHlzL6MkuXDyMsDrmR8K7kuvui/MBi0 TvZVSo1tvnB9A== 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, Vinicius Petrucci Subject: [PATCH 1/2] Docs/admin-guide/mm/damon/usage: describe the rules of sysfs region directories Date: Mon, 24 Oct 2022 17:46:18 +0000 Message-Id: <20221024174619.15600-2-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221024174619.15600-1-sj@kernel.org> References: <20221024174619.15600-1-sj@kernel.org> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747598049099699478?= X-GMAIL-MSGID: =?utf-8?q?1747598049099699478?= Target region directories of DAMON sysfs interface should contain no overlap and sorted by the address, but not clearly documented. Actually, a user had an issue[1] due to the poor documentation. Add clear description of it on the usage document. [1] https://lore.kernel.org/damon/CAEZ6=UNUcH2BvJj++OrT=XQLdkidU79wmCO=tantSOB36pPNTg@mail.gmail.com/ Reported-by: Vinicius Petrucci Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index b47b0cbbd491..89d9a4f75a29 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -235,6 +235,9 @@ In each region directory, you will find two files (``start`` and ``end``). You can set and get the start and end addresses of the initial monitoring target region by writing to and reading from the files, respectively. +Each region should not overlap with others. ``end`` of directory ``N`` should +be equal or smaller than ``start`` of directory ``N+1``. + contexts//schemes/ --------------------- From patchwork Mon Oct 24 17:46:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 9962 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp609994wru; Mon, 24 Oct 2022 12:12:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Z1/HcLkQogpAPKpUyZx+Bs09nyO6Gjwb4Gz/PJvpiRvRWD0P0J+fWaESwIEzuml7io43o X-Received: by 2002:a05:6a00:1689:b0:557:9105:cf85 with SMTP id k9-20020a056a00168900b005579105cf85mr35403621pfc.55.1666638753471; Mon, 24 Oct 2022 12:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666638753; cv=none; d=google.com; s=arc-20160816; b=EWy2Gvzc4eWlA1V6FB6vtEIu685SgySUmSj0JxZx3kFrUrSq6GWMf4s9PSozA69tbt fDOourGzutyRfNaA/N71QNxFVk/0qFntLvvNlbbsyDKMGXFNPCeJKxgKZ2qmMRT61M5M Pq0a3rYdM9uoGvGo2i4f0xd8ENLnfJ3xBdJ/YsKmbsx7o96H1wFU67Dms57wohDOAfQN hgmPnIqEVaC3gQYkgadKa0tC4tccVpPCPslt+KKydnB02Y76ABSaflXteQ3HKdFTcv8K 4KwrgEhidZOxU+O3o2YCa5VVI1BnCFKW+KFyIhilR8o9mUD+6Nr1O3knKqFxHKj/LPzf bD1g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mbltaZ2S/kFhgSCJBjHy41dRkxwgSl/HAjthPR7/Dek=; b=zf9AcT1KUu4xXb0nzzpCoa+9YFSu9I0tanKDv9yR5Mc/YsgELDbH4NlhZVdmhZFJPb b2Ss3GeKqEuWfjbMZw3ja4A6Q3C6ca2MsaiGqOydGw5MMxltqKDzOrJ7jujroenpnyaq KCwoneE+KwT5/lKvCzvM7jecKhp0vmujsvnZNPVIr3jI7+t0azXk1JXwXyLQ1vn4rjun NBOdR7sFLOjWCyr/PAjLGkj6bnES4B4SwouGyEGrG5T2zLP9rxO4KhA6/dB/pqKgEG/B DsPsGWqHx9+PY04KAi6L/0riXR6Iw4OxNkIqZA0gfMteNyUsSjh7f7P8Jdl9ysz+4KTm 7+TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LiREqdLe; 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 8-20020a17090a0f0800b001fb35ed6fdesi750480pjy.53.2022.10.24.12.12.20; Mon, 24 Oct 2022 12:12:33 -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=LiREqdLe; 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 S233050AbiJXTMC (ORCPT + 99 others); Mon, 24 Oct 2022 15:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232989AbiJXTLR (ORCPT ); Mon, 24 Oct 2022 15:11:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B9627C1F9; Mon, 24 Oct 2022 10:49:58 -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 AC231B815A9; Mon, 24 Oct 2022 17:46:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5AD8C43470; Mon, 24 Oct 2022 17:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666633588; bh=S8N3UZ7gBOYKRFRy1cc+++5T5Gtx3WFgOSwLDzkycq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LiREqdLetOPDFQRyZCCTehNe1MrreQJ2I9j4scg3jL62B3rujAYFOshLm+/VnZTI2 szACUAnHPSYoXH3/EsR7zCdEad7WkKV34SUiUrPsJcrJ5B/u0qSEtP5X/nGEibA96o AWrAr5QjEpPsX3gTpXliw6hQO7FlOZ3vu9Xu4/JQbHBQG+x9aXY4CmRO+J2bBEcd9P t+rye+9BUCg4kxUydcOjkmg3itRRcLkDsvwhBEmDox5C3q45BXlsUwpK/IUlol2cju vCTX3qbwdTwv5KuETRcBbj9PLuugT8DlexauESWlgTbfkQUdg6j9C6AMnP/M21wXOd ZS04O5Z3tuj2g== From: SeongJae Park To: Andrew Morton Cc: Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 2/2] Docs/admin-guide/mm/damon/usage: Fix wrong usage example of init_regions file Date: Mon, 24 Oct 2022 17:46:19 +0000 Message-Id: <20221024174619.15600-3-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221024174619.15600-1-sj@kernel.org> References: <20221024174619.15600-1-sj@kernel.org> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747597397445674712?= X-GMAIL-MSGID: =?utf-8?q?1747597397445674712?= DAMON debugfs interface assumes the users will write all inputs at once. However, redirecting a string of multiple lines sometimes end up writing line by line. Therefore, the example usage of 'init_regions' file, which writes input as a string of multiple lines can fail. Fix it to use a single line string instead. Also update the description of the usage to not assume users will write inputs in multiple lines. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index 89d9a4f75a29..c17e02e1e426 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -468,8 +468,9 @@ regions in case of physical memory monitoring. Therefore, users should set the monitoring target regions by themselves. In such cases, users can explicitly set the initial monitoring target regions -as they want, by writing proper values to the ``init_regions`` file. Each line -of the input should represent one region in below form.:: +as they want, by writing proper values to the ``init_regions`` file. The input +should be a sequence of three integers separated by white spaces that represent +one region in below form.:: @@ -484,9 +485,9 @@ ranges, ``20-40`` and ``50-100`` as that of pid 4242, which is the second one # cd /damon # cat target_ids 42 4242 - # echo "0 1 100 - 0 100 200 - 1 20 40 + # echo "0 1 100 \ + 0 100 200 \ + 1 20 40 \ 1 50 100" > init_regions Note that this sets the initial monitoring target regions only. In case of