mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Peterson <cpeterso@cpeterso.com>
To: Richard Kennedy <richard@rsk.demon.co.uk>
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] use round_jiffies() for slow work thread pool's 5 second  cull timer
Date: Sun, 10 May 2009 12:38:46 -0700	[thread overview]
Message-ID: <a24804730905101238m3f561ea9p3bdadf151de53b71@mail.gmail.com> (raw)
In-Reply-To: <4A06E344.4060901@rsk.demon.co.uk>

Yes, you are correct. I misread how round_jiffies_relative() worked.

chris


On Sun, May 10, 2009 at 7:23 AM, Richard Kennedy
<richard@rsk.demon.co.uk> wrote:
> 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@cpeterso.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
>
>

  reply	other threads:[~2009-05-10 19:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-10  7:40 Chris Peterson
2009-05-10 14:23 ` Richard Kennedy
2009-05-10 19:38   ` Chris Peterson [this message]
2009-05-11  0:01 ` [PATCH v2] " Chris Peterson
     [not found]   ` <200905131838.n4DIcu5h023360@imap1.linux-foundation.org>
2009-05-14  9:38     ` [PATCH] Use round_jiffies() for slow work thread pool's cull and OOM timers David Howells
2009-05-13 11:58 ` [PATCH v2] use round_jiffies() for slow work thread pool's 5 second cull timer David Howells
2009-05-13 16:31   ` Chris Peterson
2009-05-13 17:00   ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a24804730905101238m3f561ea9p3bdadf151de53b71@mail.gmail.com \
    --to=cpeterso@cpeterso.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@rsk.demon.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®