From patchwork Fri Jul 28 20:18:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13332633 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 2A601C001E0 for ; Fri, 28 Jul 2023 20:18:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 579636B0071; Fri, 28 Jul 2023 16:18:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 535CF6B0075; Fri, 28 Jul 2023 16:18:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 417B18D0001; Fri, 28 Jul 2023 16:18:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3626F6B0071 for ; Fri, 28 Jul 2023 16:18:30 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EA4E314070D for ; Fri, 28 Jul 2023 20:18:29 +0000 (UTC) X-FDA: 81062133138.05.2A54984 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id 4BBFB1A000A for ; Fri, 28 Jul 2023 20:18:27 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KnJ8rmUN; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690575507; 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:references:dkim-signature; bh=s8AnerUCKed/GNILhcxMGxdfJhJLBAVNE3RJ37JYKxs=; b=wWDfr1/jstzP7dPFgIyaJNQ7oEkbnUj5pLVc8016ERZWQ2LQNGVDqT+OoqfOJeKa7PGhyF OSN1Ppwp2mAmzpfpO6YmfJXcudHTwUO4fFhaFHipHWFqrEEn+jvI5gF4lswFoKkiqK26cA QGkvdOtjpRe9NVU1eghcgQVd085ekTI= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KnJ8rmUN; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690575507; a=rsa-sha256; cv=none; b=baGoV2Eu6zCsO4OdQFu46C+TeC3eGAZtw+PaKF2JET9aL9MDBmcL683YrQbC7zpWgkshxR RkgtJlhxfb1UtuhtCWCR87VWnRS5ccy4tgQsjvpHmVYg5ZeenoyqHRi3VNcdMN/hZyBo+N htu+YPTs3YBx5vQWaaRU5bcckFx6ldI= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 35188621F7; Fri, 28 Jul 2023 20:18:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF109C433C7; Fri, 28 Jul 2023 20:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690575505; bh=UVBU1bmCqbHYSrEwhTG13CafVyks5FJvwzFQOQt5stM=; h=From:To:Cc:Subject:Date:From; b=KnJ8rmUNVoGFKcCNUKRwK89H2KXXAVLsepsFVQRa8iq4OoKzKnituu+rU0m/e7wJx uAVd0NxyObI7bWeGNqmuwUCWqQFn0yUKUXbZR0gT9GqzYGwzjp6ETymgfGp/0bvNCX nlqZUBhTP+tOhmS1RLPv11wBvEuvRUwwxbTtt74EoFFwojxtEu0HH614lcs2N1Lo67 eQBhLQdYv/PDCfocQBxT2XJfJ4o4fRRjONXROUjT0VkNfgFZ+UrEh57tkK4bwQFjxp NNkpvhVBApP7A7T6MVluboFkz5FCrfcQBYYnIdKNcZCC/S809axL3QyaJ6pjL+oXJq 6pqz5f6ogfIlQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/5] mm/damon/sysfs: add a file for efficiently get total size of DAMOS tried regions Date: Fri, 28 Jul 2023 20:18:12 +0000 Message-Id: <20230728201817.70602-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 4BBFB1A000A X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 7jng4m6inj4q5ot3yz43wiisyd6u3e4u X-HE-Tag: 1690575507-206303 X-HE-Meta: U2FsdGVkX19sknLBnyA3a1lF85Z5DnJS1qlIRs6Ye9FqU39yPyv/3FW3l19Ce4FknJZ39XsgB7gXT/my6YnILBwds0cHU8/SATNLHcdXnP45ouY9I23GE1uY9+bjMBaVICnycJR8MmnOebbYlx84J+cnc1HugJhq3DQtOCOLPdAMegx3HKzgTphyqtENI/rBxrlcD7IWbNRgEvDs87qtbvw7yOcKP8al4Qlh5jCdjw6hZm2coAEYj5QQFjgEgKk5h3GG8qWHkE9gHX+x1qVu63PpyDLS549UKpwLzE6Y+Drrh3zVc8l0cW3qW1hWZJGp83rarIjvnGmwzgEdeIQwRR3Fu4mbFob9Qt88AsVfobJlPv8UUh4uIV3Wto7seKrnAjVJe+v7gUwemVIeOlPGb18blYTFOyz3IFdLNDgJ11Yq3XzXBzPlOAyKW4FcYgaL0PBy+DMoHq7IDhqi/eFjTdNVsommJxURCmTdOgfBR3k/PtFjz54AwPV5ilPU2rKjXnej8d1/rhq8TJqi5eak8WzmnmMeMNNIgT9NmSVHwg8cp586GymBosA4SknQDs8iEnqVWv+Y7UpnjS4U6qYtPclHY34+qj5B33UraMFiwUHvz6+jyyfzPgZc20Cg7aJu+5xqakTEDjkHollm0CiG8gbziuEGvIGYhgWpNbEs1aHopW9QXo0cM0sLmjcq3m4aeuRK60OmHrEtGk7WAibH8voy0EUHwaxbbaqmLJC40srtostLRwF1rzBIsxCGhcDFIIDIRy0pptEdtfKmCYyqNIMTa32k3XHx/2F3NhnYuJTMlgaUBtSDi1axj4PaWYYoIy7qe6R2s1kD7/8T6MJO6bJnlkdn62XsSbhE3LAg8cGxyH2toC+W8pYqNDzXHQnmkcPdCWDhjXcK4r4UHpfpsb65hPk+HV6iIoCToCC8JDJbZS2IHxAK64yo+j4cMTR1NMeKB1xNlVtxvWiVbcY 1D7sh+p8 lRLKPSL9v50IWjF+Brp2MX9JuHD9sYLePEt3skFwb8VVg9mvYADI2oYU0mJz4gXXTNKZTX4BDweZpferW7yyaeETsSAEmLNXM4RvIS8cqrJXFDRMHPtJAi51ioUGoRjX6qx7JNQYKB4WND2suhxUNBTgVhxg7GVjJGhHX8SHUJS7XUpV/KZzzu6vdM2h4femy6lwGDZjo0qyvus13SkkyYgA+NxcepWOXZpcoS+eorcbjulGU5TbVS0748zGVqx14qfirVE42Vf1ToqmX/8wSv9j8YwKY96ZMqsr+bI+JUZ9S4aK3lO0pQfxQBp1MwszVqTowCG9M+eu4LE9yO/XXOtMK/g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The tried_regions directory of DAMON sysfs interface is useful for retrieving monitoring results snapshot or DAMOS debugging. However, for common use case that need to monitor only the total size of the scheme tried regions (e.g., monitoring working set size), the kernel overhead for directory construction and user overhead for reading the content could be high if the number of monitoring region is not small. This patchset implements DAMON sysfs files for efficient support of the use case. The first patch implements the sysfs file to reduce the user space overhead, and the second patch implements a command for reducing the kernel space overhead. The third patch adds a selftest for the new file, and following two patches update documents. SeongJae Park (5): mm/damon/sysfs-schemes: implement DAMOS tried total bytes file mm/damon/sysfs: implement a command for updating only schemes tried total bytes selftests/damon/sysfs: test tried_regions/total_bytes file Docs/ABI/damon: update for tried_regions/total_bytes Docs/admin-guide/mm/damon/usage: update for tried_regions/total_bytes .../ABI/testing/sysfs-kernel-mm-damon | 13 +++++- Documentation/admin-guide/mm/damon/usage.rst | 42 ++++++++++++------- mm/damon/sysfs-common.h | 2 +- mm/damon/sysfs-schemes.c | 24 ++++++++++- mm/damon/sysfs.c | 26 +++++++++--- tools/testing/selftests/damon/sysfs.sh | 1 + 6 files changed, 83 insertions(+), 25 deletions(-)