From: "Christian König" <christian.koenig@amd.com>
To: Julian Orth <ju.orth@gmail.com>, "T.J. Mercier" <tjmercier@google.com>
Cc: corbet@lwn.net, dri-devel@lists.freedesktop.org,
linaro-mm-sig@lists.linaro.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
Sumit Semwal <sumit.semwal@linaro.org>
Subject: Re: Regression due to /sys/kernel/dmabuf/buffers removal
Date: Tue, 5 May 2026 14:41:37 +0200 [thread overview]
Message-ID: <cf945dda-f526-4544-bc43-22f70acb28f5@amd.com> (raw)
In-Reply-To: <CAHijbEXhuVRgkkPA2dAC=njGBU7vpAbxAbsSmxvvPznO-ckVRA@mail.gmail.com>
Hi Julian,
On 5/5/26 14:25, Julian Orth wrote:
> In ab4c3dcf9a71582503b4fb25aeab884c696cab25 ("dma-buf: Remove DMA-BUF
> sysfs stats") the /sys/kernel/dmabuf/buffer directory was removed.
>
> I've been using this interface, specifically the exporter_name file,
> to detect dmabufs created via udmabuf. Such dmabufs show "udmabuf" in
> exporter_name. I've been doing this for two reasons: 1) to detect that
> mmap on such buffers will be fast and 2) to detect that GPU access to
> such buffers will be slow.
Crap, I really hoped that Android was the only user of that sysfs interface since that approach turned out to be quite broken.
It's number one rule on Linux that we don't break userspace. So I hope that you don't insist on bringing that interface back, but if you do I will just revert the removal until we found a better solution.
> With the removal of that file, that detection mechanism no longer works.
>
> I'm not particularly fond of that mechanism but it was the only one
> providing that functionality that I could find at the time. If there
> is another one, ideally an ioctl on the dmabuf, please let me know.
The virtual fdinfo file you can find under /proc/$pid/fdinfo/$fd also contains the exporter name for the DMA-buf.
You can find the full documentation here: https://docs.kernel.org/filesystems/proc.html#dma-buffer-files
Is that sufficient?
Additional to that the debugfs for DMA-buf also contains that information and I'm open to the suggestion with the IOCTL.
Regards,
Christian.
>
> Shipping an entire BPF compiler in my application, which the original
> patch suggests as the replacement, is not an option when the removed
> alternative was simply reading a file.
>
> Thanks, Julian
next prev parent reply other threads:[~2026-05-05 12:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 12:25 Regression due to /sys/kernel/dmabuf/buffers removal Julian Orth
2026-05-05 12:41 ` Christian König [this message]
2026-05-05 12:59 ` Julian Orth
2026-05-05 14:32 ` T.J. Mercier
2026-05-07 11:35 ` Christian König
2026-05-07 11:52 ` T.J. Mercier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf945dda-f526-4544-bc43-22f70acb28f5@amd.com \
--to=christian.koenig@amd.com \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=ju.orth@gmail.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=tjmercier@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox