From patchwork Thu Feb 9 19:20:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13134995 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 8BDDBC64EC4 for ; Thu, 9 Feb 2023 19:20:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39E356B0078; Thu, 9 Feb 2023 14:20:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 34E686B007B; Thu, 9 Feb 2023 14:20:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 105DB6B007E; Thu, 9 Feb 2023 14:20:19 -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 E4DAB6B007B for ; Thu, 9 Feb 2023 14:20:19 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 81BE2C0FB0 for ; Thu, 9 Feb 2023 19:20:19 +0000 (UTC) X-FDA: 80448719358.16.81215A6 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id D803A40009 for ; Thu, 9 Feb 2023 19:20:17 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YNwNncax; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.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=1675970417; 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=v/ZbcDDyGp1GCgR/7hYyVbx4tuFen8J1znyyD4wVL8g=; b=5i8Db7CYeEbIeFnbSdSJS8m/kixJDyen3QYWfkDef+cG8lWr5clXUTJ7fmu4KxUtHY91LQ nv1NocBZLxyAwtouJQvyvrOE0HOrA788jdG53E0nVQ50B8F31CMqYzHGXLYwBnKJbUkGWL ZBz993dIjq3ufDH+PcckVBge65eHZ24= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YNwNncax; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.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=1675970417; a=rsa-sha256; cv=none; b=n4d6VpWJljs4plOPl7ABmv+Ltsoe5pASg22v6qLJY/9hQ144GTCUpRYB63VHtBevPBJLLc 2WA4ffDCzb3zmmOraG21XOFKnxCkKzOEDP6zry3a4ynON2OLNDwugWVw85TPLX86K9j7je WSMFkThyb1VA8fGd5jgT5opEx5wbYKU= 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 dfw.source.kernel.org (Postfix) with ESMTPS id 0F0C461BB3; Thu, 9 Feb 2023 19:20:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C11FC433A1; Thu, 9 Feb 2023 19:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675970416; bh=YKnuEvRI6qfPAJO2dUUkfnH+bQPuZPD2yzEq+Lx0+z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YNwNncaxqJtNLK1jiU8L7oyV++uilfm1Jne4U3kLLB385NSqtdiYkJ9f+YuB4rOdK r8irMblAq+as8w9prFXzUhRqT+sN+Q8MUOX4T2Cct1ET47M1Wj8YGIxL9yvdIt+GQX tJrmah8kxg9jC8ep0z3I06JWRIl1Y652uHmKIWsjWEVZ6cbkf3A7U5L3N//AQDz4Xf FbHuAgyGYxo05IvYJnqmOh72HjluzjCiL/YsfqTdGsa9yqVhZU0WXMzbM5FtgWLRj/ 7SfnQPPzftZC0eIW4SR3pZgk8QhRJV6q5mTmj6nX2NU2shlUhkKAdA36QETg86+6oi wWowqMT+cl1zw== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] mm/damon/dbgfs: print DAMON debugfs interface deprecation message Date: Thu, 9 Feb 2023 19:20:09 +0000 Message-Id: <20230209192009.7885-4-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230209192009.7885-1-sj@kernel.org> References: <20230209192009.7885-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: D803A40009 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: gagma4hceom8r3cu31cxksmsyngjhts6 X-HE-Tag: 1675970417-943846 X-HE-Meta: U2FsdGVkX19ixdKU/PRpsvyuLcdaLIozRK4yyKKkkH57UnsS9MJVSx/DyKpT+DCf19Y/5KrcdBt6AHjXLhahk3XBLTuCQNVizuU2LOYLLqg8gfwXCBapkZZd3f+MQhK5PWvFO9EduswQXeWwWqsWH8ECSSvD7Qvm6fCMyWIIvn6TWR43/95NjGpSPs+47s6fDjGpMlikUxBIzWFb4VG6Qf6EZYSCMvD5AI4aGbNYCsb1Zcq1EW6Qm+Kw4O/g+sq1WP28z8OMdRwwThyPs2nJGdRDvpdI91O9oD6KAQMEBNkR3XLe2zGuttcdav1RMg3I9o+JS3GuyYj7uV+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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 Signed-off-by: SeongJae Park --- mm/damon/dbgfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index b3f454a5c682..e551a20b35e3 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -20,6 +20,11 @@ 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 the sysfs interface (DAMON_SYSFS). If you depend on this and cannot move, 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 +716,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 +1046,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, };