All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: Jarek Poplawski <jarkao2@o2.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Howells <dhowells@redhat.com>,
	David Miller <davem@davemloft.net>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cancel_delayed_work: use del_timer() instead of del_timer_sync()
Date: Fri, 27 Apr 2007 11:23:49 +0400	[thread overview]
Message-ID: <20070427072349.GA106@tv-sign.ru> (raw)
In-Reply-To: <20070427061506.GC997@ff.dom.local>

On 04/27, Jarek Poplawski wrote:
>
> According to workqueue.h:
> > /*
> >  * Kill off a pending schedule_delayed_work().  Note that the work callback
> >  * function may still be running on return from cancel_delayed_work().  Run
> >  * flush_workqueue() or cancel_work_sync() to wait on it.
> >  */
> > static inline int cancel_delayed_work(struct delayed_work *work)
> 
> So, we can do something like this:
> 
> cancel_delayed_work(dwork);
> flush_workqueue(wq);
> kfree(some_obj_used_by_dwork_func);
> 
> And this is enough to work with not rearming work.
> 
> But no more after this patch...

Yes, you are right, and so this patch is wrong.

This is even documented in the changelog, with this change cancel_delayed_work()
may return while the queueing is in progress. However, in that case we can not
rely on flush_workqueue/cancel_work_sync.

Thanks a lot!

Oleg.


      reply	other threads:[~2007-04-27  7:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-24 21:50 [PATCH] cancel_delayed_work: use del_timer() instead of del_timer_sync() Oleg Nesterov
2007-04-25 10:04 ` David Howells
2007-04-25 13:02 ` Jarek Poplawski
2007-04-25 12:52   ` Oleg Nesterov
2007-04-26 14:29     ` Jarek Poplawski
2007-04-26 15:29       ` Oleg Nesterov
2007-04-27  6:15         ` Jarek Poplawski
2007-04-27  7:23           ` Oleg Nesterov [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=20070427072349.GA106@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=jarkao2@o2.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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.