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 63C2BC433E9 for ; Wed, 3 Feb 2021 10:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 190F964F9A for ; Wed, 3 Feb 2021 10:24:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233731AbhBCKY3 (ORCPT ); Wed, 3 Feb 2021 05:24:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233554AbhBCKYZ (ORCPT ); Wed, 3 Feb 2021 05:24:25 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A30C061786 for ; Wed, 3 Feb 2021 02:23:44 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id i9so4651167wmq.1 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=DXVe4gioF/nYt+AhicYQlwqty63nx/yUVhi6LQo45uo25GEkxwS/327fu1X9/8kfma XXkNyxhtS/lSWzhcKDn1mjaBRQELEvQEy9r3uEYvK83KiwDX+VnGKsM6+SEvL8mEWR/E FFuxWSjpTlesdqVvBuq7Fo4swj/i21cBYjnWCc1qIOIq90cUmztOtBPNWfJ88JXRez3H 1JavYNez/T05CEc5hv19Dmh7X9oiG9CiqK+0R3HPbY4EvXrphJAFhJT0POiMQ+sus2J2 dFZEErU4xGV7pShtmGazr08Imiq5TqssV29HujUFUjzGPRk44OIRlNkOYZdy6Wf/HT1w V/ow== X-Gm-Message-State: AOAM533nZMZ21tao+JLxipqC+O4ghKXp8gHljbdpvg6Ryyv8FXpLYMka 15FCdZv6gvyxwElOc1rq0UOVKQ== 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-api@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