All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.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: Wed, 03 Nov 2010 11:59:21 +0100	[thread overview]
Message-ID: <4CD14089.7050709@kernel.org> (raw)
In-Reply-To: <20101022110925.ea1263f8.akpm@linux-foundation.org>

Hello, Andrew.

On 10/22/2010 08:09 PM, Andrew Morton wrote:
> mm..  I think we'd be OK to merge it.  Any such code is pretty badly
> buggy and is probably also crashable with a well-timed rmmod.
> 
> It'll also be code which few people ever use, so any runtime checks
> won't get us very good coverage.
> 
> Still, if it's not too hard to implement an "are there any scheduled
> works which live in initmem" check then I guess that would be the
> prudent approach.  A quite gross way of implementing that might be
> something like

I've been trying to implement proper check code but there is a
problem.  It's possible to check all pending works to see whether the
work struct itself or the work function is in initmem and warn about
them.

The problem is with currently running works.  As work_struct isn't
accessible once it starts executing, struct worker would need to cache
it for later reference.  Worker already remembers the work_struct
pointer itself and its cwq and adding one more field to remember the
currently running work function is easy.  However, it's only useful
during the unlikely buggy case during init.  Given that if anything is
still depending on initmem, it will blow up pretty reliably, I don't
think it's worthwhile to add additional tracking just for this.  So, I
think I'll just go ahead and drop the flush call and deal with the
unlikely fallouts if there's any.

Thank you.

-- 
tejun

  reply	other threads:[~2010-11-03 11:00 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
2010-10-22  8:27   ` Tejun Heo
2010-10-22 18:09     ` Andrew Morton
2010-11-03 10:59       ` Tejun Heo [this message]
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=4CD14089.7050709@kernel.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --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.