Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dada1@cosmosbay.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] IPV4 : convert rt_check_expire() from softirq processing to workqueue
Date: Sat, 15 Sep 2007 10:58:08 -0700 (PDT)	[thread overview]
Message-ID: <20070915.105808.15258300.davem@davemloft.net> (raw)
In-Reply-To: <20070912153444.bb564a6f.dada1@cosmosbay.com>

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Wed, 12 Sep 2007 15:34:44 +0200

> On loaded/big hosts, rt_check_expire() if of litle use, because it
> generally breaks out of its main loop because of a jiffies change.
> 
> It can take a long time (read : timer invocations) to actually
> scan the whole hash table, freeing unused entries.
> 
> Converting it to use a workqueue instead of softirq is a nice
> move because we can allow rt_check_expire() to do the scan
> it is supposed to do, without hogging the CPU.
> 
> This has an impact on the average number of entries in cache, 
> reducing ram usage. Cache is more responsive to parameter
> changes (/proc/sys/net/ipv4/route/gc_timeout and
> /proc/sys/net/ipv4/route/gc_interval)
> 
> Note: Maybe the default value of gc_interval (60 seconds)
> is too high, since this means we actually need 5 (300/60)
> invocations to scan the whole table.
> 
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

Applied, thanks Eric.  I'm rebasing my net-2.6.24 tree over the
weekend so it may take a little time for this to show up.

It just occurred to me that we need to fix something in these two
workqueue conversions.  If it runs for more than a jiffy this can
unfairly penalize other tasks that want to run on that cpu.

Therefore, we need to add a need_resched() or similar check in the
loop.

      reply	other threads:[~2007-09-15 17:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-12 13:34 [PATCH] IPV4 : convert rt_check_expire() from softirq processing to workqueue Eric Dumazet
2007-09-15 17:58 ` David Miller [this message]

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=20070915.105808.15258300.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dada1@cosmosbay.com \
    --cc=netdev@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