Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp285006pxv; Thu, 24 Jun 2021 07:55:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTUjgL33gVkWyNcMLLcgjZWDvpt106yhKAnARuSBCm8DLfvrfui5qcZVvPOF3LFccYlUmK X-Received: by 2002:a92:dc46:: with SMTP id x6mr3818204ilq.66.1624546513055; Thu, 24 Jun 2021 07:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624546513; cv=none; d=google.com; s=arc-20160816; b=EBV0j99ISb04aeYNBMHCYGq/ALwG/Zng3u+5IPEp2FJwFIKIBpRUXpdhBJFT/02Zhm old3E7x1la4W2gRlwmZy9IieJQbDpkrphCjZ8VJ8SFc1eYUMdXRjW4mFICtU4xPNysEq 5dmol3aMpkm+uFwOb3918DBRE4RePAAcqdtbhKnMYZ3g4ONlen9h2/5m2x9I5AgPiMHe ckMn5B5Grr5RpQDW02CdWrWPm61lZi7UDYIEU1FDTAAHITN781R/CdPD4Zot699wLajf MIuwBosCWZ3pjOKM9eUzwZSyPgRPJfAp4PNPUKhU6Yctkj7O1mXjX6Z7iwRxrMZaLod4 vkDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ovP/lGCXrJxv1nxs9/4YwxIKrqxmdrIBwP4MPn+ws9I=; b=kPRDFmuryO84mPrU6GWqe19W5sW+icxNVhmyZV1S5etZ02v5cZB5lYCa4poB0w4rli dpFU56DWRSlp+ktHNVKe6TG/uGbZCVbrRsUa53FRSp63kCKojrYCJhRzJJlSDuQ+x/vh WDlU/XJCoTU2HvS+fy/15/HMDb8FUF/v7ApagLkXIHSCDh+T4PkcihPvYvX832bibxJN Jh87zkERcWfolXf7olESsVI5LlRzorbRjcK0gViCGwKKgn+TiZRzl/4vWjFmFmkvd+Ak 6z1jvlEmeVfRW7xoFkd1vI5cG1P98tmKims4AE2bNpjg9RmHFybHhGyMucdc5w4tIsat Jvpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=e3lGtuEx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si3552496jak.69.2021.06.24.07.54.58; Thu, 24 Jun 2021 07:55:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=e3lGtuEx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbhFXOzc (ORCPT + 99 others); Thu, 24 Jun 2021 10:55:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231417AbhFXOzb (ORCPT ); Thu, 24 Jun 2021 10:55:31 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DCF5C061756 for ; Thu, 24 Jun 2021 07:53:12 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id d16so10756056lfn.3 for ; Thu, 24 Jun 2021 07:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ovP/lGCXrJxv1nxs9/4YwxIKrqxmdrIBwP4MPn+ws9I=; b=e3lGtuExOlYER8W6nNo54e+F3pfIYvAlP9FQWJSVcLvPCf1Bckx3+WbCoo6Gx2ib0S iIdZTx6Vmw92+ej0Bkw69mWEDvOoq8TEeuIhJo0xjjrRmCOHv7r2JMQ1iYfFaydZW6+b rw/ZCcHRNU8PBbNMwJsl751dnqefq0axjlZvRPUzuH0grThDHS/kR/LK3hX7LRv4IuD6 5Sw8dQU6SWkj3IY164XETlnQljc8kpaZVCmSj9XlHBWhlLsJFj/e9He2j8G40kiDfIPj mda1ipmPguErhZkccwfbE5Oit5kY5f6fIfm65aoLVzPnXgKrdNic1VjVVMAiBmTgGh2P cfsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ovP/lGCXrJxv1nxs9/4YwxIKrqxmdrIBwP4MPn+ws9I=; b=hCRAvoskHzlf0XcTOCES1x1tPcmeRgrMbYd+6H2ssLUxmuNM+7SL5ylmuyrTo0h/Es dJqvGxK7h3t3OZZsTdWYL6catOna7jv+6+pdEN5Yh30K8+dABv2AxEGlbouEVkV4bNTC SFacsi86TxiKONlF3dxddPn+znSCNCLz4TiAFmNO7u/0nlYLpA//oBpf4VJ5YLKimGFW VOn51yDmM9/Ct0/YCGmlHIjLFG0VkLII2BjHPWfqZXQ8nIaa6yEJzwkYRyZmRtiZJl0Z 7PT+9nWBhUtguh3qrTd3+opdRojghRek8VU2fC8dEk0n3rLFmv0K8GVul1KVvtPOwHYV q7/g== X-Gm-Message-State: AOAM531duGYHkVMEbLwXf87RgCaPioqznl+GA9pBD2WNmWtIrhv4ywDe Zp0SaDcJdESy15Pc0wWMPffb4vbkocKF6eLMZxZhkg== X-Received: by 2002:a05:6512:442:: with SMTP id y2mr2350427lfk.117.1624546390404; Thu, 24 Jun 2021 07:53:10 -0700 (PDT) MIME-Version: 1.0 References: <20210624102623.24563-1-sjpark@amazon.de> <20210624102623.24563-4-sjpark@amazon.de> In-Reply-To: <20210624102623.24563-4-sjpark@amazon.de> From: Shakeel Butt Date: Thu, 24 Jun 2021 07:52:59 -0700 Message-ID: Subject: Re: [PATCH v31 07/13] mm/damon: Implement a debugfs-based user space interface To: SeongJae Park Cc: SeongJae Park , Jonathan.Cameron@huawei.com, acme@kernel.org, alexander.shishkin@linux.intel.com, amit@kernel.org, benh@kernel.crashing.org, Brendan Higgins , Jonathan Corbet , David Hildenbrand , dwmw@amazon.com, Marco Elver , "Du, Fan" , foersleo@amazon.de, greg@kroah.com, Greg Thelen , guoju.fgj@alibaba-inc.com, jgowans@amazon.com, Mel Gorman , mheyne@amazon.de, Minchan Kim , Ingo Molnar , namhyung@kernel.org, "Peter Zijlstra (Intel)" , Rik van Riel , David Rientjes , Steven Rostedt , Mike Rapoport , Shuah Khan , sieberf@amazon.com, snu@zelle79.org, Vlastimil Babka , Vladimir Davydov , zgf574564920@gmail.com, linux-damon@amazon.com, Linux MM , linux-doc@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021 at 3:26 AM SeongJae Park 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.