From: Eric Dumazet <eric.dumazet@gmail.com>
To: Tom Herbert <therbert@google.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] rfs: Receive Flow Steering
Date: Fri, 02 Apr 2010 10:35:04 +0200 [thread overview]
Message-ID: <1270197304.1936.179.camel@edumazet-laptop> (raw)
In-Reply-To: <alpine.DEB.1.00.1004012045560.4252@pokey.mtv.corp.google.com>
Le jeudi 01 avril 2010 à 20:59 -0700, Tom Herbert a écrit :
> e1000e on 8 core Intel
> No RFS or RPS 104K tps at 30% CPU
> No RFS (best RPS config): 290K tps at 63% CPU
> RFS 303K tps at 61% CPU
>
> RPC test tps CPU% 50/90/99% usec latency StdDev
> No RFS or RPS 103K 48% 757/900/3185 4472.35
> RPS only: 174K 73% 415/993/2468 491.66
> RFS 223K 73% 379/651/1382 315.61
>
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index b5670ab..ea6ebca 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -543,14 +543,72 @@ struct rps_map {
> };
> #define RPS_MAP_SIZE(_num) (sizeof(struct rps_map) + (_num * sizeof(u16)))
>
> +/*
> + * The rps_dev_flow structure contains the mapping of a flow to a CPU and the
> + * tail pointer for that CPU's input queue at the time of last enqueue.
> + */
> +struct rps_dev_flow {
> + u16 cpu;
please use a 32bit quantity, it is faster on many arches, and avoid a
16bits hole.
> + unsigned int last_qtail;
> +};
> +
> +/*
> + * The rps_dev_flow_table structure contains a table of flow mappings.
> + */
> +struct rps_dev_flow_table {
> + unsigned int mask;
> + struct rcu_head rcu;
> + struct work_struct free_work;
> + struct rps_dev_flow flows[0];
> +};
> +#define RPS_DEV_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_dev_flow_table) + \
> + (_num * sizeof(struct rps_dev_flow)))
> +
> +/*
> + * The rps_sock_flow_table contains mappings of flows to the last CPU
> + * on which they were processed by the application (set in recvmsg).
> + */
> +struct rps_sock_flow_table {
> + unsigned int mask;
> + u16 *ents;
> +};
> +
> +#define RPS_NO_CPU NR_CPUS
using 0xFFFF might be faster
> +
> +static inline void rps_set_sock_flow(struct rps_sock_flow_table *table,
> + u32 hash, int cpu)
> +{
> + if (table->ents && hash) {
> + unsigned int index = hash & table->mask;
> +
> + if (table->ents[index] != cpu)
> + table->ents[index] = cpu;
> + }
> +}
> +
> +static inline void rps_record_sock_flow(struct rps_sock_flow_table *table,
> + u32 hash)
> +{
Hmm, so rps_record_sock_flow() is always called from non preemptable
contextes ?
> + rps_set_sock_flow(table, hash, smp_processor_id());
> +}
> +
> +static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table,
> + u32 hash)
> +{
> + rps_set_sock_flow(table, hash, RPS_NO_CPU);
> +}
> +
Could you respin your patch against latest net-next-2.6, because it
doesnt apply after latest RPS commit from Changli.
Thanks !
next prev parent reply other threads:[~2010-04-02 8:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-02 3:59 [PATCH] rfs: Receive Flow Steering Tom Herbert
2010-04-02 5:04 ` Changli Gao
2010-04-02 7:29 ` Eric Dumazet
2010-04-02 10:58 ` Changli Gao
2010-04-02 12:01 ` Eric Dumazet
2010-04-02 13:45 ` Changli Gao
2010-04-02 17:01 ` Rick Jones
[not found] ` <g2i65634d661004021045uff7c0e25ge7dfd17929bc9ee9@mail.gmail.com>
2010-04-02 18:25 ` Rick Jones
2010-04-08 1:37 ` Changli Gao
2010-04-02 7:58 ` Eric Dumazet
2010-04-02 8:35 ` Eric Dumazet [this message]
2010-04-02 12:37 ` Eric Dumazet
2010-04-02 16:28 ` Eric Dumazet
2010-04-02 19:43 ` Eric Dumazet
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=1270197304.1936.179.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--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