Skip to contentSkip to conversation

latency & real-time-ness.

DISCUSSION Ben Greear 6 participants 12 messages Mar 3, 2002 – Mar 4, 2002

lore
Share & tools
lore

Ben Greear

author
#0 lore raw

I have been doing some tests with 2.4.19-pre2-ac2 with regard to network latency. When running a steady stream of 138byte UDP packets at 115 packets per second, I see about .1% of the packets take more than 5 miliseconds to go from user-space to user-space on a 1Ghz PIII machine.

At 50Mbps (bi directional), I see a much wider latency spread, with some packets taking up to 300ms or higher to get from A to B. The CPU load ranges from about 30% to 80% utilization at this speed...

I'm running the program at nice -18.

So, what kind of things can I do to decrease the latency?

Would the low-latency patch help me?

Are there any scheduling tricks I can use to tell the kernel that my program should get to run as soon as it wants to?

Thanks,
Ben

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#1 lore raw
Quoted 2 lines

I'm running the program at nice -18.
So, what kind of things can I do to decrease the latency?

Hack up the ksoftirq stuff to only fall back to ksoftirqd after about 500 iterations instead of one is one little detail to deal with

Quoted 1 line

Would the low-latency patch help me?

Yes

author
#2 lore raw
Quoted 6 lines · Alan Cox
Quoted 3 lines

I'm running the program at nice -18.
So, what kind of things can I do to decrease the latency?

Hack up the ksoftirq stuff to only fall back to ksoftirqd after about 500 iterations instead of one is one little detail to deal with

Can someone expound slightly on this?

Quoted 6 lines
Quoted 4 lines

Would the low-latency patch help me?

Yes

Excellent, I'm compiling that now....

Thanks,
Ben

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#3 lore raw
In reply to Alan Cox
Quoted 4 lines · Alan Cox
Quoted 3 lines

I'm running the program at nice -18.
So, what kind of things can I do to decrease the latency?

Quoted 8 lines

Hack up the ksoftirq stuff to only fall back to ksoftirqd after about 500 iterations instead of one is one little detail to deal with

Quoted 2 lines

Would the low-latency patch help me?

Yes

It might be very difficult to fix up the low latency patch for the latest -ac, but the mini-low-latency patch should go right in - that should fix the worst of it, and I've run 2.4.19-pre2-ac1 with the mini low-latency patch.

It's part of the -aa patch collection, just look for "00_lowlatency-fixes-4" or so.

Joe

#7 lore raw
In reply to Alan Cox

Ben Greear wrote

Quoted 7 lines
Quoted 3 lines

Would the low-latency patch help me?

Yes

Excellent, I'm compiling that now....

Eh?

The full-on low latency patch from Andrew Morton?

You might want to make some diffs available
since AFIK that would have involved quite a bit
of hand editing to fix rejects...

Joe

#4 lore raw
In reply to J Sloan
Quoted 2 lines

It might be very difficult to fix up the
low latency patch for the latest -ac,

You should be able to just dump out the vm part of it - Rik put that into rmap anyuway afaik

#5 lore raw
Quoted 7 lines · Alan Cox
Quoted 3 lines

It might be very difficult to fix up the
low latency patch for the latest -ac,

You should be able to just dump out the vm part of it - Rik put that into rmap anyuway afaik

Ah, excellent - good to know, I'll check that out tonight -

BTW 2.4.19-pre2-ac1 was pretty good for me - The GUI remained snappy and the mp3s played smoothly all while running dbench 128 - The O(1) scheduler and rmap stuff look like a win -

Joe

author
#8 lore raw
In reply to Alan Cox
Quoted 5 lines · J Sloan

Ben Greear wrote

Quoted 3 lines
Quoted 3 lines

Would the low-latency patch help me?

Yes

Quoted 8 lines
Quoted 1 line

Excellent, I'm compiling that now....

Eh?

The full-on low latency patch from Andrew Morton?

You might want to make some diffs available
since AFIK that would have involved quite a bit
of hand editing to fix rejects...

I found this patch:
preempt-kernel-rml-2.4.19-pre2-ac2-1.patch

It applied cleanly...looks like maybe this isn't
the low-latency patch though now that I look at
it a little closer.

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#9 lore raw
Quoted 6 lines · Ben Greear

I found this patch:
preempt-kernel-rml-2.4.19-pre2-ac2-1.patch

It applied cleanly...looks like maybe this isn't
the low-latency patch though now that I look at
it a little closer.

Right, it is not. It is the preemptive kernel patch. More information can be found at http://tech9.net/rml/linux

Robert Love

#10 lore raw
In reply to Alan Cox
Quoted 8 lines · Ben Greear

I found this patch:
preempt-kernel-rml-2.4.19-pre2-ac2-1.patch

It applied cleanly...looks like maybe this isn't
the low-latency patch though now that I look at
it a little closer.

You are correct sir - that is not the low latency patch, although if you add the lock break patch to the preempt patch, the results are said to be similar to the low latency patch...

Joe

#6 lore raw
In reply to J Sloan
Quoted 5 lines · Alan Cox
Quoted 2 lines

It might be very difficult to fix up the
low latency patch for the latest -ac,

You should be able to just dump out the vm part of it - Rik put that into rmap anyuway afaik

Any chance we will see mini-ll or the full-ll patches in an -ac release anytime?

-Erik

--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

#11 lore raw
In reply to Alan Cox
Quoted 6 lines · J Sloan

The full-on low latency patch from Andrew Morton?

You might want to make some diffs available
since AFIK that would have involved quite a bit
of hand editing to fix rejects...

There is also patch against 2.4.18 with following:

- Latest Andre's IDE driver
- Latest Lionel's SiS IDE driver
- Latest Rik's rmap
- Latest Ingo's O(1)
- Andrew's full and mini lowlatency
- My DRM lowlatency fixes (r128, radeon, mga) (in -ll)

Available at http://www.pp.song.fi/~visitor/linux/

- Jussi Laako

Signature · 2 lines
PGP key fingerprint: 161D 6FED 6A92 39E2 EB5B  39DD A4DE 63EB C216 1E4B
Available at PGP keyservers