Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1050597pxm; Wed, 23 Feb 2022 16:52:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/VGTtu4zDWZ15BNj04fOieXXn7qBc2epKstRV+Jxm0g+OQq3+rbz+szMU/GtwrrS4rNPg X-Received: by 2002:a63:de55:0:b0:374:2526:3596 with SMTP id y21-20020a63de55000000b0037425263596mr335223pgi.592.1645663970562; Wed, 23 Feb 2022 16:52:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645663970; cv=none; d=google.com; s=arc-20160816; b=iwsw17CR6YqfSeg4CX4r/VnHyOmxnWJT8KT+uF0VKS9JFmlYTR5JR9w8kjRSCCBmkn yPZmwLyQz87n3TJRn6cocuC/qKB/6LBvWUmHGScE0gqEEOZrYAVwsi+yhekW5EjJchHt iomDi97pkp/PNMwzqACqkTvQyoplcbnEYPIYyZuhVv21rghWYJAp802zeaXXxqOQOflu 6MM6m/qNiM6LVxmqOaYL/akeNJgJd9MzL39bZfZxs4k4zqVw+4XNNe0u8QKfsh7Nj/O+ VLltId4qQTISpKGNnDDe/UkyPC2MzufPoIjmxG3sg9prx/XvJUik+ldv2Gg1FDdtGQFj HcCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DqRkixATUCExlLA2lvv/3+iNzk+zBKMXDhBglKTPb0g=; b=maO6MjAyo8BGsHTnYy9mIbVeAKM5WeRdTKKObBmqPQ1o8aj/I3dMYXNLT+t9sLrLUp LFWKawG9d3xljHvJdV04IP2xbe1o/1URDKMkEHG2GF2kiEI8IfhFzzC+m7BwB30ergIK ixdrf498nwx80EQ030uadcKdFxtWY1e1eZoBwII2UYXPZLrseBdyws8SutChjWVg6/9P NPCsNDly8XKtHZ16H3DtgyvEDas4lsc5TA0e0miGF6lMd2yLoietBzl2dQoel7wP3u+M 3e4A2/U6z2oAMf5HnQh2q7QhoWtXBXWgRshkud2ocfHW6cAi+zs64Ag8DepWk+exHNZ9 7/cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P2J6UGlE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c8si1258990pgq.52.2022.02.23.16.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 16:52:50 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P2J6UGlE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E5142237EA; Wed, 23 Feb 2022 16:46:45 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244097AbiBWTEL (ORCPT + 99 others); Wed, 23 Feb 2022 14:04:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232675AbiBWTEK (ORCPT ); Wed, 23 Feb 2022 14:04:10 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEADB1D0CC; Wed, 23 Feb 2022 11:03:41 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 719C26168F; 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: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, 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