[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070427061506.GC997@ff.dom.local>
Date: Fri, 27 Apr 2007 08:15:06 +0200
From: Jarek Poplawski <jarkao2@...pl>
To: Oleg Nesterov <oleg@...sign.ru>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Howells <dhowells@...hat.com>,
David Miller <davem@...emloft.net>,
Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cancel_delayed_work: use del_timer() instead of del_timer_sync()
On Thu, Apr 26, 2007 at 07:29:53PM +0400, Oleg Nesterov wrote:
> On 04/26, Jarek Poplawski wrote:
...
> > > This change should not make any visible difference for the callers,
> > > otherwise it is buggy.
> >
> > IMHO, there is the same visible difference,
> > as between del_timer and del_timer_sync.
>
> Jarek, please, could you be more explicite ? del_timer() and
> del_timer_sync() are different in many ways. What exactly will
> impact the user of cancel_delaye_work ?
OK, I changed my mind. Now, I think it's very probable
this should matter...
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...
So, I think, your proposal should be alternative version,
and current version should stay, so we have a choice.
Just like del_timer and del_timer_sync.
Jarek P.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists