public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Mark_H_Johnson@Raytheon.com
Cc: "K.R. Foley" <kr@cybsft.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Felipe Alfaro Solana <lkml@felipe-alfaro.com>,
	Daniel Schmitt <pnambic@unu.nu>,
	Lee Revell <rlrevell@joe-job.com>
Subject: Re: [patch] voluntary-preempt-2.6.9-rc1-bk4-Q5
Date: Wed, 1 Sep 2004 09:30:56 +0200	[thread overview]
Message-ID: <20040901073056.GA20020@elte.hu> (raw)
In-Reply-To: <OF8AC76C1C.20634F1C-ON86256F00.007813C0@raytheon.com>

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]


* Mark_H_Johnson@Raytheon.com <Mark_H_Johnson@Raytheon.com> wrote:

> >regarding this particular latency, could you try the attached patch
> >ontop of -Q5? It turns the ->poll() loop into separate, individually
> >preemptable iterations instead of one batch of processing. In theory
> >this should result in latency being lower regardless of the
> >netdev_max_backlog value.

> In all cases, Ctrl-Alt-Del was good enough to get a clean reboot.
> 
> This looks like a bad patch; will go back to the last good kernel for
> further testing.

ok, i think i found why it broke for you - forgot to update 'budget' in
the else branch. Could you try the attached patch ontop of -Q5? You'll
get a new sysctl as /proc/sys/net/core/netdev_backlog_granularity, with
a default value of 1. This should result in a working system with a
healthy backlog but with the preemption properties of netdev_max_backlog
== 1. Increasing the granularity will do give more chunkyness of
processing. Do you still get long RX latencies with the finest
granularity of 1, without any of the bad side-effects like booting
problems or lost packets?

	Ingo

[-- Attachment #2: rx-granularity.patch --]
[-- Type: text/plain, Size: 1949 bytes --]

--- linux/net/core/dev.c.orig
+++ linux/net/core/dev.c
@@ -1403,6 +1403,7 @@ out:
   =======================================================================*/
 
 int netdev_max_backlog = 8;
+int netdev_backlog_granularity = 1;
 int weight_p = 64;            /* old backlog weight */
 /* These numbers are selected based on intuition and some
  * experimentatiom, if you have more scientific way of doing this
@@ -1903,7 +1904,8 @@ static void net_rx_action(struct softirq
 {
 	struct softnet_data *queue = &__get_cpu_var(softnet_data);
 	unsigned long start_time = jiffies;
-	int budget = netdev_max_backlog;
+	int budget = netdev_max_backlog, left,
+		gran = netdev_backlog_granularity;
 
 	
 	local_irq_disable();
@@ -1926,7 +1928,8 @@ static void net_rx_action(struct softirq
 		dev = list_entry(queue->poll_list.next,
 				 struct net_device, poll_list);
 
-		if (dev->quota <= 0 || dev->poll(dev, &budget)) {
+		left = gran;
+		if (dev->quota <= 0 || dev->poll(dev, &left)) {
 			local_irq_disable();
 			list_del(&dev->poll_list);
 			list_add_tail(&dev->poll_list, &queue->poll_list);
@@ -1938,6 +1941,7 @@ static void net_rx_action(struct softirq
 			dev_put(dev);
 			local_irq_disable();
 		}
+		budget -= gran - left;
 	}
 out:
 	local_irq_enable();
--- linux/net/core/sysctl_net_core.c.orig
+++ linux/net/core/sysctl_net_core.c
@@ -12,7 +12,7 @@
 
 #ifdef CONFIG_SYSCTL
 
-extern int netdev_max_backlog;
+extern int netdev_max_backlog, netdev_backlog_granularity;
 extern int weight_p;
 extern int no_cong_thresh;
 extern int no_cong;
@@ -99,6 +99,14 @@ ctl_table core_table[] = {
 		.proc_handler	= &proc_dointvec
 	},
 	{
+		.ctl_name	= NET_CORE_MAX_BACKLOG,
+		.procname	= "netdev_backlog_granularity",
+		.data		= &netdev_backlog_granularity,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec
+	},
+	{
 		.ctl_name	= NET_CORE_NO_CONG_THRESH,
 		.procname	= "no_cong_thresh",
 		.data		= &no_cong_thresh,

  parent reply	other threads:[~2004-09-01  7:30 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-30 22:04 [patch] voluntary-preempt-2.6.9-rc1-bk4-Q5 Mark_H_Johnson
2004-08-31  6:31 ` Ingo Molnar
2004-09-01  7:30 ` Ingo Molnar [this message]
     [not found] <OFD220F58F.002C5901-ON86256F02.005C2FB1-86256F02.005C2FD5@raytheon.com>
2004-09-01 17:09 ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2004-09-01 15:21 Mark_H_Johnson
2004-09-02 22:24 ` Ingo Molnar
2004-09-01 14:37 Mark_H_Johnson
2004-09-01 19:31 ` Takashi Iwai
     [not found] <2yiVZ-IZ-15@gated-at.bofh.it>
     [not found] ` <2ylhi-2hg-3@gated-at.bofh.it>
     [not found]   ` <2ynLU-42D-7@gated-at.bofh.it>
     [not found]     ` <2yqJJ-5ZL-1@gated-at.bofh.it>
     [not found]       ` <2yQkS-6Zh-13@gated-at.bofh.it>
     [not found]         ` <2zaCV-4FE-3@gated-at.bofh.it>
     [not found]           ` <2zaWk-4Yj-9@gated-at.bofh.it>
     [not found]             ` <2zmE8-4Zz-11@gated-at.bofh.it>
     [not found]               ` <2zngP-5wD-9@gated-at.bofh.it>
     [not found]                 ` <2zngP-5wD-7@gated-at.bofh.it>
     [not found]                   ` <2znJS-5Pm-25@gated-at.bofh.it>
2004-08-31 23:06                     ` Andi Kleen
     [not found]                     ` <2znJS-5Pm-27@gated-at.bofh.it>
     [not found]                       ` <2znJS-5Pm-29@gated-at.bofh.it>
     [not found]                         ` <2znJS-5Pm-31@gated-at.bofh.it>
     [not found]                           ` <2znJS-5Pm-33@gated-at.bofh.it>
2004-08-31 23:10                             ` Andi Kleen
2004-09-01  7:05                               ` Ingo Molnar
2004-08-31 20:10 Mark_H_Johnson
2004-08-31 20:37 ` Ingo Molnar
2004-08-31 15:17 Mark_H_Johnson
2004-08-31 17:20 ` Lee Revell
2004-08-31 18:09   ` Lee Revell
2004-08-31 18:53     ` Takashi Iwai
2004-08-31 18:56       ` Ingo Molnar
2004-09-02 16:59         ` Jaroslav Kysela
2004-09-02 17:50           ` Lee Revell
2004-08-31 18:19   ` Takashi Iwai
2004-08-31 18:48     ` Ingo Molnar
2004-08-31 19:02       ` Takashi Iwai
2004-08-31 18:50   ` Ingo Molnar
2004-08-31 12:46 Mark_H_Johnson
2004-08-30 19:13 Mark_H_Johnson
2004-08-30 19:21 ` Ingo Molnar
2004-08-31  8:49 ` Ingo Molnar
2004-09-02  6:33 ` Ingo Molnar
2004-08-28 17:52 [patch] voluntary-preempt-2.6.9-rc1-bk4-Q0 Lee Revell
2004-08-28 19:44 ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q2 Ingo Molnar
2004-08-28 20:10   ` Daniel Schmitt
2004-08-28 20:31     ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q3 Ingo Molnar
2004-08-28 21:10       ` Lee Revell
2004-08-28 21:13         ` Ingo Molnar
2004-08-28 21:16           ` Lee Revell
2004-08-28 23:51             ` Lee Revell
2004-08-29  2:35               ` Lee Revell
2004-08-29  5:43                 ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q4 Ingo Molnar
2004-08-30  9:06                   ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q5 Ingo Molnar
2004-08-30 14:25                     ` Thomas Charbonnel
2004-08-30 18:00                       ` Ingo Molnar
2004-08-31 19:23                         ` Thomas Charbonnel
2004-08-31 19:30                           ` Ingo Molnar
2004-08-31 19:45                             ` Thomas Charbonnel
2004-08-31  6:40                     ` Lee Revell
2004-08-31  6:53                       ` Ingo Molnar
2004-08-31 23:03                         ` Lee Revell
2004-09-01 15:52                           ` Martin Josefsson
2004-09-01 21:15                             ` Lee Revell
2004-09-01 21:30                             ` Lee Revell
2004-08-31  7:06                       ` Ingo Molnar
2004-08-31 19:21                         ` Lee Revell
2004-08-31 19:37                           ` Ingo Molnar
2004-08-31 19:47                             ` Lee Revell
2004-08-31 19:51                               ` Ingo Molnar
2004-08-31 20:09                                 ` Ingo Molnar
2004-08-31 20:10                                   ` Lee Revell
2004-08-31 20:14                                     ` Ingo Molnar
2004-08-31 20:20                                       ` Ingo Molnar
2004-08-31 20:34                                         ` Lee Revell
2004-08-31 20:39                                           ` Ingo Molnar
2004-08-31 20:41                                             ` Lee Revell
2004-08-31 17:40                     ` Peter Zijlstra
2004-09-01  1:43                     ` Lee Revell
2004-09-01  2:30                     ` Lee Revell
2004-09-01  7:27                     ` Lee Revell

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=20040901073056.GA20020@elte.hu \
    --to=mingo@elte.hu \
    --cc=Mark_H_Johnson@Raytheon.com \
    --cc=kr@cybsft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@felipe-alfaro.com \
    --cc=pnambic@unu.nu \
    --cc=rlrevell@joe-job.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