All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Tejun Heo <tj@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH v2.6.36-rc7] init: don't call flush_scheduled_work() from do_initcalls()
Date: Thu, 21 Oct 2010 17:12:03 -0700	[thread overview]
Message-ID: <20101021171203.37d0d6d6.akpm@linux-foundation.org> (raw)
In-Reply-To: <4CB86F94.7080702@kernel.org>

On Fri, 15 Oct 2010 17:13:24 +0200
Tejun Heo <tj@kernel.org> wrote:

> It's unclear what flush_scheduled_work() in do_initcalls() tries to
> achieve.  The call doesn't make much sense - there already are
> multiple system workqueues which aren't affected by
> flush_scheduled_wokr() and subsystems are free to create and use their
> own.  Ordering requirements are and should be expressed explicitly.
> 
> Drop the call to prepare for deprecation and removal of
> flush_scheduled_work().
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> ---
> If no one objects, I'll route this through wq tree.
> 
> Thank you.
> 
>  init/main.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> Index: work/init/main.c
> ===================================================================
> --- work.orig/init/main.c
> +++ work/init/main.c
> @@ -778,9 +778,6 @@ static void __init do_initcalls(void)
> 
>  	for (fn = __early_initcall_end; fn < __initcall_end; fn++)
>  		do_one_initcall(*fn);
> -
> -	/* Make sure there is no pending stuff from the initcall sequence */
> -	flush_scheduled_work();
>  }
> 

hm, that predates the initial 2002 BK tree.

If some initcall function leaves a work scheduled and doesn't flush it
then free_initmem() can come along and pull the rug out from under its
feet.  Then you will own both pieces :)

If you really don't like people sending you angry emails then I suppose
you could add some warning here if a scheduled work is pending, and
that the scheduled work's callback existed in init.text memory.  Which
would be a bit of a pain to implement.

Oh well.  The oops traces will make it fairly clear what happened.

  parent reply	other threads:[~2010-10-22  0:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15 15:13 [PATCH v2.6.36-rc7] init: don't call flush_scheduled_work() from do_initcalls() Tejun Heo
2010-10-19 15:28 ` Tejun Heo
2010-10-22  0:12 ` Andrew Morton [this message]
2010-10-22  8:27   ` Tejun Heo
2010-10-22 18:09     ` Andrew Morton
2010-11-03 10:59       ` Tejun Heo
2010-11-03 12:48         ` Andrew Morton

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=20101021171203.37d0d6d6.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.