netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Olsson <Robert.Olsson@data.slu.se>
To: dipankar@in.ibm.com
Cc: Robert Olsson <Robert.Olsson@data.slu.se>,
	Andrea Arcangeli <andrea@suse.de>,
	"David S. Miller" <davem@redhat.com>,
	kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org,
	netdev@oss.sgi.com, paulmck@us.ibm.com, akpm@osdl.org
Subject: Re: route cache DoS testing and softirqs
Date: Tue, 6 Apr 2004 14:55:19 +0200	[thread overview]
Message-ID: <16498.43191.733850.18276@robur.slu.se> (raw)
In-Reply-To: <20040405212220.GH4003@in.ibm.com>

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 961 bytes --]


Dipankar Sarma writes:

 > Looks better atleast. Can you apply the following patch (rs-throttle-rcu)
 > on top of rcu-softirq.patch in your tree and see if helps a little bit more ?
 > Please make sure to set the kernel paramenters rcupdate.maxbatch to 4
 > and rcupdate.plugticks to 0. You can make sure of those parameters
 > by looking at dmesg (rcu prints them out during boot). I just merged
 > it, but have not tested this patch yet.

OK!

Well not tested yet but I don't think we will get rid overflow totally in my 
setup. I've done a little experimental patch so *all* softirq's are run via 
ksoftirqd. 
 
 total    droppped tsquz    throttl  bh_enbl  ksoftird irqexit  other  
009bee0c 00000000 00004aa7 00000000 00000000 0336a637 00000078 00000000
0054d381 00000000 00004ca0 00000000 00000000 032f8e48 00000000 00000000

I still see dst overflows. But the priority of the ksoftird's can now control 
the user apps behavior even during softirq DoS.


[-- Attachment #2: softirq_limit-040405.pat --]
[-- Type: application/octet-stream, Size: 1481 bytes --]

--- kernel/softirq.c.orig	2004-03-11 03:55:24.000000000 +0100
+++ kernel/softirq.c	2004-04-05 12:52:40.000000000 +0200
@@ -58,6 +58,14 @@
 		wake_up_process(tsk);
 }
 
+static inline int can_run_ksoftirqd(void)
+{
+       /* Interrupts are disabled: no need to stop preemption */
+       struct task_struct *tsk = __get_cpu_var(ksoftirqd);
+
+       return tsk && !(tsk->state &  (TASK_DEAD | TASK_ZOMBIE));
+}
+
 /*
  * We restart softirq processing MAX_SOFTIRQ_RESTART times,
  * and we fall back to softirqd after that.
@@ -69,7 +77,7 @@
  */
 #define MAX_SOFTIRQ_RESTART 10
 
-asmlinkage void do_softirq(void)
+asmlinkage void __do_softirq(int from_ksoftirqd)
 {
 	int max_restart = MAX_SOFTIRQ_RESTART;
 	__u32 pending;
@@ -86,6 +94,9 @@
 		struct softirq_action *h;
 
 		local_bh_disable();
+
+		if (from_ksoftirqd && can_run_ksoftirqd())
+			     goto done;
 restart:
 		/* Reset the pending bitmask before enabling irqs */
 		local_softirq_pending() = 0;
@@ -106,6 +117,7 @@
 		pending = local_softirq_pending();
 		if (pending && --max_restart)
 			goto restart;
+done:
 		if (pending)
 			wakeup_softirqd();
 		__local_bh_enable();
@@ -114,6 +126,11 @@
 	local_irq_restore(flags);
 }
 
+asmlinkage void do_softirq(void) 
+{
+	__do_softirq(0);	
+}
+
 EXPORT_SYMBOL(do_softirq);
 
 void local_bh_enable(void)
@@ -324,7 +341,7 @@
 		__set_current_state(TASK_RUNNING);
 
 		while (local_softirq_pending()) {
-			do_softirq();
+			__do_softirq(1);	
 			cond_resched();
 		}
 

[-- Attachment #3: message body text --]
[-- Type: text/plain, Size: 19 bytes --]



Cheers.
					--ro

  reply	other threads:[~2004-04-06 12:55 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29 18:45 route cache DoS testing and softirqs Dipankar Sarma
2004-03-29 22:29 ` Andrea Arcangeli
2004-03-30  5:06   ` Srivatsa Vaddagiri
2004-03-30  5:35     ` Srivatsa Vaddagiri
2004-03-30 15:11       ` Andrea Arcangeli
2004-03-31  2:36     ` Rusty Russell
2004-03-30 14:43   ` Dipankar Sarma
2004-03-30 19:53     ` Dipankar Sarma
2004-03-30 20:47       ` Andrea Arcangeli
2004-03-30 21:06         ` Dipankar Sarma
2004-03-30 21:27           ` Andrea Arcangeli
2004-03-30 21:29         ` Robert Olsson
2004-03-31  7:36           ` Dipankar Sarma
2004-03-30 20:05   ` kuznet
2004-03-30 20:28     ` Dipankar Sarma
2004-04-01  6:00       ` kuznet
2004-03-30 21:14     ` Andrea Arcangeli
2004-03-30 21:30       ` David S. Miller
2004-03-30 21:37         ` Andrea Arcangeli
2004-03-30 22:22           ` David S. Miller
2004-03-30 22:49             ` Andrea Arcangeli
2004-03-31 20:46               ` Dipankar Sarma
2004-03-31 21:31                 ` Andrea Arcangeli
2004-03-31 21:52                   ` Dipankar Sarma
2004-03-30 22:33           ` Robert Olsson
2004-03-31 17:10           ` Dipankar Sarma
2004-03-31 18:46             ` Robert Olsson
2004-03-31 20:37               ` Dipankar Sarma
2004-03-31 21:28                 ` Andrea Arcangeli
2004-03-31 21:43                   ` Dipankar Sarma
2004-04-05 17:11                     ` Robert Olsson
2004-04-05 21:22                       ` Dipankar Sarma
2004-04-06 12:55                         ` Robert Olsson [this message]
2004-04-06 19:52                           ` Dipankar Sarma
2004-04-07 15:23                             ` Robert Olsson
2004-04-07 19:48                               ` Dipankar Sarma
2004-04-08 13:29                           ` kuznet
2004-04-08 14:07                             ` Robert Olsson
2004-03-31 22:36                   ` Robert Olsson
2004-03-31 22:52                     ` Andrea Arcangeli
2004-04-01  6:43                       ` kuznet
2004-04-01 13:16                         ` Andrea Arcangeli
2004-04-08 13:38                           ` kuznet
2004-04-01 13:44                       ` Robert Olsson

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=16498.43191.733850.18276@robur.slu.se \
    --to=robert.olsson@data.slu.se \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=davem@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=paulmck@us.ibm.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).