netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: matthias.tafelmeier@gmx.net
Cc: netdev@vger.kernel.org, hagen@jauu.net, fw@strlen.de,
	edumazet@google.com, daniel@iogearbox.net
Subject: Re: [PATCH v3] net: dev_weight: TX/RX orthogonality
Date: Wed, 28 Dec 2016 14:17:51 -0500 (EST)	[thread overview]
Message-ID: <20161228.141751.81302085672323860.davem@davemloft.net> (raw)
In-Reply-To: <1482918134-10483-1-git-send-email-matthias.tafelmeier@gmx.net>

From: Matthias Tafelmeier <matthias.tafelmeier@gmx.net>
Date: Wed, 28 Dec 2016 10:42:14 +0100

> @@ -3428,6 +3428,8 @@ EXPORT_SYMBOL(netdev_max_backlog);
>  int netdev_tstamp_prequeue __read_mostly = 1;
>  int netdev_budget __read_mostly = 300;
>  int weight_p __read_mostly = 64;            /* old backlog weight */
> +int dev_weight_rx_bias __read_mostly = 1;            /* bias for backlog weight */
> +int dev_weight_tx_bias __read_mostly = 1;            /* bias for output_queue quota */
>  
>  /* Called with irq disabled */
>  static inline void ____napi_schedule(struct softnet_data *sd,
> @@ -4833,7 +4835,7 @@ static int process_backlog(struct napi_struct *napi, int quota)
>  		net_rps_action_and_irq_enable(sd);
>  	}
>  
> -	napi->weight = weight_p;
> +	napi->weight = weight_p * dev_weight_rx_bias;
>  	while (again) {
>  		struct sk_buff *skb;
>  
 ...
> @@ -247,7 +247,7 @@ static inline int qdisc_restart(struct Qdisc *q, int *packets)
>  
>  void __qdisc_run(struct Qdisc *q)
>  {
> -	int quota = weight_p;
> +	int quota = weight_p * dev_weight_tx_bias;

Ok, this is a lot better than what you proposed initially.

However, being that this is the fast path for all packet processing,
introducing a multiply here doesn't sit well.

I think there are two possible ways to address this:

1) Make the bias instead be a "shift".

2) Precompute the dev_tx_weight and dev_rx_weight into two variables
   in net/core/dev.c  Install a special proc_dointvec handler for
   "dev_weight" that, upon proc_dointvec() success, updates both
   dev_tx_weight and dev_rx_weight based upon the bias settings.

  reply	other threads:[~2016-12-28 19:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-26  9:49 [PATCH v1] net: dev_weight: TX/RX orthogonality Matthias Tafelmeier
2016-12-26 15:52 ` David Miller
     [not found]   ` <ae0712c3-61c6-432e-78d9-665d0c291c9f@gmx.net>
2016-12-26 16:58     ` [PATCH v1] net: dev_weight: TX/RX orthogonality,Re: " David Miller
2016-12-27  8:25       ` [PATCH] " Matthias Tafelmeier
2016-12-27 16:47         ` Marcelo Ricardo Leitner
2016-12-27 17:29           ` Matthias Tafelmeier
2016-12-28  9:42           ` [PATCH v3] " Matthias Tafelmeier
2016-12-28 19:17             ` David Miller [this message]
2016-12-29  9:58               ` [PATCH v4] " Matthias Tafelmeier
2016-12-29 19:08                 ` David Miller
2016-12-29 19:23                   ` Matthias Tafelmeier
2016-12-29 19:44                     ` David Miller
2016-12-29 19:45                       ` David Miller
2016-12-29 19:53                         ` Matthias Tafelmeier
2016-12-29 20:37                         ` [PATCH v5] " Matthias Tafelmeier
2016-12-30  1:16                           ` David Miller
2017-02-13 20:22                             ` Matthias Tafelmeier

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=20161228.141751.81302085672323860.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=daniel@iogearbox.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=hagen@jauu.net \
    --cc=matthias.tafelmeier@gmx.net \
    --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;
as well as URLs for NNTP newsgroup(s).