Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2021535rwe; Sun, 28 Aug 2022 01:40:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Sfl5fY6jzF4Jr5tLZ/NzhbJBsImv0jEaZD1Q9+jhnWPnb1gFFzQelensZTyvFIvppFr1W X-Received: by 2002:a05:6402:5192:b0:43d:cc0d:6ea4 with SMTP id q18-20020a056402519200b0043dcc0d6ea4mr12558590edd.111.1661676018645; Sun, 28 Aug 2022 01:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661676018; cv=none; d=google.com; s=arc-20160816; b=KBMsofJ6scutMCdSpeMrciwpv138Z2jQI53qWH2/k/TBWh7Vp6O8KXtKVQCSbWvr2x iQnEAkZmjQy5h6yLrDK57lzV9F1RET17ZbhDfWYrvBz3HUxWWpy6MweZ5iSRGErFLAg+ Atphes1HQukues2Z1bzUSlHLUj/XJd1cdZkcQxLbZ1/SNMu+upmtDDM8jLPz9Uy5ArJY lK9KoINw8itCnm2UtZfI1KLzYq14itwdasVDC060av3BcyA6Fg9RtQePmHGKgBfn31ZB pU9keho646W2uTCiNHXCcninKCxFv7UbOdUwiXHvKCOzA7jOwTyMQ5hATMGJf2yrwY03 t0Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=igzIvkpGT+nPYqgzOf8R+auGe6xkkz9GD36+hdfK3Lk=; b=riEfdzrfh5R2bvrz+c3LCXcp8nmaWcMBmwjPEduf96HaALS3wqSEmbSr42lUDH0C+q bbmoVWEOAebu+fWvP51H2nV6xiAVpsE/nhQhN5acoZ9iLs9cNkW2gRILeBTF5gLupIwz Qn0Fx1Xea+ZJhUKTgxIzvmnVLkOst4/Dqi2XGZrCAGOLd+NKf8p9dhDJf0NL8tS+iNll JGOIkgJV2XifWL2OSdP2y1kVnp+fnNm9O6gQtSt59lA5YUVu06/NQtQmyYpvyglOGZ7/ HQxua6r2whnpX5ERZX5IEjx7VbDeh/vXTxx5EiPYMnqS9yYrGsqLLMsPViPiTlgCn+Jo lAQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=t4V6YyZp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i33-20020a0564020f2100b00447e9724023si4050211eda.270.2022.08.28.01.39.39; Sun, 28 Aug 2022 01:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=t4V6YyZp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232235AbiH1Idj (ORCPT + 99 others); Sun, 28 Aug 2022 04:33:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231839AbiH1Idi (ORCPT ); Sun, 28 Aug 2022 04:33:38 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A24F252BE for ; Sun, 28 Aug 2022 01:33:37 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id i7-20020a17090adc0700b001fd7ccbec3cso2828522pjv.0 for ; Sun, 28 Aug 2022 01:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=igzIvkpGT+nPYqgzOf8R+auGe6xkkz9GD36+hdfK3Lk=; b=t4V6YyZpM/OSUDCUR3ubrb/8Uvu7c9EuFAHJwkEUWxuLP/kjalgYewUrKfKVnAHgkO Q4m+2bhqbN8ZVjlgzWhf1VewQU5PzTCkd8lCH3DKAxHRZoC2Wb69NukagB1aQMoe2K/p HMID02DwjdNkKHKiLZ9NUM2G76EJ098LTz4CQgRLbrd7R3xXNifDM8LgljvOEL3FkBJZ WVFISx3rUKs/95+H3ItIXXgZrryP9yqMDKmqBcMliM6VQYzH34araE3C/qFlz7j9ddS7 aywMXfEM8Y50KAA5P4p0a1gcgA8tFXGo3KnF5/QqIPfZ2HI49Zoy2Doncibpz9JKi3da 3Esg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=igzIvkpGT+nPYqgzOf8R+auGe6xkkz9GD36+hdfK3Lk=; b=RQFOl9WFgqafhb1Ka7VcKElor/t2tnaQkselUKqWWt2bffm7o18e3UqUHKDEpfoj2v gfYP3dvV5uc538yIvv1UNS+0GEq1QEh4ZhNf3yvA9Z/9YG2xZ28M8MIdYGkh/NS+gCSE WYxR088MrMhKa5u/X1UpVwqVSut+D4Jh1bo6ArcTTzWgVJPhGfb+X9RZN2OJRUxX4Shr tWo89DcQSn8gcF61tCQXwqklROVPIgKIUWWkX8ZU/Z4Gf8d4fAfSxX5qzyjRF1hPeRwL dzXLjunSnyG+Q7AZpJbbx84yEjLN3k3x2OvmLer7c1tRaxIHU2xg14A20IUGl05d6BZ7 mSGg== X-Gm-Message-State: ACgBeo1bTNdvu8HEp4Hq9DSNyIi3t5QciEtoRUF9aqVYHCG50zuliYYw +z/7wns7U3/zOMldPChPNWAgThN6pmuLpQ== X-Received: by 2002:a17:902:cec7:b0:172:b20d:e666 with SMTP id d7-20020a170902cec700b00172b20de666mr11047055plg.154.1661675616564; Sun, 28 Aug 2022 01:33:36 -0700 (PDT) Received: from ?IPV6:2409:8a28:e60:7d70:199a:6f05:bad8:24fd? ([2409:8a28:e60:7d70:199a:6f05:bad8:24fd]) by smtp.gmail.com with ESMTPSA id u3-20020a17090a1d4300b001fb4a8d82a7sm4415394pju.56.2022.08.28.01.33.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Aug 2022 01:33:36 -0700 (PDT) Message-ID: Date: Sun, 28 Aug 2022 16:33:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCHSET v2 for-6.1] kernfs, cgroup: implement kernfs_show() and cgroup_file_show() Content-Language: en-US To: Tejun Heo , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Johannes Weiner , Imran Khan , kernel-team@fb.com References: <20220828050440.734579-1-tj@kernel.org> From: Chengming Zhou In-Reply-To: <20220828050440.734579-1-tj@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 2022/8/28 13:04, Tejun Heo wrote: > Hello, > > Greg: If this looks good to you, can you apply 0001-0008 to your tree? I'll > likely have more cgroup updates on top, so I think it'd be better if I pull > your tree and then handle the cgroup part in cgroup tree. > > Currently, deactivated kernfs nodes are used for two purposes - during > removal to kill and drain nodes and during creation to make multiple > kernfs_nodes creations to succeed or fail as a group. > > This patchset implements kernfs_show() which can dynamically show and hide > kernfs_nodes using the [de]activation mechanisms, and, on top, implements > cgroup_file_show() which allows toggling cgroup file visiblity. > > This is for the following pending patchset to allow disabling PSI on > per-cgroup basis: > > https://lore.kernel.org/all/20220808110341.15799-1-zhouchengming@bytedance.com/t/#u > > which requires hiding the corresponding cgroup interface files while > disabled. > > This patchset contains the following nine patches. > > 0001-kernfs-Simply-by-replacing-kernfs_deref_open_node-wi.patch > 0002-kernfs-Drop-unnecessary-mutex-local-variable-initial.patch > 0003-kernfs-Refactor-kernfs_get_open_node.patch > 0004-kernfs-Skip-kernfs_drain_open_files-more-aggressivel.patch > 0005-kernfs-Improve-kernfs_drain-and-always-call-on-remov.patch > 0006-kernfs-Add-KERNFS_REMOVING-flags.patch > 0007-kernfs-Factor-out-kernfs_activate_one.patch > 0008-kernfs-Implement-kernfs_show.patch > 0009-cgroup-Implement-cgroup_file_show.patch > > 0001-0003 are misc prep patches. 0004-0008 implement kernsf_deactivate(). > 0009 implements cgroup_file_show() on top. The patches are also available in > the following git branch: > > git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git kernfs-show > > The main difference from the previous version[1] is that while show/hide > still use the same mechanism as [de]activation, their states are tracked > separately so that e.g. an unrelated kernfs_activate() higher up in the tree > doesn't interfere with hidden nodes in the subtree. Hello, For this series: Reviewed-by: Chengming Zhou Tested-by: Chengming Zhou Thanks! > > diffstat follows. Thanks. > > fs/kernfs/dir.c | 102 +++++++++++++++++++++++++++++++---------------- > fs/kernfs/file.c | 151 +++++++++++++++++++++++++++++++++------------------------------------- > fs/kernfs/kernfs-internal.h | 1 > include/linux/cgroup.h | 1 > include/linux/kernfs.h | 3 + > kernel/cgroup/cgroup.c | 20 +++++++++ > 6 files changed, 166 insertions(+), 112 deletions(-) > > -- > tejun > > [1] http://lkml.kernel.org/r/20220820000550.367085-1-tj@kernel.org >