netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: Robert Olsson <Robert.Olsson@data.slu.se>
Cc: kuznet@ms2.inr.ac.ru, Robert.Olsson@data.slu.se, netdev@oss.sgi.com
Subject: Re: [PATCH] repairing rtcache killer
Date: Wed, 6 Aug 2003 00:52:24 -0700	[thread overview]
Message-ID: <20030806005224.4798f744.davem@redhat.com> (raw)
In-Reply-To: <16175.58503.134543.310459@robur.slu.se>

On Tue, 5 Aug 2003 19:08:23 +0200
Robert Olsson <Robert.Olsson@data.slu.se> wrote:

> 
> kuznet@ms2.inr.ac.ru writes:
>  > #   Two serious and interesting mistakes were made in the patch of 2003-06-16.

Mama mia!  This patch exists in 2.4.22-preX too, so full fix
becomes more urgent.

>  For autotuning I think we can have help from a ratio of warm cache
>  hits (in_hit) and misses (in_slow_tot) to set threshhold to trim
>  hash chain lengths.

Yes, I agree, and algorithm can be even not too smart, something like
the following.

Before scan loop, we compute:

	in_hit = in_slow_tot = 0;
	for (i = 0; i < NR_CPUS; i++) {
		if (!cpu_possible(i))
			continue;
		in_hit += per_cpu_ptr(rt_cache_stat, i)->in_hit;
		in_slow_tot += per_cpu_ptr(rt_cache_stat, i)->in_slow_tot;
	}

	aggressive = 0;
	if (in_hit < (in_slow_tot >> 2))
		aggressive = 1;

	thresh = ip_rt_gc_elasticity;
	if (!aggressive)
		thresh <<= 1;

Then the purging test becomes:

	if (chain_length > thresh ||
	    (aggressive &&
	     chain_length > 1 &&
	     !(min_score & (1<<31)))) {
		*candp = cand->u.rt_next;
		rt_free(cand);
	}

To make algorithm cheaper, we can even use only the current
cpu's rt_cache_stat in order to make our decisions about whether
to enter agressive mode or not.

Alexey, given all this what would you like to do?  Should I push
your patch urgently into 2.4.x or spend some more time trying to
solve this issue?

  reply	other threads:[~2003-08-06  7:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-05 13:40 [PATCH] repairing rtcache killer kuznet
2003-08-05 17:08 ` Robert Olsson
2003-08-06  7:52   ` David S. Miller [this message]
2003-08-06 17:23     ` Robert Olsson
2003-08-06 18:06       ` kuznet
2003-08-06 18:50         ` Robert Olsson
2003-08-06 19:01           ` kuznet
2003-08-06 21:23     ` kuznet
2003-08-06 22:57       ` Robert Olsson
2003-08-06 17:14   ` kuznet
2003-08-06 17:01 ` Robert Olsson
2003-08-06 17:58   ` kuznet
2003-08-06 18:20     ` Robert Olsson
2003-08-06 18:34       ` kuznet

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=20030806005224.4798f744.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=Robert.Olsson@data.slu.se \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@oss.sgi.com \
    /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;
as well as URLs for NNTP newsgroup(s).