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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 9424DC433DB for ; Wed, 3 Feb 2021 10:24:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 313D964DE7 for ; Wed, 3 Feb 2021 10:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233599AbhBCKY0 (ORCPT ); Wed, 3 Feb 2021 05:24:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233405AbhBCKYY (ORCPT ); Wed, 3 Feb 2021 05:24:24 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5408FC061573 for ; Wed, 3 Feb 2021 02:23:44 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id 190so4918047wmz.0 for ; Wed, 03 Feb 2021 02:23:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=YVcGpKd8+eC2YQ5xYyo7fYllHOO2iPEn0qmRLD8c4tk=; b=XcTmJyWd74nvKmKqGb0lHYbm4BberuwObLIrEVZVDU5MFPGSgRvwBVl691DtsVL32v PoxSztsiW9kqnY7fWODTxJQ24Xut19EQmALlq/oOlmCC/lE28uXGaC0MT/lTB3vpqnHz OO6YtZ53iIHcnPn/3H7K8/Ji389pkKLCfJXYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=YVcGpKd8+eC2YQ5xYyo7fYllHOO2iPEn0qmRLD8c4tk=; b=JEn2uSZWwOZPFj21mGkufgfR35Kdt2xo97BE47V4Ayjx54OyI1uNB1jjXiDdrDuWNK Tl/0Von8rZ7WZtaMNchUmu46FuYwzzVz3SXEzkiykiXQgWbtvEncGZJ+td2DZLGMVBgS icDsgViDkiIYfcpsYXHiA6fkgdk6wtRlM+0RdrwLW6I2y9dZm7PTQnVRHPgoTDG/ToZv m7mrJzAMQCCMK8tV9gb7AGbf6Zv/dv7kc7Vkij+u0j5YGCWWo40FoU4QXut587AyozL+ SC79oAcnV63KfyskCtvagEy2MHQnVx2DzEXIOonBR5RAT+4c7Sh8SWnUXiKI9dpS1sPP R++Q== X-Gm-Message-State: AOAM532iKwVZTAsVvy/h4eOAiTHoZoxOL1dY1sAI2iEUDKaxGUzbkQBN o9HhGJj4P4nM72hNDy1EZicKzQ== X-Google-Smtp-Source: ABdhPJwiI5aD5dqY1ckorWBWkPtWhv80Z2HTWzG7jeWjpVya/U1sTYHLj7xvi3ENjtXKYY1O+EVTCA== X-Received: by 2002:a7b:c3ca:: with SMTP id t10mr1325153wmj.138.1612347823070; Wed, 03 Feb 2021 02:23:43 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id b3sm2351907wme.32.2021.02.03.02.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 02:23:42 -0800 (PST) Date: Wed, 3 Feb 2021 11:23:39 +0100 From: Daniel Vetter To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Simon Ser , Pekka Paalanen , Michal Hocko , "open list:DOCUMENTATION" , Szabolcs Nagy , dri-devel@lists.freedesktop.org, Andrei Vagin , Kalesh Singh , Hui Su , Michel Lespinasse , Jonathan Corbet , Mauro Carvalho Chehab , Jeffrey Vander Stoep , Daniel Jordan , kernel-team , Alexey Dobriyan , Linux Media Mailing List , Kees Cook , Jann Horn , linaro-mm-sig@lists.linaro.org, linux-fsdevel , Bernd Edlinger , Suren Baghdasaryan , Alexey Gladkov , kernel list , Minchan Kim , Yafang Shao , "Eric W. Biederman" , Greg Kroah-Hartman , Hridya Valsaraju , Andrew Morton , Linux API Subject: Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds Message-ID: Mail-Followup-To: Christian =?iso-8859-1?Q?K=F6nig?= , Simon Ser , Pekka Paalanen , Michal Hocko , "open list:DOCUMENTATION" , Szabolcs Nagy , dri-devel@lists.freedesktop.org, Andrei Vagin , Kalesh Singh , Hui Su , Michel Lespinasse , Jonathan Corbet , Mauro Carvalho Chehab , Jeffrey Vander Stoep , Daniel Jordan , kernel-team , Alexey Dobriyan , Linux Media Mailing List , Kees Cook , Jann Horn , linaro-mm-sig@lists.linaro.org, linux-fsdevel , Bernd Edlinger , Suren Baghdasaryan , Alexey Gladkov , kernel list , Minchan Kim , Yafang Shao , "Eric W. Biederman" , Greg Kroah-Hartman , Hridya Valsaraju , Andrew Morton , Linux API References: <20210126225138.1823266-1-kaleshsingh@google.com> <20210128120130.50aa9a74@eldfell> <20210129161334.788b8fd0@eldfell> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: Linux phenom 5.7.0-1-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Fri, Jan 29, 2021 at 03:22:06PM +0100, Christian König wrote: > Am 29.01.21 um 15:17 schrieb Simon Ser: > > On Friday, January 29th, 2021 at 3:13 PM, Pekka Paalanen wrote: > > > > > > Re-importing it adds quite a huge CPU overhead to both userspace as well > > > > as the kernel. > > > Perhaps, but so far it seems no-one has noticed the overhead, with Mesa > > > at least. > > > > > > I happily stand corrected. > > Note, all of this doesn't mean that compositors will stop keeping > > DMA-BUF FDs around. They may want to keep them open for other purposes > > like importing them into KMS or other EGL displays as needed. > > Correct and that's a perfectly valid use case. Just re-importing it on every > frame is something we should really try to avoid. > > At least with debugging enabled it's massive overhead and maybe even > performance penalty when we have to re-create device page tables all the > time. > > But thinking more about that it is possible that we short-cut this step as > long as the original import was still referenced. Otherwise we probably > would have noticed this much earlier. Yeah kernel keeps lots of caches around and just gives you back the previous buffer if it's still around. Still probably not the smartest idea. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch