mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luben Tuikov <ltuikov89@gmail.com>
To: "Philipp Stanner" <phasta@kernel.org>,
	"Lyude Paul" <lyude@redhat.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Christian König" <ckoenig.leichtzumerken@gmail.com>,
	"Dave Airlie" <airlied@redhat.com>,
	"Tvrtko Ursulin" <tursulin@ursulin.net>
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] drm/sched: Make drm_sched_entity_kill() a public function
Date: Fri, 17 Apr 2026 00:35:58 -0400	[thread overview]
Message-ID: <7b4509b0-9c35-40ca-9388-881236c82a32@gmail.com> (raw)
In-Reply-To: <20260415144956.272506-2-phasta@kernel.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 2028 bytes --]

On 2026-04-15 10:49, Philipp Stanner wrote:
> Some drivers do not care on teardown whether the last jobs pending in an
> entity are actually executed before teardown completed. For such
> scenarios, drm_sched_entity_flush() is not the ideal function since it's
> intended to wait for jobs to complete.
> 
> Make drm_sched_entity_kill() public for that use-case and update the
> documentation.

This is a good patch and great suggestion by Danilo.

> 
> Suggested-by: Danilo Krummrich <dakr@kernel.org>
> Signed-off-by: Philipp Stanner <phasta@kernel.org>
> ---
> Changes in v2:
>   - Improve wording, fix typo.
> ---
>  drivers/gpu/drm/scheduler/sched_entity.c | 13 +++++++++++--
>  include/drm/gpu_scheduler.h              |  1 +
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
> index 61a4818cc87b..7be5811b90cd 100644
> --- a/drivers/gpu/drm/scheduler/sched_entity.c
> +++ b/drivers/gpu/drm/scheduler/sched_entity.c
> @@ -267,8 +267,16 @@ static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,
>  	schedule_work(&job->work);
>  }
>  
> -/* Remove the entity from the scheduler and kill all pending jobs */
> -static void drm_sched_entity_kill(struct drm_sched_entity *entity)
> +/**
> + * drm_sched_entity_kill - kill an entity's pending jobs and remove it
> + * @entity: the entity to remove
> + *
> + * Removes the entity from the scheduler's run queue and kills all pending jobs.
> + *
> + * This function should be used over drm_sched_entity_flush() if it is not
> + * desired to actually wait for all pending jobs to finish.
> + */

I felt that the email body above describing this patch was somewhat clearer. Perhaps something like:
(Notice the change "if" --> "when".)

"Use this function over drm_sched_entity_flush(), when the caller is not interested to wait
 for pending jobs to complete. This function kills any pending jobs."

-- 
Regards,
Luben

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 677 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

      parent reply	other threads:[~2026-04-17  4:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 14:49 Philipp Stanner
2026-04-15 14:49 ` [PATCH v2 2/2] drm/nouveau: Fix double call to drm_sched_entity_fini() Philipp Stanner
2026-04-16 20:12 ` [PATCH v2 1/2] drm/sched: Make drm_sched_entity_kill() a public function Danilo Krummrich
2026-04-17  4:35 ` Luben Tuikov [this message]

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=7b4509b0-9c35-40ca-9388-881236c82a32@gmail.com \
    --to=ltuikov89@gmail.com \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=phasta@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tursulin@ursulin.net \
    --cc=tzimmermann@suse.de \
    /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

Powered by JetHome