Re: [PATCH v31 07/13] mm/damon: Implement a debugfs-based user space interface

From: Shakeel Butt
Date: Thu Jun 24 2021 - 10:53:15 EST


On Thu, Jun 24, 2021 at 3:26 AM SeongJae Park <sj38.park@xxxxxxxxx> wrote:
>
[...]
> >
> > The high level comment I have for this patch is the layering of pid
> > reference counting. The dbgfs should treat the targets as abstract
> > objects and vaddr should handle the reference counting of pids. More
> > specifically move find_get_pid from dbgfs to vaddr and to add an
> > interface to the primitive for set_targets.
> >
> > At the moment, the pid reference is taken in dbgfs and put in vaddr.
> > This will be the source of bugs in future.
>
> Good point, and agreed on the problem. But, I'd like to move 'put_pid()' to
> dbgfs, because I think that would let extending the dbgfs user interface to
> pidfd a little bit simpler. Also, I think that would be easier to use for
> in-kernel programming interface usages. If you disagree, please feel free to
> let me know.
>

I was thinking of removing targetid_is_pid() checks. Anyways this is
not something we can not change later, so I will let you decide which
direction you want to take.