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=-3.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 74798C433E0 for ; Tue, 4 Aug 2020 07:27:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6EFC42076C for ; Tue, 4 Aug 2020 07:27:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="QADiLWYD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6EFC42076C Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1164F89A5D; Tue, 4 Aug 2020 07:27:05 +0000 (UTC) Received: from mail-ua1-x941.google.com (mail-ua1-x941.google.com [IPv6:2607:f8b0:4864:20::941]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7DCE86E177 for ; Tue, 4 Aug 2020 02:11:11 +0000 (UTC) Received: by mail-ua1-x941.google.com with SMTP id r63so12436341uar.9 for ; Mon, 03 Aug 2020 19:11: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=k9EPoA/TZ6oFdobQPbI92mloUpSocVCmYhmgQ9XTICk=; b=QADiLWYDVY5sDxEYuLEuvcCNAPfU3goGeGw7YEgVuEfcRmX+WQZUvyrbIKtcB7k7iQ YxtIg+05jbwODdVdONyVxvmTrVZkmGIM0V8YH0Opo5g6s04ssZ+E7raI4lMc6wipoLsR mtgY7uBETHz6kZN968nSb549MAS66ZiRjzYJIBh4V2KqbBYjvi0sk8NkJGObyROZ26Rz wr0T342klm0lF2dZp+0E7GYYrZV1oLV7ImOHoLhAfA2b6vuOhpxgD4QGTMNTY6xao7VS tnWQeeqa1y9yCWAdCkdmUq6sTQ5PXziy0Z7S8lVg41R2Av1E7muXD5VKHWwh+4EHg+RB Rqbg== 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=k9EPoA/TZ6oFdobQPbI92mloUpSocVCmYhmgQ9XTICk=; b=BNICMKVREHBdy+VMXliFCN4BaxZq6hLvHh3T15sbAlQCuwFZWsQYLY51jiHNDedWrN RVKqRDpKFdC3orqRSipZOlu3JzYUMvR2/YddpBn59uF9NJsU/liyyUjplLJdz3FA8+sE 9rtmDCaQXaS4o6AZWWVVEOQi9JuKHaBy1cGU3z4ZlW190vBGsu9bnXs4y+c2Ii7M/Ph6 wBzMzvce7cK4hWO/GrSbK/x900Dn2iyJtMY0Z5RI0TQyiu7ADsaiGV1e92H92nWtwugD LlaW2IFiDJCVL1mCa3R2XEEHwtyfZLsY+G//KbiknTZgqE6849JYqWda8GFrddTdjlqK XGYA== X-Gm-Message-State: AOAM532XTmvVvXu1megcn/HhvVlq5HKpdqyLRs1qsTadVuDxJo3aYBke pIv/yTaoYAm66blwW2bRc5YEu+xcQPpwbTqoHX7kHg== X-Google-Smtp-Source: ABdhPJxsSSJwioh1fipswY2Sg0TuZ8kexPdrIAJWw0UnM4xG9WSpH2NU05FlGdWBuHZgMZ+Mu0VvpeSV2QDEBT1mDD8= X-Received: by 2002:ab0:5eaa:: with SMTP id y42mr13300969uag.118.1596507070267; Mon, 03 Aug 2020 19:11:10 -0700 (PDT) MIME-Version: 1.0 References: <20200803144719.3184138-1-kaleshsingh@google.com> <20200803144719.3184138-3-kaleshsingh@google.com> <20200803154125.GA23808@casper.infradead.org> <20200803161230.GB23808@casper.infradead.org> <20200803222831.GI1236603@ZenIV.linux.org.uk> <20200804010913.GA2096725@ZenIV.linux.org.uk> In-Reply-To: <20200804010913.GA2096725@ZenIV.linux.org.uk> From: Suren Baghdasaryan Date: Mon, 3 Aug 2020 19:10:59 -0700 Message-ID: Subject: Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events To: Al Viro X-Mailman-Approved-At: Tue, 04 Aug 2020 07:27:04 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jonathan Corbet , DRI mailing list , linux-doc@vger.kernel.org, Ioannis Ilkos , LKML , Steven Rostedt , linaro-mm-sig@lists.linaro.org, Hridya Valsaraju , Ingo Molnar , Matthew Wilcox , Kalesh Singh , linux-fsdevel@vger.kernel.org, kernel-team , linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Aug 3, 2020 at 6:09 PM Al Viro wrote: > > On Mon, Aug 03, 2020 at 11:28:31PM +0100, Al Viro wrote: > > > IOW, what the hell is that horror for? You do realize, for example, that there's > > such thing as dup(), right? And dup2() as well. And while we are at it, how > > do you keep track of removals, considering the fact that you can stick a file > > reference into SCM_RIGHTS datagram sent to yourself, close descriptors and an hour > > later pick that datagram, suddenly getting descriptor back? > > > > Besides, "I have no descriptors left" != "I can't be currently sitting in the middle > > of syscall on that sucker"; close() does *NOT* terminate ongoing operations. Thanks for your feedback, Al. I see your points and sorry for not realizing these shortcomings. > > > > You are looking at the drastically wrong abstraction level. Please, describe what > > it is that you are trying to achieve. > > _IF_ it's "who keeps a particularly long-lived sucker pinned", I would suggest > fuser(1) run when you detect that kind of long-lived dmabuf. With events generated > by their constructors and destructors, and detection of longevity done based on > that. That is the intention here. IIUC fuser(1) would require root access to collect this information from a process other than the caller. Ideally what we would like to have is a non-root process with specific capabilities (in our case a process that can access BPF maps) to be able to obtain the information on dma-buf users. However, it might make more sense to track dma-buf usage from dma_buf_getfile, dma_buf_get and dma_buf_put since these calls are the ones that affect file refcount. Will dig some more into this. Thanks for your time and sorry for not thinking it through beforehand. > > But that's only a semi-blind guess at the things you are trying to achieve; please, > describe what it really is. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel