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 81E45C433F5 for ; Wed, 23 Feb 2022 18:33:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C93658D0037; Wed, 23 Feb 2022 13:33:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C40A18D0011; Wed, 23 Feb 2022 13:33:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B08DF8D0037; Wed, 23 Feb 2022 13:33:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0213.hostedemail.com [216.40.44.213]) by kanga.kvack.org (Postfix) with ESMTP id 8E8318D0011 for ; Wed, 23 Feb 2022 13:33:36 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2501A9A81D for ; Wed, 23 Feb 2022 18:33:36 +0000 (UTC) X-FDA: 79174892832.17.3B7F4FE Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf31.hostedemail.com (Postfix) with ESMTP id 9519920015 for ; Wed, 23 Feb 2022 18:33:35 +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 7891761616; Wed, 23 Feb 2022 18:33:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BEB6C340E7; Wed, 23 Feb 2022 18:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645641213; bh=0xj9aSd6jMvgA2fZvLT9i6WQjMs7jPcimi01inky5Yc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V9ji03D9KgSvmPz+XksOIsQKaDXTdI0jhrmMjsQtv5QBjHdUnLPmsgA85dv7JXWw1 2+gxlgpemNYSfq3OIa242IRKYcBtO/UhOUYlU1N1InyZybSkR3xe06n1sMfNdFYAvR mxHVXziWDQ4WrYxBThpaPUfJIaZvmB/RDHRWAWkg= Date: Wed, 23 Feb 2022 19:33:31 +0100 From: Greg KH To: SeongJae Park Cc: 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 Message-ID: References: <20220223164513.23089-1-sj@kernel.org> <20220223171341.29010-1-sj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220223171341.29010-1-sj@kernel.org> X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9519920015 X-Rspam-User: Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=V9ji03D9; spf=pass (imf31.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-Stat-Signature: a33eqj35ctqws8p9d53cthmcisgea4xr X-HE-Tag: 1645641215-217296 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, 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 :) > 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? thanks, greg k-h