Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Tom Herbert <therbert@google.com>
Cc: Deng-Cheng Zhu <dczhu@mips.com>,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH v2] RPS: Sparse connection optimizations - v2
Date: Fri, 04 May 2012 22:53:27 +0200	[thread overview]
Message-ID: <1336164807.3752.465.camel@edumazet-glaptop> (raw)
In-Reply-To: <1336146448.3752.349.camel@edumazet-glaptop>

On Fri, 2012-05-04 at 17:47 +0200, Eric Dumazet wrote:
> On Fri, 2012-05-04 at 08:31 -0700, Tom Herbert wrote:
> > > I think the mechanisms of rps_dev_flow_table and cpu_flow (in this
> > > patch) are different: The former works along with rps_sock_flow_table
> > > whose CPU info is based on recvmsg by the application. But for the tests
> > > like what I did, there's no application involved.
> > >
> > While rps_sock_flow_table is currently only managed by recvmsg, it
> > still is the general mechanism that maps flows to CPUs for steering.
> > There should be nothing preventing you from populating and managing
> > entries in other ways.
> 
> It might be done from a netfilter module, activated in FORWARD chain for
> example.
> 
> 

A good indicator of the network load of a cpu would be to gather
&per_cpu(softnet_data, cpu)->input_pkt_queue.qlen in an EWMA.


We could dynamically adjust active cpus in RPS set given the load of the
machine.

On low load, cpu handling NIC interrupt could also bypass RPS and avoid
IPI to other cpus for low overhead.

tcpu = map->cpus[((u64) skb->rxhash * map->len) >> 32];

->

	if (map->curlen) {
		tcpu = map->cpus[((u64) skb->rxhash * map->curlen) >> 32];
		if (cpu_online(tcpu)) 
			return tcpu;
	}	
	return -1;

Every second or so (to reduce Out Of Order impact), allow curlen to be
incremented/decremented in [0 .. map->len] if load is
increasing/lowering.

  reply	other threads:[~2012-05-04 20:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03  8:56 [PATCH v2] RPS: Sparse connection optimizations - v2 Deng-Cheng Zhu
2012-05-04  3:22 ` Tom Herbert
2012-05-04  3:39   ` Deng-Cheng Zhu
2012-05-04  4:25   ` Deng-Cheng Zhu
2012-05-04  7:47     ` Eric Dumazet
2012-05-07  6:51       ` Deng-Cheng Zhu
2012-05-07  7:22         ` Eric Dumazet
2012-05-04 15:31     ` Tom Herbert
2012-05-04 15:47       ` Eric Dumazet
2012-05-04 20:53         ` Eric Dumazet [this message]
2012-05-07  6:48       ` Deng-Cheng Zhu
2012-05-07  7:38         ` Eric Dumazet
2012-05-07  8:01           ` Deng-Cheng Zhu
2012-05-07  8:25             ` Eric Dumazet
2012-05-08  6:43               ` Deng-Cheng Zhu

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=1336164807.3752.465.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dczhu@mips.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.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