From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DE49C49EA5 for ; Thu, 24 Jun 2021 14:53:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A190D60C3E for ; Thu, 24 Jun 2021 14:53:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A190D60C3E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 858506B0036; Thu, 24 Jun 2021 10:53:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 82EE86B005D; Thu, 24 Jun 2021 10:53:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A8B46B006C; Thu, 24 Jun 2021 10:53:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id 37A286B0036 for ; Thu, 24 Jun 2021 10:53:12 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5C71311913 for ; Thu, 24 Jun 2021 14:53:12 +0000 (UTC) X-FDA: 78288910224.04.2FBA204 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by imf24.hostedemail.com (Postfix) with ESMTP id 149C4A00026F for ; Thu, 24 Jun 2021 14:53:11 +0000 (UTC) Received: by mail-lf1-f49.google.com with SMTP id i13so10764998lfc.7 for ; Thu, 24 Jun 2021 07:53:11 -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=ewsfBdjfR9zfiihjdeUM3hLxr9ztnROKKPeuE+OYXGqfkMAs1S6wrZF0w3xEN1p9uz t10aLiIqkujPQMkhBAS6mO66bGed35qT4VoYwyZrYuXIUPtKifpbSQxZm0Vx6E16B+FC SlTLV/zXWPOIY3dr+CsWz4/IlrsECsuM8xtUT4BU2bkeLmXI3HYtnodbKZMUGQAjXrR0 jbF5IjLl+Png9xfLTZWJGp81+2NWqJtrjihb4bZGHcY0/BqjJH43QTfsIxaQzCEor8sE F0OqX2BkdynVxPVcvV72I9fZSANN183YLw9/8FE7phAdtlT3kbaAmBIOVBNsqztao3/W hVCA== X-Gm-Message-State: AOAM533pXLB9FwLr8Evoghflt57pmg+SKAFAQyFxE3AqKw2lPoDgXL/K u8bO5eYiqVhMoc8UXszSG/61cMaV6UT3Dhme15XVvw== X-Google-Smtp-Source: ABdhPJxV07HPRcmp8a0+ID/KVCmXrxdr3n+dd62frBO5x/g0l97z0IK36nmYnZAJktrWd01HO+ysPAStfFzV9tf8vkg= 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" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 149C4A00026F Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=e3lGtuEx; spf=pass (imf24.hostedemail.com: domain of shakeelb@google.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: txh56y9ji4i1xr8nzd79b4php97mwnaf X-HE-Tag: 1624546391-953115 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.