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, David Howells <dhowells@redhat.com>
Subject: Re: Fw: [PATCH -mm] workqueue: debug possible endless loop in cancel_rearming_delayed_work
Date: Fri, 27 Apr 2007 07:52:02 +0200 [thread overview]
Message-ID: <20070427055202.GB997@ff.dom.local> (raw)
In-Reply-To: <20070426164436.GB1933@tv-sign.ru>
On Thu, Apr 26, 2007 at 08:44:36PM +0400, Oleg Nesterov wrote:
> On 04/26, Jarek Poplawski wrote:
> >
> > On Wed, Apr 25, 2007 at 04:47:14PM +0400, Oleg Nesterov wrote:
> > ...
> > > > > > + spin_lock_irq(&cwq->lock);
> > > > > > + /* CPU_DEAD in progress may change cwq */
> > > > > > + if (likely(cwq == get_wq_data(work))) {
> > > > > > + list_del_init(&work->entry);
> > > > > > + __set_bit(WORK_STRUCT_PENDING, work_data_bits(work));
> > > > > > + retry = try_to_del_timer_sync(&dwork->timer) < 0;
> > > > > > + }
> > > > > > + spin_unlock_irq(&cwq->lock);
> > > > > > + } while (unlikely(retry));
> > >
> > > > 1. If delayed_work_timer_fn of this work is fired and is waiting
> > > > on the above spin_lock then, after above spin_unlock, the work
> > > > will be queued.
> > >
> > > No, in that case try_to_del_timer_sync() returns -1.
> >
> > Yes. But I think it's safe only after moving work_clear_pending
> > in run_workqueue under a lock; probably otherwise there is a
> > possibility this flag could be cleared, after above unlock.
>
> It doesn't matter in this particular case because we are going to retry
> anyway. But yes, this patch moves work_clear_pending() under lock, because
> otherwise it could be cleared by run_workqueue() if this work is about
> to be executed, but was already deleted from list.
...and it seems to be the same what I meant...
I wanted only to make agree (now it's only for historical reasons)
the lock on _PENDING could matter in run_workqueue.
Jarek P.
prev parent reply other threads:[~2007-04-27 5:46 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
2007-04-20 17:08 ` 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 [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=20070427055202.GB997@ff.dom.local \
--to=jarkao2@o2.pl \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--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
all inboxes | Powered by JetHome®