Skip to contentSkip to conversation

x86: Lazy disabling of interrupts

RFC PATCH H. Peter Anvin 6 participants 10 messages Oct 9, 2013 – Oct 10, 2013 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]

#1 lore raw
Quoted 5 lines

Summary
-------

Although the extreme case shows a nice improvement, I'm skeptical if it is worth doing for real world applications.

You did the experiment, and credit to you for not going "I did the work, now include it" but rather for publishing the results so we can learn from them.

It *does* make me wonder if we can leverage RTM for a significant subset of these (as an interrupt will abort a transaction); that should be substantially cheaper and less complex.

-hpa

#2 lore raw
Quoted 6 lines · H. Peter Anvin
Quoted 5 lines

Summary
-------

Although the extreme case shows a nice improvement, I'm skeptical if it is worth doing for real world applications.

Quoted 7 lines

You did the experiment, and credit to you for not going "I did the work, now include it" but rather for publishing the results so we can learn from them.

It *does* make me wonder if we can leverage RTM for a significant subset of these (as an interrupt will abort a transaction); that should be substantially cheaper and less complex.

I miss the original context and can't find the original patchkit, but:

- If the goal is to lower interrupt latency then RTM would still need to use a fallback, so the worst case would be the fallback, thus not be better.

- If the goal is to make CLI/STI faster:
I'm not sure RTM is any faster than a PUSHF/CLI/POPF pair. It may well be slightly slower in fact (guessing here, haven't benchmarked)

- Also when you abort you would need to reexecute of course.

- My TSX patchkit actually elides CLI/STI inside transactions (no need to do them, as any interrupt would abort anyways) but the main motivation was to avoid extra aborts.

- That said, I think a software CLI/STI is somewhat useful for profiling, as it can allow to measure how long interrupts are delayed
by CLI/STI. I heard use cases of this, but I'm not
sure how common it really is

[I presume a slightly modified RT kernel could also give the same profiling results]

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only
#3 lore raw
Quoted 12 lines · On Wed, 09 Oct 2013 15:25:23 -0700 Andi Kleen <[email protected]> wrote:
Quoted 10 lines · H. Peter Anvin
Quoted 5 lines

Summary
-------

Although the extreme case shows a nice improvement, I'm skeptical if it is worth doing for real world applications.

You did the experiment, and credit to you for not going "I did the work, now include it" but rather for publishing the results so we can learn from them.

Quoted 5 lines
Quoted 3 lines

It *does* make me wonder if we can leverage RTM for a significant subset of these (as an interrupt will abort a transaction); that should be substantially cheaper and less complex.

I miss the original context and can't find the original patchkit, but:

Yeah, for some reason, the original email didn't make it to LKML.

Dave,

I don't know why my email never reached LKML, was there something about it that prevented it from going? The total character length was 46,972, well below the 100,000 limit. Also the Cc list wasn't that big. Did my ISP get flagged as a spam bot or something?

I can bounce it to you to see what was wrong with it.

-- Steve

Quoted 25 lines

- If the goal is to lower interrupt latency then RTM would still need to use a fallback, so the worst case would be the fallback, thus not be better.

- If the goal is to make CLI/STI faster:
I'm not sure RTM is any faster than a PUSHF/CLI/POPF pair. It may well be slightly slower in fact (guessing here, haven't benchmarked)

- Also when you abort you would need to reexecute of course.

- My TSX patchkit actually elides CLI/STI inside transactions (no need to do them, as any interrupt would abort anyways) but the main motivation was to avoid extra aborts.

- That said, I think a software CLI/STI is somewhat useful for profiling, as it can allow to measure how long interrupts are delayed
by CLI/STI. I heard use cases of this, but I'm not
sure how common it really is

[I presume a slightly modified RT kernel could also give the same profiling results]

-Andi

#4 lore raw

From: Steven Rostedt <[email protected]>
Date: Wed, 9 Oct 2013 20:36:27 -0400

Quoted 6 lines

I don't know why my email never reached LKML, was there something about it that prevented it from going? The total character length was 46,972, well below the 100,000 limit. Also the Cc list wasn't that big. Did my ISP get flagged as a spam bot or something?

I can bounce it to you to see what was wrong with it.

That's odd, can you try sending it to the list again? I'll watch very carefully for a bounce.

Thanks.

#5 lore raw
Quoted 8 lines · On Wed, 09 Oct 2013 23:39:28 -0400 (EDT) David Miller <[email protected]>…

From: Steven Rostedt <[email protected]>
Date: Wed, 9 Oct 2013 20:36:27 -0400

Quoted 5 lines

I don't know why my email never reached LKML, was there something about it that prevented it from going? The total character length was 46,972, well below the 100,000 limit. Also the Cc list wasn't that big. Did my ISP get flagged as a spam bot or something?

Quoted 5 lines
Quoted 1 line

I can bounce it to you to see what was wrong with it.

That's odd, can you try sending it to the list again? I'll watch very carefully for a bounce.

I just sent it as a redirect to LKML. Hopefully that worked.

Thanks,

-- Steve

#6 lore raw
In reply to Andi Kleen
Quoted 3 lines · Andi Kleen

- That said, I think a software CLI/STI is somewhat useful for profiling, as it can allow to measure how long interrupts are delayed by CLI/STI. [...]

That could be measured directly in a simpler way, without disrupting CLI/STI: by turning all IRQs into NMIs and resending them from a special NMI handler. (and of course timestamping the NMI arrival time and the IRQ entry time so that instrumentation can recover it.)

If indirect, statistical measurement suffices then IRQ delivery latencies can also be estimated statistically without any kernel changes: by profiling IRQ disable/enable sections (there's a counter for that), calculating average IRQ-disable section length from that. The average IRQ delay will be 50% of that value, assuming normal distribution of IRQs. This should be good enough for most cases.

Thanks,

Ingo

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

#8 lore raw

From: Steven Rostedt <[email protected]>
Date: Thu, 10 Oct 2013 00:11:53 -0400

Quoted 3 lines

I'm replying to my email to see if that helps make it to LKML. If it doesn't, I'm sorry for the noise to all I Cc'd.

The problem is the:

H.PeterAnvin

in the CC list, you can't have a name with the "." charater it appear in email headers unless the string is surrounded by double quotes. Otherwise it's a syntax error.

#9 lore raw
Quoted 7 lines · David Miller

From: Steven Rostedt <[email protected]>
Date: Thu, 10 Oct 2013 00:11:53 -0400

Quoted 3 lines

I'm replying to my email to see if that helps make it to LKML. If it doesn't, I'm sorry for the noise to all I Cc'd.

Quoted 7 lines

The problem is the:

H.PeterAnvin

in the CC list, you can't have a name with the "." charater it appear in email headers unless the string is surrounded by double quotes. Otherwise it's a syntax error.

That's strange - I see

"H. Peter Anvin" <[email protected]>

in the CC list here. Did something get mangled on the way or is Claws acting outlook-like?

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#10 lore raw
Quoted 7 lines · On Thu, 10 Oct 2013 11:03:00 +0200 Borislav Petkov <[email protected]> wrote:

That's strange - I see

"H. Peter Anvin" <[email protected]>

in the CC list here. Did something get mangled on the way or is Claws acting outlook-like?

I just looked at my Address book, and sure enough, when you save an email with quotes, Claws will strip them when adding it to the address book. If you use the address book to send email, then it will use it without quotes. This can explain why Paul wasn't getting a lot of my emails too :-/

-- Steve

#11 lore raw
Quoted 5 lines · Steven Rostedt

I just looked at my Address book, and sure enough, when you save an email with quotes, Claws will strip them when adding it to the address book. If you use the address book to send email, then it will use it without quotes. This can explain why Paul wasn't getting a lot of my emails too :-/

But why does it have quotes in the CC list of the copy I have in my mbox?

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--