Skip to contentSkip to conversation

packet re-ordering on SMP machines.

DISCUSSION Mohd. Mohtashim 1 participant 1 message Aug 27, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 60 lines · On Tue, 27 Aug 2002 Andi Kleen wrote :
Quoted 7 lines · jamal
Quoted 2 lines · Andi Kleen

That is because of the lock it takes. Locks are always

slow.

Quoted 2 lines

xtime_lock?

Yes.

It also has some other overhead.

Quoted 3 lines
Quoted 3 lines

Older kernels used gettimeoffset which ran without lock, but

that was

Quoted 1 line
Quoted 1 line

changed because in some very obscure cases it could cause

non monotonous

Quoted 1 line
Quoted 1 line

timestamps when the user turns on timestamp receiving to

user space

Quoted 5 lines
Quoted 5 lines

(kernel protocols do not care)

Possibilities:

- Ignore the problem and switch back to gettimeoffset

again

Quoted 2 lines

Is it safe to call gettimeoffset without the lock?

Of course. The only problem is that the clock can be non mononotonous
sometimes and not be in sync with gettimeofday, but at least the kernel
users of packet timestamps do not care.
The only problem is the socket option, but it is obscure enough that I
would not worry too much about it.

Quoted 2 lines
Quoted 2 lines

- Switch to gettimeoffset but add some correction step for

the unlikely

Quoted 7 lines
Quoted 4 lines

case that someone wants the timestamp from user space (would be my prefered solution)
- Implement lockless gettimeofday like x86-64 or sparc (good one too, but likely slower than last)

ia64 seems to also have the lock.

Quick fix is to just use gettimeoffset in netif_rx again. Should
be fine for you.

-Andi