X-Received: by 2002:a17:90a:3008:b0:1bc:5041:a04e with SMTP id g8-20020a17090a300800b001bc5041a04emr12082207pjb.54.1645666479147; Wed, 23 Feb 2022 17:34:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645666479; cv=none; d=google.com; s=arc-20160816; b=DfgEDcgrFNVBsmc25JBMq4RYGjtzrNPaJnCQgPiqed4xSUsKqWYXhOOqTKztCLgD99 uKe3kIm/+wwEcU5d7bYAA10A9XG6W828B/oLnSMDtFUyUVebly/iSrWJvlVuJRG0bFNI v24ZMHfODSrwiHJ9d/RQ8NDuPIDasGdPkytvrSVevntiN3gV0TXsE/j7ZnYEKuFKkFHN q2sOAfWoJeRNUDp6qpehABy+mQSt/wY4vbaRUr30w2IswWE4Uo1SyD4uHyWCg1maVOqR y75/Sid20c2WSLktKf8AuW+Pa2VQD9lpiltIzAxB88X8CjcLQM6r8E9Sc3rWWgjMu8w3 Qv4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k3Zkr74efZMyy/oX4a99sQwSH1SiMz/3HjNq7Lf1ZE0=; b=TFNQZJjoExg4l6dMfzveIQqTjehl7JskaQRX0CedkzyjcKQrUwEDtMNWb0QwCBacBm psiPj7wgqUY5DHEU1aasXoDUgFaZUN53nUZM65PvdygWz4DnTnZgY8SI2LIQaE94G9as +150isWT2CrTF/fdPCLIFg5MEJiNPqekW09qJAsnTxeFNdYMefmmioyIPdEybAUzODZk dIjs3GxlQJR9mWu+uJtYeXytxoGBa8JySL4CWIYBzRYgg1GezBbsNBF9uinwMNpnemzk yY3vw2Kexmr/tkQXL69IQs9o0J+uTDTA6mfBkgXErTKqcV42Kx/2My5CNuPuLydHl8ki 5BPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V9ji03D9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c17si1249100pgw.574.2022.02.23.17.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 17:34:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V9ji03D9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 42F08162026; Wed, 23 Feb 2022 17:13:23 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243930AbiBWSeF (ORCPT + 99 others); Wed, 23 Feb 2022 13:34:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243927AbiBWSeE (ORCPT ); Wed, 23 Feb 2022 13:34:04 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B69E4EA0B; Wed, 23 Feb 2022 10:33:36 -0800 (PST) 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 3DAC7B8211D; Wed, 23 Feb 2022 18:33:35 +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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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