public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@o2.pl>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: Fw: [PATCH -mm] workqueue: debug possible endless loop in cancel_rearming_delayed_work
Date: Fri, 20 Apr 2007 11:22:01 +0200	[thread overview]
Message-ID: <20070420092201.GC1695@ff.dom.local> (raw)
In-Reply-To: <20070419102122.GA93@tv-sign.ru>

On Thu, Apr 19, 2007 at 02:21:22PM +0400, Oleg Nesterov wrote:
> On 04/19, Andrew Morton wrote:
> > 
> > Begin forwarded message:
> > 
> > Date: Thu, 19 Apr 2007 08:54:04 +0200
> > From: Jarek Poplawski <jarkao2@o2.pl>
> > To: linux-kernel@vger.kernel.org
> > Cc: Ingo Molnar <mingo@elte.hu>
> > Subject: [PATCH -mm] workqueue: debug possible endless loop in cancel_rearming_delayed_work

At first I didn't spotted your thread is "independent" and
from your second message it seems you didn't receive all, you
expected. I wonder, if there is a need and possibility to add
somewhere (I would prefer Linus' tree git's http frontend)
addresses of developers (but not maintainers), who are
interested in CC-ing about some files' patches?. 

...
> Yes. It would be better to use cancel_work_sync() instead of flush_workqueue()
> to make this less possible (because cancel_work_sync() doesn't need to wait for
> the whole ->worklist), but we can't.
> 
> > Maybe this patch could check, if I'm not dreaming...
> 
> Also: cancel_rearming_delayed_work() will hang if it (or cancel_delayed_work())
> was already called.
> 
> I had some ideas how to make this interface reliable, but I can't see how to do
> this without uglification of the current code.

For some time I thought about using a flag (isn't there
one available after NOAUTOREL?), e.g. WORK_STRUCT_CANCEL,
as a sign:

- for a workqueue code: that the work shouldn't be queued,
nor executed, if possiblei, at first possible check.

- for a work function: to stop execution as soon as possible,
even without completing the usual job, at first possible check.

There would be a question, whether the flag should be changed
under a lock for exact synchronisation.

Cheers,
Jarek P.

PS: I hope there is no reason against going with this to lkml

       reply	other threads:[~2007-04-20  9:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070419002548.72689f0e.akpm@linux-foundation.org>
     [not found] ` <20070419102122.GA93@tv-sign.ru>
2007-04-20  9:22   ` Jarek Poplawski [this message]
2007-04-20 17:08     ` Fw: [PATCH -mm] workqueue: debug possible endless loop in cancel_rearming_delayed_work Oleg Nesterov
2007-04-23  9:00       ` Jarek Poplawski
2007-04-23 16:33         ` Oleg Nesterov
2007-04-24 11:53           ` Jarek Poplawski
2007-04-24 18:55             ` Oleg Nesterov
2007-04-25  6:12               ` Jarek Poplawski
2007-04-25 12:20               ` Jarek Poplawski
2007-04-25 12:28                 ` Jarek Poplawski
2007-04-25 12:47                   ` Oleg Nesterov
2007-04-25 14:47                     ` Oleg Nesterov
2007-04-26 12:59                       ` Jarek Poplawski
2007-04-26 16:34                         ` Oleg Nesterov
2007-04-27  5:26                           ` Jarek Poplawski
2007-04-27  7:52                             ` Oleg Nesterov
2007-04-27  9:03                               ` Jarek Poplawski
2007-04-26 13:13                     ` Jarek Poplawski
2007-04-26 16:44                       ` Oleg Nesterov
2007-04-27  5:52                         ` Jarek Poplawski

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=20070420092201.GC1695@ff.dom.local \
    --to=jarkao2@o2.pl \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    /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