lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 26 Apr 2007 19:29:53 +0400
From:	Oleg Nesterov <oleg@...sign.ru>
To:	Jarek Poplawski <jarkao2@...pl>
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 04/26, Jarek Poplawski wrote:
>
> On Wed, Apr 25, 2007 at 04:52:14PM +0400, Oleg Nesterov wrote:
> > 
> > >                                                  It seems this
> > > change cannot do any harm, but anyway it could change a few
> > > things, e.g. with current version of cancel_rearming_delayed_work
> > > some flush_workqueue could be done needlessly, before the work
> > > is queued from timer.
> > 
> > I don't think so... Could you clarify?
> 
> With a code like:
> 
> if (!cancel_delayed_work(dwork))
> 	flush_workqueue(wq);
> 	
> if cancel_ returns 0, and there is _queue_work in progress,
> flush_ will be done once, after this work is queued.
> 
> After the patch, and the same situation flush_ also runs
> one time, but maybe without the work in a queue.

First, this is very unlikely event, and the behaviour is correct,
do you agree?

Even in this case, it is very unlikely that flush_cpu_workqueue()
will take cwq->lock before extremely short delayed_work_timer_fn.

Even if it does, work->func() likely will be completed when the
caller of flush_workqueue() will be woken by run_workquue() and
gets CPU.

Please also look at http://marc.info/?t=117699337200022&r=1

> > >                       It's not a big deal here, but if anybody
> > > did something like this without loop - it could matter.
> > > 
> > > So, probably a lot of current code should be checked, before
> > > applying and I doubt the gain is worth of this. Maybe, for
> > > safety, make this with new name as an alternative and
> > > deprecate the current version?
> > 
> > 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 ?

Oleg.

-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ