mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Tejun Heo <tj@kernel.org>
Cc: <intel-xe@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<jiangshanlai@gmail.com>, <simona.vetter@ffwll.ch>,
	<christian.koenig@amd.com>, <pstanner@redhat.com>,
	<dakr@kernel.org>
Subject: Re: [RFC PATCH 1/3] workqueue: Add an interface to taint workqueue lockdep with reclaim
Date: Mon, 27 Oct 2025 14:58:52 -0700	[thread overview]
Message-ID: <aP/rHN4Ei04Tj49n@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <aPg4jKrlYajO7jd_@slm.duckdns.org>

On Tue, Oct 21, 2025 at 03:51:08PM -1000, Tejun Heo wrote:
> On Tue, Oct 21, 2025 at 06:22:19PM -0700, Matthew Brost wrote:
> > > please update the patch so that WQ_MEM_RECLAIM implicitly enables the
> > > checking?
> > 
> > Sure, but a bunch of things immediately break—including a convoluted
> > case in my driver. I can fix the kernel to the extent that my CI catches
> > issues, and fix any obvious cases through manual inspection. However,
> > I suspect that if we merge this, we'll be dealing with fallout
> > throughout a kernel RC cycle.
> 
> Sure, we're still early in this cycle and can try to resolve as much as
> possible and if there's just too much, we can make it optional and so on.
> 

I’ve come to the conclusion that the entire kernel is going to explode
if all WQ_MEM_RECLAIM workqueues are annotated with lockdep. I made this
change and tried booting Linux, but quickly ran into five issues before
giving up. It seems that many parts of the kernel allocate memory with
GFP_KERNEL or take locks that allocate memory in workqueues marked with
WQ_MEM_RECLAIM.

There are literally hundreds of workqueues created with WQ_MEM_RECLAIM,
both directly [1] and via the create*workqueue helpers, which also set
this flag.

So, what’s your advice here? Personally, I don’t have the bandwidth to
drive fixing the entire kernel. Maybe we could add the annotation
helpers introduced in this series, so drivers that really want to
enforce this rule—like the DRM driver—can opt in? And perhaps we could
add a export Kconfig option that enables this for all WQ_MEM_RECLAIM
workqueues, and let the community gradually enable it and start fixing
their code?

Matt

[1] https://elixir.bootlin.com/linux/v6.17.5/C/ident/WQ_MEM_RECLAIM

> Thanks.
> 
> -- 
> tejun

  reply	other threads:[~2025-10-27 21:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 21:39 [RFC PATCH 0/3] Enforce DRM scheduler reclaim rules Matthew Brost
2025-10-21 21:39 ` [RFC PATCH 1/3] workqueue: Add an interface to taint workqueue lockdep with reclaim Matthew Brost
2025-10-21 21:56   ` Tejun Heo
2025-10-21 22:04     ` Matthew Brost
2025-10-21 22:06       ` Matthew Brost
2025-10-21 23:25         ` Tejun Heo
2025-10-22  1:16           ` Matthew Brost
2025-10-21 23:28       ` Tejun Heo
2025-10-22  1:22         ` Matthew Brost
2025-10-22  1:51           ` Tejun Heo
2025-10-27 21:58             ` Matthew Brost [this message]
2025-10-28  9:32   ` Christian König
2025-10-28 20:16     ` Matthew Brost
2025-10-29  9:48       ` Christian König
2025-10-29 15:06       ` Tejun Heo
2025-10-29 16:46         ` Matthew Brost
2025-10-29 18:16           ` Tejun Heo
2025-10-21 21:39 ` [RFC PATCH 2/3] drm/sched: Taint workqueues " Matthew Brost
2025-10-27 11:03   ` Philipp Stanner
2025-10-27 17:00     ` Matthew Brost
2025-10-21 21:39 ` [RFC PATCH 3/3] drm/sched: Prevent adding dependencies to an armed job Matthew Brost
2025-10-27 11:13   ` Philipp Stanner
2025-10-27 16:56     ` Matthew Brost
2025-10-28  9:27       ` 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=aP/rHN4Ei04Tj49n@lstrano-desk.jf.intel.com \
    --to=matthew.brost@intel.com \
    --cc=christian.koenig@amd.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pstanner@redhat.com \
    --cc=simona.vetter@ffwll.ch \
    --cc=tj@kernel.org \
    /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®