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:	Tue, 24 May 2011 15:54:17 +0800
From:	Yong Zhang <yong.zhang0@...il.com>
To:	Sebastian Andrzej Siewior <sebastian@...akpoint.cc>
Cc:	Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] timers: consider slack value in mod_timer()

On Sat, May 21, 2011 at 6:58 PM, Sebastian Andrzej Siewior
<sebastian@...akpoint.cc> wrote:
> There is an optimization which does not update the timer if the timer
> was pending and the expiration time was unchanged.
> Since commit 3bbb9ec9 ("timers: Introduce the concept of timer slack for
> legacy timers") this optimization is no longer applied for timers where
> the expiration time got extended due to the slack value. So here it adds
> the check again after the expiration time might have been updated.
>
> Signed-off-by: Sebastian Andrzej Siewior <sebastian@...akpoint.cc>
> ---
>  kernel/timer.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/timer.c b/kernel/timer.c
> index fd61986..bf09726 100644
> --- a/kernel/timer.c
> +++ b/kernel/timer.c
> @@ -804,6 +804,8 @@ int mod_timer(struct timer_list *timer, unsigned long expires)
>                return 1;
>
>        expires = apply_slack(timer, expires);

So, why not move above line up, then we can use the recalculated
expires?

Thanks,
Yong

> +       if (timer_pending(timer) && timer->expires == expires)
> +               return 1;
>
>        return __mod_timer(timer, expires, false, TIMER_NOT_PINNED);
>  }
> --
> 1.7.4.4
>
> --
> 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/
>



-- 
Only stand for myself
--
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