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] [day] [month] [year] [list]
Date:	Fri, 22 Aug 2014 18:52:49 +0200 (CEST)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Joe Perches <joe@...ches.com>
cc:	Dan Williams <dan.j.williams@...el.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Dave Young <hidave.darkstar@...il.com>,
	Manuel Schölling <manuel.schoelling@....de>,
	Vinod Koul <vinod.koul@...el.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
	"dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] ioat: Use time_before()



On Thu, 21 Aug 2014, Joe Perches wrote:

> On Thu, 2014-08-21 at 10:10 -0700, Dan Williams wrote:
> > On Thu, May 22, 2014 at 1:11 PM, Manuel Schölling
> > <manuel.schoelling@....de> wrote:
> > > To be future-proof and for better readability the time comparisons are modified
> > > to use time_before() instead of plain, error-prone math.
> []
> > > diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
> []
> > > @@ -735,7 +735,8 @@ int ioat2_check_space_lock(struct ioat2_dma_chan *ioat, int num_descs)
> > >          * called under bh_disabled so we need to trigger the timer
> > >          * event directly
> > >          */
> > > -       if (jiffies > chan->timer.expires && timer_pending(&chan->timer)) {
> > > +       if (time_before(chan->timer.expires, jiffies)
> > > +           && timer_pending(&chan->timer)) {
> > >                 struct ioatdma_device *device = chan->device;
> > 
> > Thanks, let's use time_is_before_jiffies() for this cleanup... I'll
> > fix up and apply.
> 
> There are thousands of uses of time_before( and time_after(
> with jiffies, and 6 years after being added, a little more
> than a dozen or so of time_is_[before|after]_jiffies.
> 
> I also think the "time_is_[before|after]_jiffies" macros are
> not very well named.
> 
> Using them is more text than using jiffies directly.
> There is a small benefit in argument ordering correctness.
> 
> 	time_after(jiffies, foo)
> 	time_is_after_jiffies(foo)
> 
> I'd rather just drop jiffies altogether
> 	time_is_after(foo)
> or maybe add and use
> 	jiffies_is_after(foo)

jiffies_is_after is very understandable.  The others seem to require some 
thought.

julia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ