From patchwork Wed Aug 2 21:32:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13338839 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 EDACDC04A94 for ; Wed, 2 Aug 2023 21:32:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26FD22801E7; Wed, 2 Aug 2023 17:32:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21FF62801AA; Wed, 2 Aug 2023 17:32:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E8D62801E7; Wed, 2 Aug 2023 17:32:31 -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 EECBB2801AA for ; Wed, 2 Aug 2023 17:32:30 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BD24DC06B2 for ; Wed, 2 Aug 2023 21:32:30 +0000 (UTC) X-FDA: 81080463660.23.FF73E60 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 07D22180021 for ; Wed, 2 Aug 2023 21:32:28 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SMs6Q6ZL; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.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=1691011949; 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=BUS8C8+veuNqCIqBBldX2bSLOFmSkfa8hIKFzHgPr3o=; b=3wYDlyGOIzq5rLLCcxVH3oQhkB4nlHYIXFq8AwjizQhNbW1Ls9htSAFjIm4RmMPSGRXIL5 kjeEXe/DzuD94k1HrvJOwkrjxjkdalu7T/bIkpYJVfCWRx+xDB3aUr2v4X6urGZhr8/Jxd GTLVeQej3yPZMxaGfZ7LsITpseN/IRc= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SMs6Q6ZL; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.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=1691011949; a=rsa-sha256; cv=none; b=kMLZVcse8+R3EF3XY4EM+0hiAtFaWGObOMURoG9JZD1Zsigi+AaEm7kVq3nmu9wk/zdioj 1lLQT1m+UMyuU4VlMCxhsEFHL92TuqEZX9jGU4JgY65YqHOWc+GgXIYyJtwTpLWu8b/hX3 FEOPXJOW1lN8fjM/RX4hFDK9YQOAaMo= 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 0F09C61B32; Wed, 2 Aug 2023 21:32:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B19D4C433C8; Wed, 2 Aug 2023 21:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691011947; bh=/ftIGNZIuawFka3qmkPFpRU27GdmRegiQSCJekF9zMg=; h=From:To:Cc:Subject:Date:From; b=SMs6Q6ZLjcKQ70/cbYrqn+cDVQOadSajdkI3plnyvICz2+rhNp9AToICIqXEdaQqK 78gtgnaAfsbCdredfTwNdYSWzOrOLcVIxF2mZkwysEyL9WwatL6omtiFREvOjpz1Wm MT+M+JbOT2ScvuHnKGualv/DlISwYU1ziCMxwGHoY91NAvrHMUITc2GnKzIePTGc7b p9Rrh6GXcDrHtJu4EEDtxRPz38MtvltU9qlsBsQSglAIFVgBYOhp1WM+d4XJk64DTs qepBo+1WuZ2C5aXpPXL00t0CeR6r/C6meqWHbggyS81NMgMHq2G7g+AeyB0Vv7TIPq wgXAXWG6hPWkw== 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-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 0/5] mm/damon/sysfs-schemes: implement DAMOS tried total bytes file Date: Wed, 2 Aug 2023 21:32:16 +0000 Message-Id: <20230802213222.109841-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 07D22180021 X-Stat-Signature: axyhup5onrqjrq5x14hje3atdbc467jt X-HE-Tag: 1691011948-65124 X-HE-Meta: U2FsdGVkX188fRMb9TSIXm1n0Umdi4P9pANhnBY8Ng39YPNbPgYRJpDcaW3mL94RS/wRaUF26bfEUArhl284ppE4ILxo6Dcxz4Dz3P1atX7MF168pUm3a213Em0c+fhH6rAOtvLPpnXdR/9zlNcMNrHDWf0dAo3kjXp8PUmd8aNNOdBuBkfpaYrfcB+uizdkKWMeKPcwwyeSinCP/vCS944Nv2zpqissm+3KRIVuvRotq/Cn1Eu8rf4R7UJB1IPQuvB7bArAV0loAOnmFVjqcg/U66SX3af0+nXKRqkzBjIIXsH1O2+ssEw3EngPWQ7y9vNJAaoN90IHZ6U8xz85p3pBmsyWSDDE0Om7mpW59/yG58aLPsOC3b8Gb2ZKsjilAaFKkoKknpBNsjpToUJbKcTF0mB36RQyCt9sL7Wh8mIV5LhCCkRLtaP9Oip5pqQeOMCJOEhZxRgVnJ69gssP23fJJlxsPy8M1M9fRAejd1FHlyFiCjCvyC5q6pXCA4ptG01Xcnc4Ww4n8WGVcfy6ZFMAvFuHO4aPExNEGHV4wt3DprcCCBry+mblq70QsXRZ1605OwaU9zMwnkBPqJ2K257Gen1F5bYt6thwqPAoJylK97E35bU6T1uX+XpnBM1NXy7Js7cOLznXQBpUl2KOY5ZrlQFgRNIEII/LrL6HeqimAHyfGvGY8a1D7tkpv0iTZYNaT5B9kBBfaYTdpqyAvG5JY76+KmpCm9a9sRck+G2VpzAfPQQZ7wDWuUKb7UJYwaRNaDlaLgTnyH3Va7hH2konlO4S0W6ah2rOkEr3kRS+jeUPsmoffOYTBw8px3Yqhwu8tgsjF6WV1Ls+w2222DBpPDpWwTJH+b5oUzCj21eGo5eSgnKcxZ8kqCaTo0JIKilSITQP8m7NstrgrbinbzwUyRzc6wAh/C4k2hVn7e5JabDzvQ88QoFscX/V8UfxPztw4fnLxUnkXmwJvCt L+5BU8Tk 1uJio7lAOdy2rWJu8JItOIzM5Lx3NCyWIwBVO7ZJAwBjE/bUJoGu1ORQMhUnY9n1bj+osymMuBEIvhgnx8Ht4mG7xu78XrPjqI0BmYvxL/vQu848diVHNOO5ABB5TgZPPJO5BEah2hfc38Ibsd/ZwfdKbKv2ScpzRMLPFDSGk7WBKV55tbBVhzHKcwI6JZXt/8Gx8tSEkTZxTl75z7srb0emp9S69mvabOk4nRTBpwBqucobm7/IccTnCHewtzz98icfq5ZBcWdontEj9CbCRBLfl1zrg+xIAUukao1Uz1U/Td1SfY36lKegWmHws1JcEeglVQtif77fBSka18zwjCYzYhg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Changes from RFC[1] - Rebase on latest mm-unstable - Add base-commit ---- 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. [1] https://lore.kernel.org/damon/20230728201817.70602-1-sj@kernel.org/ 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(-) base-commit: a57d8094e1946e9dbdba0dddf0e10f9f4dceae0d