Skip to contentSkip to conversation

some thoughts about TSC based delay_tsc()

DISCUSSION Marin Mitov 2 participants 2 messages Nov 21, 2007 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 8 lines · you
Quoted 7 lines · Marin Mitov

Hi Ingo,

The patch is quite good ;-) but we forget when it is needed :-( In fact we need it only for PREEMPT SMP kernels - it could hurt PREEMPT UP kernels (no migration possible), so no need for preempt_disable()/preempt_enable().

Quoted 7 lines
Quoted 2 lines

In short the old version of delay_tsc() is good for UP kernels and NON PREEMPT SMP kernels too.

please reply to the public list, so that discussions do not get lost.

i dont think there's any problem: udelay() is about _wasting_ cycles - it's what drivers use for short delays.

Sure for the thread executing udelay(), but not for the other ready threads which should also wait till preempt_enable() to grab the same cpu even for PREEMPT (UP or SMP) kernels (or I misunderstand something?).

Marin

Quoted 2 lines

Ingo

#3 lore raw
Quoted 14 lines · Marin Mitov
Quoted 13 lines · you
Quoted 9 lines · Marin Mitov

Hi Ingo,

The patch is quite good ;-) but we forget when it is needed :-( In fact we need it only for PREEMPT SMP kernels - it could hurt PREEMPT UP kernels (no migration possible), so no need for preempt_disable()/preempt_enable().

In short the old version of delay_tsc() is good for UP kernels and NON PREEMPT SMP kernels too.

please reply to the public list, so that discussions do not get lost.

Quoted 7 lines
Quoted 2 lines

i dont think there's any problem: udelay() is about _wasting_ cycles - it's what drivers use for short delays.

Sure for the thread executing udelay(), but not for the other ready threads which should also wait till preempt_enable() to grab the same cpu even for PREEMPT (UP or SMP) kernels (or I misunderstand something?).

on non-PREEMPT kernels there's no real difference between old and and new code because the kernel is not preemptible. So we can use the new code unconditionally.

Ingo