From: Pekka Paalanen <ppaalanen@gmail.com>
To: Rob Clark <robdclark@gmail.com>
Cc: "Rob Clark" <robdclark@chromium.org>,
"Gustavo Padovan" <gustavo@padovan.org>,
"Tvrtko Ursulin" <tvrtko.ursulin@intel.com>,
"Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Michel Dänzer" <michel@daenzer.net>,
"open list" <linux-kernel@vger.kernel.org>,
dri-devel@lists.freedesktop.org,
"Christian König" <christian.koenig@amd.com>,
"moderated list:DMA BUFFER SHARING FRAMEWORK"
<linaro-mm-sig@lists.linaro.org>,
"Luben Tuikov" <luben.tuikov@amd.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
freedreno@lists.freedesktop.org,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"open list:SYNC FILE FRAMEWORK" <linux-media@vger.kernel.org>
Subject: Re: [PATCH v7 06/15] dma-buf/sync_file: Support (E)POLLPRI
Date: Tue, 28 Feb 2023 11:22:38 +0200 [thread overview]
Message-ID: <20230228112238.40e2ad43@eldfell> (raw)
In-Reply-To: <20230227193535.2822389-7-robdclark@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]
On Mon, 27 Feb 2023 11:35:12 -0800
Rob Clark <robdclark@gmail.com> wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> Allow userspace to use the EPOLLPRI/POLLPRI flag to indicate an urgent
> wait (as opposed to a "housekeeping" wait to know when to cleanup after
> some work has completed). Usermode components of GPU driver stacks
> often poll() on fence fd's to know when it is safe to do things like
> free or reuse a buffer, but they can also poll() on a fence fd when
> waiting to read back results from the GPU. The EPOLLPRI/POLLPRI flag
> lets the kernel differentiate these two cases.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> drivers/dma-buf/sync_file.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
> index 418021cfb87c..cbe96295373b 100644
> --- a/drivers/dma-buf/sync_file.c
> +++ b/drivers/dma-buf/sync_file.c
> @@ -192,6 +192,14 @@ static __poll_t sync_file_poll(struct file *file, poll_table *wait)
> {
> struct sync_file *sync_file = file->private_data;
>
> + /*
> + * The POLLPRI/EPOLLPRI flag can be used to signal that
> + * userspace wants the fence to signal ASAP, express this
> + * as an immediate deadline.
> + */
> + if (poll_requested_events(wait) & EPOLLPRI)
> + dma_fence_set_deadline(sync_file->fence, ktime_get());
Hi,
I don't think this doc will appear anywhere where it could be found,
maybe not in kernel HTML doc at all?
I also think this is not a good idea, but not my call.
Thanks,
pq
> +
> poll_wait(file, &sync_file->wq, wait);
>
> if (list_empty(&sync_file->cb.node) &&
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Michel Dänzer" <michel@daenzer.net>,
"Tvrtko Ursulin" <tvrtko.ursulin@intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Simon Ser" <contact@emersion.fr>,
"Luben Tuikov" <luben.tuikov@amd.com>,
"Rob Clark" <robdclark@chromium.org>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Gustavo Padovan" <gustavo@padovan.org>,
"Christian König" <christian.koenig@amd.com>,
linux-media@vger.kernel.org (open list:SYNC FILE FRAMEWORK),
linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER
SHARING FRAMEWORK), linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH v7 06/15] dma-buf/sync_file: Support (E)POLLPRI
Date: Tue, 28 Feb 2023 11:22:38 +0200 [thread overview]
Message-ID: <20230228112238.40e2ad43@eldfell> (raw)
In-Reply-To: <20230227193535.2822389-7-robdclark@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]
On Mon, 27 Feb 2023 11:35:12 -0800
Rob Clark <robdclark@gmail.com> wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> Allow userspace to use the EPOLLPRI/POLLPRI flag to indicate an urgent
> wait (as opposed to a "housekeeping" wait to know when to cleanup after
> some work has completed). Usermode components of GPU driver stacks
> often poll() on fence fd's to know when it is safe to do things like
> free or reuse a buffer, but they can also poll() on a fence fd when
> waiting to read back results from the GPU. The EPOLLPRI/POLLPRI flag
> lets the kernel differentiate these two cases.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> drivers/dma-buf/sync_file.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
> index 418021cfb87c..cbe96295373b 100644
> --- a/drivers/dma-buf/sync_file.c
> +++ b/drivers/dma-buf/sync_file.c
> @@ -192,6 +192,14 @@ static __poll_t sync_file_poll(struct file *file, poll_table *wait)
> {
> struct sync_file *sync_file = file->private_data;
>
> + /*
> + * The POLLPRI/EPOLLPRI flag can be used to signal that
> + * userspace wants the fence to signal ASAP, express this
> + * as an immediate deadline.
> + */
> + if (poll_requested_events(wait) & EPOLLPRI)
> + dma_fence_set_deadline(sync_file->fence, ktime_get());
Hi,
I don't think this doc will appear anywhere where it could be found,
maybe not in kernel HTML doc at all?
I also think this is not a good idea, but not my call.
Thanks,
pq
> +
> poll_wait(file, &sync_file->wq, wait);
>
> if (list_empty(&sync_file->cb.node) &&
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-02-28 9:22 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 19:35 [Intel-gfx] [PATCH v7 00/15] dma-fence: Deadline awareness Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 01/15] dma-buf/dma-fence: Add deadline awareness Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-28 9:21 ` Pekka Paalanen
2023-02-28 9:21 ` Pekka Paalanen
2023-02-28 17:32 ` Rob Clark
2023-02-28 17:32 ` Rob Clark
2023-03-01 3:50 ` Bagas Sanjaya
2023-03-01 3:50 ` Bagas Sanjaya
2023-02-27 19:35 ` [PATCH v7 02/15] dma-buf/fence-array: Add fence deadline support Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 03/15] dma-buf/fence-chain: " Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 04/15] dma-buf/dma-resv: Add a way to set fence deadline Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 05/15] dma-buf/sync_file: Add SET_DEADLINE ioctl Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-28 9:22 ` Pekka Paalanen
2023-02-28 9:22 ` Pekka Paalanen
2023-02-28 19:37 ` Rob Clark
2023-02-28 19:37 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 06/15] dma-buf/sync_file: Support (E)POLLPRI Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-28 9:22 ` Pekka Paalanen [this message]
2023-02-28 9:22 ` Pekka Paalanen
2023-02-27 19:35 ` [PATCH v7 07/15] dma-buf/sw_sync: Add fence deadline support Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-28 9:23 ` Pekka Paalanen
2023-02-28 9:23 ` Pekka Paalanen
2023-02-28 19:47 ` Rob Clark
2023-02-28 19:47 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 08/15] drm/scheduler: " Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 09/15] drm/syncobj: Add deadline support for syncobj waits Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 10/15] drm/vblank: Add helper to get next vblank time Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-28 22:08 ` Mario Kleiner
2023-02-27 19:35 ` [PATCH v7 11/15] drm/atomic-helper: Set fence deadline for vblank Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 12/15] drm/msm: Add deadline based boost support Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 13/15] drm/msm: Add wait-boost support Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 14/15] drm/msm/atomic: Switch to vblank_start helper Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` [Intel-gfx] [PATCH v7 15/15] drm/i915: Add deadline based boost support Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-27 19:35 ` Rob Clark
2023-02-28 12:42 ` [Intel-gfx] [PATCH v7 00/15] dma-fence: Deadline awareness Bagas Sanjaya
2023-02-28 12:42 ` Bagas Sanjaya
2023-02-28 12:42 ` Bagas Sanjaya
2023-02-28 15:44 ` [Intel-gfx] " Rob Clark
2023-02-28 15:44 ` Rob Clark
2023-02-28 15:44 ` Rob Clark
2023-03-01 2:42 ` [Intel-gfx] " Bagas Sanjaya
2023-03-01 2:42 ` Bagas Sanjaya
2023-03-01 2:42 ` Bagas Sanjaya
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=20230228112238.40e2ad43@eldfell \
--to=ppaalanen@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=gustavo@padovan.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=luben.tuikov@amd.com \
--cc=michel@daenzer.net \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=rodrigo.vivi@intel.com \
--cc=sumit.semwal@linaro.org \
--cc=tvrtko.ursulin@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.