[RFC][NET_SCHED] explict hold dev tx lock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: jamal
Date: Sunday, September 16, 2007 - 9:14 am

While trying to port my batching changes to net-2.6.24 from this morning
i realized this is something i had wanted to probe people on....

Challenge:
For N Cpus, with full throttle traffic on all N CPUs, funneling traffic
to the same ethernet device, the devices queue lock is contended by all
N CPUs constantly. The TX lock is only contended by a max of 2 CPUS. 
In the current mode of operation, after all the work of entering the
dequeue region, we may endup aborting the path if we are unable to get
the tx lock and go back to contend for the queue lock. As N goes up,
this gets worse.

Testing:
I did some testing with a 4 cpu (2xdual core) with no irq binding. I run
about 10 runs of 30M packets each from the stack with a udp app i wrote
which is intended to run keep all 4 cpus busy -  and to my suprise i
found that we only bail out less than 0.1%. I may need a better test
case.

Changes:
I made changes to the code path as defined in the patch included to 
and noticed a slight increase (2-3%) in performance with both e1000 and
tg3; which was a relief because i thought the spinlock_irq (which is
needed because some drivers grab tx lock in interupts) may have negative
effects. The fact it didnt reduce performance was a good thing.
Note: This is the highest end machine ive ever laid hands on, so this
may be misleading.
 
So - what side effects do people see in doing this? If none, i will
clean it up and submit.

cheers,
jamal
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][NET_SCHED] explict hold dev tx lock, jamal, (Sun Sep 16, 9:14 am)
Re: [RFC][NET_SCHED] explict hold dev tx lock, David Miller, (Sun Sep 16, 12:31 pm)
Re: [RFC][NET_SCHED] explict hold dev tx lock, jamal, (Sun Sep 16, 1:41 pm)
Re: [RFC][NET_SCHED] explict hold dev tx lock, jamal, (Sun Sep 16, 1:52 pm)
Re: [RFC][NET_SCHED] explict hold dev tx lock, jamal, (Sun Sep 16, 2:10 pm)
Re: [RFC][NET_SCHED] explict hold dev tx lock, Evgeniy Polyakov, (Mon Sep 17, 3:27 am)
Re: [RFC][NET_SCHED] explict hold dev tx lock, jamal, (Mon Sep 17, 6:03 am)
Re: [RFC][NET_SCHED] explict hold dev tx lock, Evgeniy Polyakov, (Mon Sep 17, 6:58 am)
Re: [RFC][NET_SCHED] explict hold dev tx lock, David Miller, (Mon Sep 17, 7:01 pm)
Re: [RFC][NET_SCHED] explict hold dev tx lock, jamal, (Mon Sep 17, 7:48 pm)
Re: [RFC][NET_SCHED] explict hold dev tx lock, jamal, (Wed Sep 19, 6:33 am)
Re: [RFC][NET_SCHED] explict hold dev tx lock, David Miller, (Wed Sep 19, 9:09 am)
Re: [RFC][NET_SCHED] explict hold dev tx lock, jamal, (Wed Sep 19, 7:33 pm)
Re: [RFC][NET_SCHED] explict hold dev tx lock, jamal, (Wed Sep 19, 7:43 pm)
Re: [RFC][NET_SCHED] explict hold dev tx lock, David Miller, (Tue Sep 25, 7:28 pm)
Re: [RFC][NET_SCHED] explict hold dev tx lock, jamal, (Wed Sep 26, 6:11 am)
Re: [RFC][NET_SCHED] explict hold dev tx lock, Herbert Xu, (Mon Oct 8, 9:00 pm)