[Click] Click running on multi-core processor

Bingyang LIU bjornliu at gmail.com
Fri Dec 2 23:23:37 EST 2011


Hi Beyers,

Thank you very much for your help. I tried StaticThreadSched, and achieve
my goal.

btw, I couldn't find e1000 driver for linux 2.6.31 and higher. So how can I
use Click Polling patch for those kernels?

Thanks very much
best
Bingyang

On Thu, Dec 1, 2011 at 7:27 PM, Beyers Cronje <bcronje at gmail.com> wrote:

> Hi,
>
> You need to use StaticThreadSched
> http://read.cs.ucla.edu/click/elements/staticthreadsched element to tell
> Click how to allocate tasks to threads. Without this element Click will use
> only one thread.
>
> A simple example on how to use is:
>
> fd0::FromDevice(eth0) -> Queue -> td1::ToDevice(eth1);
> fd1::FromDevice(eth1) -> Queue -> td0::ToDevice(eth0);
>
> StaticThreadSched(fd0 0, td1 0, fd1 1, tf0 1);
>
> This config schedules fd0 and td1 on thread 0 and the other two elements on
> thread 1. It is highly recommended to read the following publication
> http://pdos.csail.mit.edu/papers/click:usenix01/usenix01.pdf which delves
> into much more details around multithreading and Click and how to best use
> it.
>
> Also, highly recommended to upgrade to latest version of Click, there have
> been many multithreading stability and performance changes implemented
> inside Click since v1.8
>
> Also note not all elements are multithread safe.
>
> Beyers
>
>
> On Fri, Dec 2, 2011 at 1:08 AM, Bingyang LIU <bjornliu at gmail.com> wrote:
>
> > Hi all,
> >
> > I'm using click for performance evaluation of IPSec. But it seems that
> only
> > one core of the processor is used. I'm wondering how Click can fully use
> > the multi-core for computation to achieve high performance.
> >
> > The detail of my experiment is as follows:
> >
> > * Hardware: CPU Inter Xeon X3210 (quad core at 2.13Ghz), 4GB RAM. (a
> server
> > on deterlab)
> > * Software: Ubuntu8.04 + Click1.8, with PollDevice enabled.
> > * Configuration: ./configure --with-linux=/usr/src/linux-2.6.24.7
> > --enable-ipsec --enable-warp9 --enable-multithread=4 (I also tried 16,
> but
> > the outcome is similar with 4)
> > * mode: kernel
> >
> > The outcome:
> > * The click router has the loss rate of about 0.5% when incoming packet
> > rate is only 200000 pps (packet size = 64B). If I remove the ipsec
> modules,
> > the loss rate is about 0.1%.
> > * I checked the CPU usage. Anyway, the click used only one cpu.
> > * If there is no input packet, the cpu usage is as follows, I guess
> > PollDevice consumes the cpu time:
> > Cpu0  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
> >  0.0%st
> > Cpu1  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
> >  0.0%st
> > Cpu2  :  0.0%us, 48.0%sy,  0.0%ni, 25.0%id,  0.0%wa,  0.0%hi, 27.0%si,
> >  0.0%st
> > Cpu3  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
> >  0.0%st
> > * If there is some input packets, the cpu usage is as follows. It seems
> > that the IPSec module only consumes a small portion of the CPU time,
> which
> > causes low performance.
> > Cpu0  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
> >  0.0%st
> > Cpu1  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
> >  0.0%st
> > Cpu2  :  0.0%us, 68.8%sy,  0.0%ni, 25.0%id,  0.0%wa,  0.0%hi,  6.2%si,
> >  0.0%st
> > Cpu3  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
> >  0.0%st
> >
> > So what I'm wondering is that, is there any solution to my problem?
> > Or is there any easy way to fully use the CPU resource, or achieve
> > parallelism in a multi-core router? Is the paper "Flexible Control of
> > Parallelism in a Multiprocessor PC Router" the only available solution?
> >
> > thanks!
> > best
> > Bingyang
> > --
> > Bingyang Liu
> > Network Architecture Lab, Network Center,Tsinghua Univ.
> > Beijing, China
> > Home Page: http://netarchlab.tsinghua.edu.cn/~liuby
> > _______________________________________________
> > click mailing list
> > click at amsterdam.lcs.mit.edu
> > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> >
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>



-- 
Bingyang Liu
Network Architecture Lab, Network Center,Tsinghua Univ.
Beijing, China
Home Page: http://netarchlab.tsinghua.edu.cn/~liuby


More information about the click mailing list