The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: Matthew Brost <matthew.brost@intel.com>
Cc: "Simona Vetter" <simona.vetter@ffwll.ch>,
	"Christian König" <christian.koenig@amd.com>,
	"Philipp Stanner" <phasta@kernel.org>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/sched: Discourage usage of separate workqueues
Date: Wed, 4 Jun 2025 18:53:44 +0200	[thread overview]
Message-ID: <aEB6GOTlC_Z_Rq8b@cassiopeiae> (raw)
In-Reply-To: <aEB4DFFE2C7gElRL@lstrano-desk.jf.intel.com>

On Wed, Jun 04, 2025 at 09:45:00AM -0700, Matthew Brost wrote:
> On Wed, Jun 04, 2025 at 05:07:15PM +0200, Simona Vetter wrote:
> > We should definitely document this trick better though, I didn't find any
> > place where that was documented.
> 
> This is a good idea.

I think - and I also mentioned this a few times in the patch series that added
the workqueue support - we should also really document the pitfalls of this.

If the scheduler shares a workqueue with the driver, the driver needs to take
special care when submitting work that it's not possible to prevent run_job and
free_job work from running by doing this.

For instance, if it's a single threaded workqueue and the driver submits work
that allocates with GFP_KERNEL, this is a deadlock condition.

More generally, if the driver submits N work that, for instance allocates with
GFP_KERNEL, it's also a deadlock condition if N == max_active.

  reply	other threads:[~2025-06-04 16:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04  8:16 [PATCH] drm/sched: Discourage usage of separate workqueues Philipp Stanner
2025-06-04  9:41 ` Christian König
2025-06-04 15:07   ` Simona Vetter
2025-06-04 16:45     ` Matthew Brost
2025-06-04 16:53       ` Danilo Krummrich [this message]
2025-06-04 17:10         ` Matthew Brost
2025-06-06 14:08           ` Simona Vetter
2025-06-05  9:59     ` Philipp Stanner

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=aEB6GOTlC_Z_Rq8b@cassiopeiae \
    --to=dakr@kernel.org \
    --cc=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.brost@intel.com \
    --cc=phasta@kernel.org \
    --cc=simona.vetter@ffwll.ch \
    --cc=simona@ffwll.ch \
    /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