From: Philipp Stanner <phasta@mailbox.org>
To: "Tvrtko Ursulin" <tursulin@ursulin.net>,
"Christian König" <christian.koenig@amd.com>,
"Philipp Stanner" <phasta@kernel.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, amd-gfx@lists.freedesktop.org,
etnaviv@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
imagination@lists.freedesktop.org, lima@lists.freedesktop.org,
linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
nouveau@lists.freedesktop.org, virtualization@lists.linux.dev,
spice-devel@lists.freedesktop.org,
intel-xe@lists.freedesktop.org, linux-tegra@vger.kernel.org,
linux-iio@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/3] dma-buf: dma-fence: Add flags parameter to dma_fence_init()
Date: Thu, 05 Nov 2026 14:24:04 +0100 [thread overview]
Message-ID: <2fa6e631e133acfc7e7de1b287c8b3983168b1c6.camel@mailbox.org> (raw)
In-Reply-To: <b8179edb-bc59-49af-b8d0-f62e39752f3a@ursulin.net>
On Thu, 2026-11-05 at 12:51 +0000, Tvrtko Ursulin wrote:
> On 05/11/2026 12:35, Christian König wrote:
> > Well one advantage of the Linux kernel is to avoid such wrappers. I
> > think having more than one function for the same thing basically
> > just adds more confusion.
>
> Sure we can churn if we really want. But as 99% of callers will be
> passing 0 it's not even very readable. Another option is variadic like
> kmalloc_objs so flags can be optional. Anyway, for consideration only.
It has the advantage of forcing the reader to think about whether he
wants 64-bit sequence numbers or not. In Rust-fence, for example, we
completely overlooked that for months:
https://lore.kernel.org/rust-for-linux/20261023175750.2979015-2-phasta@kernel.org/
Besides unused flags fields are quite common in APIs. As I state in the
description, this is also for future extensions, see my race-flag (if
accepted) as one potential example.
It could also be used for canonically setting the user-flags, which
users currently do with a manual set_bit(NR, &fence.base.flags;
So I think it's safe to say that it's the right thing for long-term
reduction of churn and maintainability.
P.
next prev parent reply other threads:[~2026-11-05 13:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 11:35 [PATCH 0/3] dma-buf: dma-fence: Remove dma_fence_init64() Philipp Stanner
2026-11-05 11:35 ` [PATCH 1/3] dma-buf: dma-fence: Add flags parameter to dma_fence_init() Philipp Stanner
2026-11-05 12:06 ` Tvrtko Ursulin
2026-11-05 12:35 ` Christian König
2026-11-05 12:48 ` Philipp Stanner
2026-11-05 14:23 ` Christian König
2026-11-05 12:51 ` Tvrtko Ursulin
2026-11-05 13:24 ` Philipp Stanner [this message]
2026-11-05 11:35 ` [PATCH 2/3] dma-buf: Port users of dma_fence_init64() Philipp Stanner
2026-11-05 11:35 ` [PATCH 3/3] dma-buf: dma-fence: Remove dma_fence_init64() Philipp Stanner
2026-11-05 16:32 ` [PATCH 0/3] " Timur Kristóf
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=2fa6e631e133acfc7e7de1b287c8b3983168b1c6.camel@mailbox.org \
--to=phasta@mailbox.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=etnaviv@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=imagination@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=lima@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=phasta@kernel.org \
--cc=spice-devel@lists.freedesktop.org \
--cc=tursulin@ursulin.net \
--cc=virtualization@lists.linux.dev \
/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
all inboxes | Powered by JetHome®