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:   Tue, 17 Oct 2017 11:44:46 +0200
From:   Jan Kara <jack@...e.cz>
To:     Kees Cook <keescook@...omium.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, Jan Kara <jack@...e.cz>,
        Johannes Weiner <hannes@...xchg.org>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        Matthew Wilcox <mawilcox@...rosoft.com>,
        Jeff Layton <jlayton@...hat.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] writeback: Convert timers to use timer_setup()

On Mon 16-10-17 15:59:13, Kees Cook wrote:
> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly.
> 
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Jan Kara <jack@...e.cz>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Vladimir Davydov <vdavydov.dev@...il.com>
> Cc: Matthew Wilcox <mawilcox@...rosoft.com>
> Cc: Jeff Layton <jlayton@...hat.com>
> Cc: linux-mm@...ck.org
> Signed-off-by: Kees Cook <keescook@...omium.org>

The patch looks good. You can add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  mm/page-writeback.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index 94854e243b11..65ba42c7c7da 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -628,9 +628,9 @@ EXPORT_SYMBOL_GPL(wb_writeout_inc);
>   * On idle system, we can be called long after we scheduled because we use
>   * deferred timers so count with missed periods.
>   */
> -static void writeout_period(unsigned long t)
> +static void writeout_period(struct timer_list *t)
>  {
> -	struct wb_domain *dom = (void *)t;
> +	struct wb_domain *dom = from_timer(dom, t, period_timer);
>  	int miss_periods = (jiffies - dom->period_time) /
>  						 VM_COMPLETIONS_PERIOD_LEN;
>  
> @@ -653,8 +653,7 @@ int wb_domain_init(struct wb_domain *dom, gfp_t gfp)
>  
>  	spin_lock_init(&dom->lock);
>  
> -	setup_deferrable_timer(&dom->period_timer, writeout_period,
> -			       (unsigned long)dom);
> +	timer_setup(&dom->period_timer, writeout_period, TIMER_DEFERRABLE);
>  
>  	dom->dirty_limit_tstamp = jiffies;
>  
> -- 
> 2.7.4
> 
> 
> -- 
> Kees Cook
> Pixel Security
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ