From patchwork Fri Feb 10 04:48:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13135371 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 D0A30C636D4 for ; Fri, 10 Feb 2023 04:48:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 689546B00F1; Thu, 9 Feb 2023 23:48:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C3336B00F3; Thu, 9 Feb 2023 23:48:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EEE56B00F4; Thu, 9 Feb 2023 23:48:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 21CFD6B00F1 for ; Thu, 9 Feb 2023 23:48:52 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 56ABD1A127B for ; Fri, 10 Feb 2023 04:48:51 +0000 (UTC) X-FDA: 80450152062.09.C9579E6 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf08.hostedemail.com (Postfix) with ESMTP id 741B1160002 for ; Fri, 10 Feb 2023 04:48:49 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="osoBk/p5"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 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=1676004529; 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=PwwzsY/51csXNOOx4GzPgkxCySUu+mfViXO0wUCKyK0=; b=lsWa7yPsQ7VDlAgiZtGgnX2CawdR2QzRU0/LU143tmaWjPyQNP9GHZE7UJy1c95UYdwhFU Z0/Npq5yKgPo4yJCC5q7n6Eant0l7PHL5JJGYtdeWRPDvH3SdnA7JbpcyJCNOEtKEKKXcA Jfj3WxLdRKG+JN+uzBghKvg1E8SWVEo= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="osoBk/p5"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676004529; a=rsa-sha256; cv=none; b=NYiiVNK952Ib02C3+ecbNYaDAZpV2yNQ+VDYagMobZCa+ceclJy/FL5q0Nx4QVBe4nE8yS 8hrB7UIJOWjWBitHB2W65nNtUjYc8aBjSYgQOEZphTTylTvBb2WlahWm03mvz+46aERKx0 puvuhqosc6GsQXzyVYIAAxfSICUv25k= 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 32468B822F0; Fri, 10 Feb 2023 04:48:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 786BEC433A1; Fri, 10 Feb 2023 04:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676004527; bh=GHjXtEXAs/907P6A+4MUMIxpIxGv/uFwCu4RPtNwvv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=osoBk/p5fti365hKvBevvfZpAfFjjBuRvv90yf+hbzGZGnr44zGzfMzevZBF1G5W+ 0cZp6p4OTOl29Rq8NHb+4yhgbo8Dduwr/YXYSUYSaJfAIuLSRgmDs6O0hUYP3PvxqA lnnI3TiTC1gQpj6NnQM4FpQwlGgEiexU4MJHePwMijo+PLyb1i04CdpxtINd6AHV+t iDshdB/9WNtDhnYuAiB7CBh1adRpmRDEgHAOFRS5ChWfCZGD0kOJAV2osSEbuacspk /OtFQ0ujR1NeVbbBb8i0JhTrOBz2jn7zCDH/hnK7mivL/KBsapzZBsQf3lecRBPt1G cR/odiYu7eU/g== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH v2 3/3] mm/damon/dbgfs: print DAMON debugfs interface deprecation message Date: Fri, 10 Feb 2023 04:48:38 +0000 Message-Id: <20230210044838.63723-4-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230210044838.63723-1-sj@kernel.org> References: <20230210044838.63723-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 741B1160002 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: nfxu4mq93kiww1m3hotmirxx4gbbf8ya X-HE-Tag: 1676004529-128156 X-HE-Meta: U2FsdGVkX18sU7IdCQBFu6/uJ06pYHMWzCT4TgMP0Th7gWY/OTTEdCIWYPmklWYEpaBzCo9iQ6KmTg8AbJxXTNKchGOWDDJst7nhA8W0Gi1TuCvfuTW4glKoyslzd842GTm7dz0mn+2c9t0IhSeIU+z6V4pr9JRPfnAmZJUAs0MrHWe+QqLiv7hhCERa0UEnOP4VGzFj4eAafDYmRXRp8QDdkxFjXzq/slx3BnnS1xCi340hjelrFUlvs4tTNJzyLRQr5UgA7s5X6meZTKeBSb+T0rI3VPMu/22niJm8ain1SziQEI8t6mjpssqpsrq4na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aAWXznwIHc4PScVPUp1rGK5CtZXScf3mRVlNwBtxg056Y4MlN39rV9V/AV68LbHqmMrN5rxUDsEnwsx+7451fP3R2hRATpcfA6+HpRj+VtI40EgTdO9a4+k136qvs8bjdGlQjg== 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: DAMON debugfs interface has announced to be deprecated after >v5.15 LTS kernel is released. And, v6.1.y has announced to be an LTS[1]. Though the announcement was there for a while, some people might not noticed that so far. Also, some users could depend on it and have problems at movng to the alternative (DAMON sysfs interface). For such cases, warn DAMON debugfs interface deprecation with contacts to ask helps when any DAMON debugfs interface file is opened. [1] https://git.kernel.org/pub/scm/docs/kernel/website.git/commit/?id=332e9121320bc7461b2d3a79665caf153e51732c Link: https://lkml.kernel.org/r/20230209192009.7885-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton --- mm/damon/dbgfs.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index b3f454a5c682..124f0f8c97b7 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -20,6 +20,14 @@ static int dbgfs_nr_ctxs; static struct dentry **dbgfs_dirs; static DEFINE_MUTEX(damon_dbgfs_lock); +static void damon_dbgfs_warn_deprecation(void) +{ + pr_warn_once("DAMON debugfs interface is deprecated, " + "so users should move to DAMON_SYSFS. If you cannot, " + "please report your usecase to damon@lists.linux.dev and " + "linux-mm@kvack.org.\n"); +} + /* * Returns non-empty string on success, negative error code otherwise. */ @@ -711,6 +719,8 @@ static ssize_t dbgfs_kdamond_pid_read(struct file *file, static int damon_dbgfs_open(struct inode *inode, struct file *file) { + damon_dbgfs_warn_deprecation(); + file->private_data = inode->i_private; return nonseekable_open(inode, file); @@ -1039,15 +1049,24 @@ static ssize_t dbgfs_monitor_on_write(struct file *file, return ret; } +static int damon_dbgfs_static_file_open(struct inode *inode, struct file *file) +{ + damon_dbgfs_warn_deprecation(); + return nonseekable_open(inode, file); +} + static const struct file_operations mk_contexts_fops = { + .open = damon_dbgfs_static_file_open, .write = dbgfs_mk_context_write, }; static const struct file_operations rm_contexts_fops = { + .open = damon_dbgfs_static_file_open, .write = dbgfs_rm_context_write, }; static const struct file_operations monitor_on_fops = { + .open = damon_dbgfs_static_file_open, .read = dbgfs_monitor_on_read, .write = dbgfs_monitor_on_write, };