[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A06E344.4060901@rsk.demon.co.uk>
Date: Sun, 10 May 2009 15:23:00 +0100
From: Richard Kennedy <richard@....demon.co.uk>
To: Chris Peterson <cpeterso@...terso.com>
CC: dhowells@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] use round_jiffies() for slow work thread pool's 5 second
cull timer
Chris Peterson wrote:
> The slow work thread pool culls its idle threads after 5 seconds without any work requests. Also, the slow work thread pool waits 5 seconds before starting new threads after OOM.
>
> This patch uses round_jiffies() to round these 5 second timers to whole seconds. In this case, the actual timer wait would be between 4.75 and 5.75 seconds (because round_jiffies() rounds < 0.25 seconds down and > 0.25 seconds up). This patch also refactors the mod_timer() logic into a separate helper function.
>
> Signed-off-by: Chris Peterson <cpeterso@...terso.com>
> ---
> diff --git a/kernel/slow-work.c b/kernel/slow-work.c
> index b28d191..9bfcb53 100644
> --- a/kernel/slow-work.c
> +++ b/kernel/slow-work.c
> @@ -318,6 +318,12 @@ cant_get_ref:
> }
> EXPORT_SYMBOL(slow_work_enqueue);
>
> +static void slow_work_defer_cull_time(void)
> +{
> + mod_timer(&slow_work_cull_timer,
> + round_jiffies_relative(SLOW_WORK_CULL_TIMEOUT));
> +}
> +
Hi Chris,
Doesn't mod_timer take an absolute time not a relative one?
So I think this should be
mod_timer(&timer,round_jiffies(jiffies + TIMEOUT) );
regards
Richard
--
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