public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Tetsuo Handa" <penguin-kernel@I-love.SAKURA.ne.jp>,
	"Tvrtko Ursulin" <tvrtko.ursulin@intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: avoid flush_scheduled_work() usage
Date: Mon, 06 Mar 2023 13:05:06 +0200	[thread overview]
Message-ID: <87sfeita1p.fsf@intel.com> (raw)
In-Reply-To: <32df5def-ad1a-e1aa-d2fe-f3c37cb01032@I-love.SAKURA.ne.jp>

On Fri, 03 Mar 2023, Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:
> On 2023/03/03 19:11, Tetsuo Handa wrote:
>> @@ -79,6 +81,7 @@ static int __init i915_init(void)
>>  {
>>  	int err, i;
>>  
>> +	i915_wq = alloc_workqueue("i915", 0, 0);
>
> Oops. I forgot to add
>
> 	if (!i915_wq)
> 		return -ENOMEM;
>
> here. But I'd like to wait for your response for a while before submitting v2 patch.

Looks like accounting for every schedule_work() and friends that we have
is pretty difficult at this point, so I agree going for a local
workqueue and flushing that is probably the way to go. Work specific
cleanups can follow.

However, we really don't want to add new module globals, not for this,
not for anything. So for most things it would have to be i915 device
specific. And that, in turn, would have to be two workqueues, one for
display, one for other stuff. Don't want to mix the two.

BR,
Jani.









>
>
>>  	for (i = 0; i < ARRAY_SIZE(init_funcs); i++) {
>>  		err = init_funcs[i].init();
>>  		if (err < 0) {
>> @@ -86,6 +89,7 @@ static int __init i915_init(void)
>>  				if (init_funcs[i].exit)
>>  					init_funcs[i].exit();
>>  			}
>> +			destroy_workqueue(i915_wq);
>>  			return err;
>>  		} else if (err > 0) {
>>  			/*
>> @@ -113,6 +117,7 @@ static void __exit i915_exit(void)
>>  		if (init_funcs[i].exit)
>>  			init_funcs[i].exit();
>>  	}
>> +	destroy_workqueue(i915_wq);
>>  }
>>  
>>  module_init(i915_init);
>

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-03-06 11:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 10:11 [Intel-gfx] [PATCH] drm/i915: avoid flush_scheduled_work() usage Tetsuo Handa
2023-03-03 10:44 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2023-03-03 11:22 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-03 12:49 ` [Intel-gfx] [PATCH] " Tetsuo Handa
2023-03-06 11:05   ` Jani Nikula [this message]
2023-03-06 11:17     ` Tetsuo Handa
2023-03-06 18:56 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork
2023-03-14 11:21 ` [Intel-gfx] [PATCH v2] " Tetsuo Handa
2023-03-15 10:47   ` Luca Coelho
2023-04-14 10:01     ` Tetsuo Handa
2023-04-14 10:13       ` Jani Nikula
2023-04-14 10:52         ` Tetsuo Handa
2023-04-16  7:45           ` Daniel Vetter
2023-05-03 10:06             ` Jani Nikula
2023-05-03 14:00   ` [Intel-gfx] [PATCH v3] " Tetsuo Handa
2023-05-18 14:44     ` [Intel-gfx] [PATCH v4] " Tetsuo Handa
2023-05-19  8:02       ` Tvrtko Ursulin
2023-05-22 10:59       ` [Intel-gfx] [PATCH v5] " Tetsuo Handa
2023-06-10  7:01         ` Jani Nikula
2023-05-03 14:34 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: avoid flush_scheduled_work() usage (rev3) Patchwork
2023-05-03 14:46 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-05-04 19:49 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: avoid flush_scheduled_work() usage (rev4) Patchwork
2023-05-04 20:14 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-05-05  6:33 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-05-18 15:22 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: avoid flush_scheduled_work() usage (rev5) Patchwork
2023-05-18 15:39 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-05-22 13:54 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning for drm/i915: avoid flush_scheduled_work() usage (rev6) Patchwork
2023-05-22 13:55 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: " Patchwork
2023-05-22 13:55 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-05-22 13:55 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-05-22 14:18 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-05-22 20:19 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=87sfeita1p.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=tvrtko.ursulin@intel.com \
    --cc=ville.syrjala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox