public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: rusty@rustcorp.com.au, Andrew Morton <akpm@digeo.com>
Subject: Re: [PATCH] workqueue.c subtle fix and core extraction
Date: Sat, 21 Jun 2003 11:43:08 -0400	[thread overview]
Message-ID: <3EF47D0C.100@pobox.com> (raw)
In-Reply-To: <200306210622.h5L6MRcb011620@hera.kernel.org>

Linux Kernel Mailing List wrote:
> ChangeSet 1.1384, 2003/06/20 22:14:56-07:00, akpm@digeo.com
> 
> 	[PATCH] workqueue.c subtle fix and core extraction
> 	
> 	From: Rusty Russell <rusty@rustcorp.com.au>
> 	
> 	A barrier is needed on workqueue shutdown: there's a chance that the thead
> 	could see the wq->thread set to NULL before the completion is initialized.

Look at the larger problem.

The completion initialization should be done before you call 
kernel_thread to start the worker.

Otherwise, there is a still the general problem:  if any event occurs to 
cause worker_thread to exit its main loop, you hit an uninitialized 
completion.

Just initialize it before you start the kernel thread -- like all the 
other driver kernel thread code does -- and forget about barriers :) 
Needing a barrier here just signals you need further changes.


> 	Also extracts functions which actually create and destroy workqueues, for
> 	use by hotplug CPU patch.

Please do this in separate patches next time.  I'm looking into the 
above change, and including this second change just obfuscated matters 
and slowed down analysis of the first change.

	Jeff




       reply	other threads:[~2003-06-21 15:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200306210622.h5L6MRcb011620@hera.kernel.org>
2003-06-21 15:43 ` Jeff Garzik [this message]
2003-06-22  4:52   ` [PATCH] workqueue.c subtle fix and core extraction Rusty Russell

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=3EF47D0C.100@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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