Re: [RFC PATCH 1/2] add pinned flags for kernfs node

Greg KH
2021-09-08T12:35:25Z

On Wed, Sep 08, 2021 at 08:15:12PM +0800, Yi Tao wrote:
> This patch is preparing for the implementation of cgroup pool. If a
> kernfs node is set to pinned. the data of this node will no longer be
> protected by kernfs internally. When it performs the following actions,
> the area protected by kernfs_rwsem will be protected by the specific
> spinlock:
> 1.rename this node
> 2.remove this node
> 3.create child node
>
> Suggested-by: Shanpei Chen <shanpeic@linux.alibaba.com>
> Signed-off-by: Yi Tao <escape@linux.alibaba.com>
> ---
> fs/kernfs/dir.c | 74 ++++++++++++++++++++++++++++++++++++--------------
> include/linux/kernfs.h | 14 ++++++++++
> 2 files changed, 68 insertions(+), 20 deletions(-)

Ugh, this is going to get messy fast.

Why are kernfs changes needed for this? kernfs creation is not
necessarily supposed to be "fast", what benchmark needs this type of
change to require the addition of this complexity?

And how are we going to audit things to ensure the "pinning" is working
properly?

thanks,

greg k-h