x86: eventinj: Do a real io_delay()
PATCH 1/1 x86: eventinj: Do a real io_delay()
From: Nadav Amit <[email protected]>
There is no guarantee that a self-IPI would be delivered immediately. io_delay() is called after self-IPI is generated but does nothing. Instead, change io_delay() to wait for 10000 cycles, which should be enough on any system whatsoever.
--- x86/eventinj.c | 5 +++++ 1 file changed, 5 insertions(+)
x86/eventinj.c +5 -0
@@ -18,6 +18,11 @@ void do_pf_tss(void);static inline void io_delay (void ) { +u64 start =rdtsc (); + +do { +pause (); + }while (rdtsc () - start <10000 ); }static void apic_self_ipi (u8 v)
Signature · 1 line
2.17.1
Quoted 18 lines · On 5/2/19 11:49 AM, [email protected] wrote:
From: Nadav Amit <[email protected]>
There is no guarantee that a self-IPI would be delivered immediately.
io_delay()is called after self-IPI is generated but does nothing. Instead, changeio_delay()to wait for 10000 cycles, which should be enough on any system whatsoever.Signed-off-by Nadav Amit <[email protected]>--- x86/eventinj.c | 5 +++++ 1 file changed, 5 insertions(+)x86/eventinj.c +0
-0@@ -18,6 +18,11 @@ void do_pf_tss(void);
x86/eventinj.c void do_pf_tss(void); · line 28
Quoted 10 lines
x86/eventinj.c +5
-0static inline void io_delay (void ) { +u64 start =rdtsc (); + +do { +pause (); + }while (rdtsc () - start <10000 ); }static void apic_self_ipi (u8 v)
Perhaps call delay() (in delay.c) inside of io_delay() OR perhaps replace all instances of io_delay() with delay() ?
Quoted 25 lines · Krish Sadhukhan
Quoted 21 lines · On 5/2/19 11:49 AM, [email protected] wrote:
From: Nadav Amit <[email protected]>
There is no guarantee that a self-IPI would be delivered immediately.
io_delay()is called after self-IPI is generated but does nothing. Instead, changeio_delay()to wait for 10000 cycles, which should be enough on any system whatsoever.Signed-off-by Nadav Amit <[email protected]>--- x86/eventinj.c | 5 +++++ 1 file changed, 5 insertions(+)x86/eventinj.c +2
-0@@ -18,6 +18,11 @@ void do_pf_tss(void);static inline void io_delay (void ) { +u64 start =rdtsc (); +
Quoted 8 lines
x86/eventinj.c void do_pf_tss(void); · line 28
Quoted 5 lines
x86/eventinj.c +3
-0+do { +pause (); + }while (rdtsc () - start <10000 ); }static void apic_self_ipi (u8 v)Perhaps call
delay()(indelay.c) inside ofio_delay()OR perhaps replace all instances ofio_delay()withdelay()?
There is such a mess with this delay(). It times stuff based on number of pause() invocations. There is an additional implementation in ioapic.c (which by itself is broken, since there is no compiler barrier).
Let me see what I can do...