mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: + drivers-wait-for-threaded-probes-between-initcall-levels.patch added to -mm tree
Date: Fri, 27 Oct 2006 10:09:51 -0700	[thread overview]
Message-ID: <20061027170951.GB9020@kroah.com> (raw)
In-Reply-To: <20061026100939.24bbf536@gondolin.boeblingen.de.ibm.com>

On Thu, Oct 26, 2006 at 10:09:39AM +0200, Cornelia Huck wrote:
> On Wed, 25 Oct 2006 19:12:01 -0700,
> akpm@osdl.org wrote:
> 
> > Subject: drivers: wait for threaded probes between initcall levels
> > From: Andrew Morton <akpm@osdl.org>
> > 
> > The multithreaded-probing code has a problem: after one initcall level (eg,
> > core_initcall) has been processed, we will then start processing the next
> > level (postcore_initcall) while the kernel threads which are handling
> > core_initcall are still executing.  This breaks the guarantees which the
> > layered initcalls previously gave us.
> > 
> > IOW, we want to be multithreaded _within_ an initcall level, but not between
> > different levels.
> > 
> > Fix that up by causing the probing code to wait for all outstanding probes at
> > one level to complete before we start processing the next level.
> > 
> > Cc: Greg KH <greg@kroah.com>
> > Signed-off-by: Andrew Morton <akpm@osdl.org>
> 
> Makes a lot of sense. I guess we could also get rid of
> driver_probe_done() in prepare_namespace() with this patch...
> 
> 
> > +#ifdef CONFIG_PCI_MULTITHREAD_PROBE
> > +static int __init wait_for_probes(void)
> > +{
> > +	DEFINE_WAIT(wait);
> > +
> > +	if (!atomic_read(&probe_count))
> > +		return 0;
> > +	printk(KERN_INFO "%s: waiting for %d threads\n", __FUNCTION__,
> > +			atomic_read(&probe_count));
> > +	while (atomic_read(&probe_count)) {
> > +		prepare_to_wait(&probe_waitqueue, &wait, TASK_UNINTERRUPTIBLE);
> > +		if (atomic_read(&probe_count))
> > +			schedule();
> > +	}
> > +	finish_wait(&probe_waitqueue, &wait);
> > +	return 0;
> > +}
> > +
> > +core_initcall_sync(wait_for_probes);
> > +postcore_initcall_sync(wait_for_probes);
> > +arch_initcall_sync(wait_for_probes);
> > +subsys_initcall_sync(wait_for_probes);
> > +fs_initcall_sync(wait_for_probes);
> > +device_initcall_sync(wait_for_probes);
> > +late_initcall_sync(wait_for_probes);
> > +#endif
> 
> ...if we get rid of this #ifdef.

Yeah, let me play with this a bit, along with your proposed change, I
think it can be cleaned up to be a little more cleaner.

thanks,

greg k-h

      reply	other threads:[~2006-10-27 18:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200610260212.k9Q2CYvw031387@shell0.pdx.osdl.net>
2006-10-26  8:09 ` Cornelia Huck
2006-10-27 17:09   ` Greg KH [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=20061027170951.GB9020@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@osdl.org \
    --cc=cornelia.huck@de.ibm.com \
    --cc=linux-kernel@vger.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®