mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: davem@davemloft.net
Subject: Re: [NET]: rt_check_expire() can take a long time, add a cond_resched()
Date: Thu, 15 Nov 2007 19:38:02 -0800	[thread overview]
Message-ID: <20071115193802.4ec64eef@laptopd505.fenrus.org> (raw)
In-Reply-To: <200711150401.lAF41mSs021898@hera.kernel.org>

On Thu, 15 Nov 2007 04:01:48 GMT
Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote:

> Gitweb:
> http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d90bf5a976793edfa88d3bb2393f0231eb8ce1e5
> Commit:     d90bf5a976793edfa88d3bb2393f0231eb8ce1e5 Parent:
> 66ba886254edbbd9442d30f1eef6f6fb0145027d Author:     Eric Dumazet
> <dada1@cosmosbay.com> AuthorDate: Wed Nov 14 16:14:05 2007 -0800
> Committer:  David S. Miller <davem@davemloft.net>
> CommitDate: Wed Nov 14 16:14:05 2007 -0800
> 
>     [NET]: rt_check_expire() can take a long time, add a
> cond_resched() 
>     On commit 39c90ece7565f5c47110c2fa77409d7a9478bd5b:

>     When the IP route cache is big, rt_check_expire() can take a long
> time to run.  (default settings : 20% of the hash table is scanned at
> each invocation)
>     
>     Adding cond_resched() helps giving cpu to higher priority tasks if
>     necessary.
>     
>     Using a "if (need_resched())" test before calling
> "cond_resched();" is necessary to avoid spending too much time doing
> the resched check. 

int __sched cond_resched(void)
{
        if (need_resched() &&  .....

somehow I wonder why the second if() is useful at all; it's another
spot for a branch predictor to miss... and a void function call is
really really cheap... 


-- 
If you want to reach me at my work email, use arjan@linux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

       reply	other threads:[~2007-11-16  3:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200711150401.lAF41mSs021898@hera.kernel.org>
2007-11-16  3:38 ` Arjan van de Ven [this message]
2007-11-16  3:48   ` Eric Dumazet
2007-11-16  4:12     ` Eric Dumazet
2007-11-16  5:59       ` Arjan van de Ven
2007-11-17 12:56         ` Andi Kleen
2007-11-17 15:21           ` Herbert Xu
2007-11-18  0:03           ` David Miller
2007-11-16  4:07   ` David Miller

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=20071115193802.4ec64eef@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    /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®