From mboxrd@z Thu Jan 1 00:00:00 1970 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 6537AC4332F for ; Wed, 23 Feb 2022 19:03:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF99E8D0049; Wed, 23 Feb 2022 14:03:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA9A18D0011; Wed, 23 Feb 2022 14:03:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4AF18D0049; Wed, 23 Feb 2022 14:03:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0019.hostedemail.com [216.40.44.19]) by kanga.kvack.org (Postfix) with ESMTP id 79E478D0011 for ; Wed, 23 Feb 2022 14:03:43 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 141EE8249980 for ; Wed, 23 Feb 2022 19:03:43 +0000 (UTC) X-FDA: 79174968726.18.BF0C9F0 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf31.hostedemail.com (Postfix) with ESMTP id 60C0220018 for ; Wed, 23 Feb 2022 19:03:42 +0000 (UTC) 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 6B2D261687; Wed, 23 Feb 2022 19:03:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4438C340E7; Wed, 23 Feb 2022 19:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645643020; bh=Lo+rvEWRJNqoSEUkIFmf7EbqThnTEYWUSXqpONBnfkc=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=P2J6UGlEdQEAMWrh38f2++8ZXhJUUBsbLZ3ieMVLOE76r/jzNrMgZoMcSsWh++IG8 Sfdbnqc3BJkmntD5WZkncAV9jtgkuKsvb0suXaRknEEBCDVDRgLO79wLNjJ8X1DMxe Pw8W2pPar7UBsCnprKZIfkZVOrhrEOe28H2FXSOKuiTRrBMqxE2phWtVMzV/tKWcR2 V3+saGq3v9Kd4f8H2sdWQF8umx8vOB7wRIrhBz0P1mN7jLMlLn8PoBqbMpMFher9s6 7XqKSBYU6C4k9lG/ogBe6/XOTtBBwiPlpnwMcfIC/RHyXkyYRYgpw/E6mizs414R9T REiFpSxFgQJow== From: SeongJae Park To: Greg KH Cc: SeongJae Park , akpm@linux-foundation.org, corbet@lwn.net, skhan@linuxfoundation.org, rientjes@google.com, xhao@linux.alibaba.com, linux-damon@amazon.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/12] mm/damon: Implement a minimal stub for sysfs-based DAMON interface Date: Wed, 23 Feb 2022 19:03:37 +0000 Message-Id: <20220223190337.1705-1-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=P2J6UGlE; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf31.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 60C0220018 X-Stat-Signature: 6sfabjbroagzsc95m9bobs8q7yia7n1r X-HE-Tag: 1645643022-365112 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: On Wed, 23 Feb 2022 19:33:31 +0100 Greg KH wrote: > On Wed, Feb 23, 2022 at 05:13:41PM +0000, SeongJae Park wrote: > > On Wed, 23 Feb 2022 16:45:13 +0000 SeongJae Park wrote: > > > > > On Wed, 23 Feb 2022 17:09:38 +0100 Greg KH wrote: > > > > > > > On Wed, Feb 23, 2022 at 03:20:42PM +0000, SeongJae Park wrote: > > > > > +static struct kobj_attribute damon_sysfs_ul_range_min_attr = > > > > > + __ATTR(min, 0600, damon_sysfs_ul_range_min_show, > > > > > + damon_sysfs_ul_range_min_store); > > > > > + > > > > > +static struct kobj_attribute damon_sysfs_ul_range_max_attr = > > > > > + __ATTR(max, 0600, damon_sysfs_ul_range_max_show, > > > > > + damon_sysfs_ul_range_max_store); > > > > > > > > Can you use __ATTR_RW_MODE() instead here and elsewhere? > > > > > > Sure, I will, in the next revision. > > > > After thinking once more, I realized that it might not so simple. First of > > all, there are two files having same name in different directories > > (kdamonds//pid and targets//pid). The files work differently, so I need > > to use different _show/_store callbacks for them but __ATTR_RW_MODE() wouldn't > > support the case. > > The reason I recommend using these macros is to prevent you from having > sysfs files with the same name, yet doing different things in different > places in the sysfs tree :) Thank you for clarifying! Maybe I was making the hierarchy unnecessarily deep and thus naming files too short and/or common, which could confuses relative paths users. > > > Secondly, I'd like to keep the file names short because the meaning of the > > files can easily inferred from the hierarchy, but want to keep the _show/_store > > callback names to have prefixes that allows us easily know their meaning and > > usage even though it makes the name a little bit longer because I don't want to > > have too much source files for DAMON sysfs interface. > > > > Am I missing some of your point? > > How about renaming one of the files? Thank you for the suggestion, will do so. Thanks, SJ