netdev
[Top] [All Lists]

Re: ksoftirqd uses 99% CPU triggered by network traffic (maybe RLT-8139

To: Pasi Sjoholm <ptsjohol@xxxxxxxxx>
Subject: Re: ksoftirqd uses 99% CPU triggered by network traffic (maybe RLT-8139 related)
From: Robert Olsson <Robert.Olsson@xxxxxxxxxxx>
Date: Tue, 27 Jul 2004 00:38:12 +0200
Cc: Robert Olsson <Robert.Olsson@xxxxxxxxxxx>, Francois Romieu <romieu@xxxxxxxxxxxxx>, H?ctor Mart?n <hector@xxxxxxxxxxxxxx>, Linux-Kernel <linux-kernel@xxxxxxxxxxxxxxx>, <akpm@xxxxxxxx>, <netdev@xxxxxxxxxxx>, <brad@xxxxxxxxxx>, <shemminger@xxxxxxxx>
In-reply-to: <Pine.LNX.4.44.0407270028170.11416-100000@silmu.st.jyu.fi>
References: <16645.13126.52445.630789@robur.slu.se> <Pine.LNX.4.44.0407270028170.11416-100000@silmu.st.jyu.fi>
Sender: netdev-bounce@xxxxxxxxxxx
Pasi Sjoholm writes:

 > Hur är läget Robert?-)
   Tack bra!

 > >  In summary: High softirq loads can totally kill userland. The reason is 
 > > that 
 > >  do_softirq() is run from many places hard interrupts, local_bh_enable etc 
 > >  and bypasses the ksoftirqd protection. It just been discussed at OLS with
 > >  Andrea and Dipankar and others. Current RCU suffers from this problem as 
 > > well.
 > 
 > Ok, this explanation makes sense and my point of view I think this is 
 > quite critical problem if you can "crash" linux kernel just sending enough 
 > packets to network interface for an example.

 Well the packets also has to create hard softirq loads in practice this means 
route
 lookup or something else for normal traffic the RX_SOFIRQ is very well behaved
 and schedules itself to give other softirq's a chance to run also I'll guess 
you 
 have softirq's not only from the network. If you decrease your load a bit you 
come
 to more nomal operation?
 
 > I would be more than glad to help you in testing if you want to publish 
 > some patches. 

 Well maybe we should start to verify that this problem. Alexey did a litte 
program 
 doing gettimeofday to run to see how long user mode could be starved. Also 
note we 
 add new source of softirq's. 


#include <stdio.h> 
#include <sys/time.h>
#include <asm/types.h>

main()
{
        struct timeval tv, prev_tv;
        __s64 diff;
        __u32 i;
        __s32 maxlat = 50;

          gettimeofday(&prev_tv, NULL);

          printf("time control loop starting\n");

          for (i=0;;i++) {
              gettimeofday(&tv, NULL);
              diff = (tv.tv_sec - prev_tv.tv_sec)*1000000 +
                     (tv.tv_usec - prev_tv.tv_usec);
              if (diff > 1000000) 
                  printf("**%lld\n", diff);
              prev_tv = tv;
              if (diff > maxlat) {
                      maxlat = diff;
                      printf("new maxlat = %d\n", maxlat);
              }
              if(!(i % 1000000))
                      printf("timestamp diff = %lld, maxlat = %d\n", diff, 
maxlat);
          }
}

Cheers.
                                                        --ro



<Prev in Thread] Current Thread [Next in Thread>