Historical speck list archives
 help / color / mirror / Atom feed
From: Nicolai Stange <nstange@suse.de>
To: speck@linutronix.de
Subject: [MODERATED] Re: [RFC PATCH 4/6] kvm: handle host mode irqs 4
Date: Sun, 29 Jul 2018 22:00:22 +0200	[thread overview]
Message-ID: <87fu01ak2x.fsf_-_@suse.de> (raw)
In-Reply-To: <ebe39f37-b80d-557f-c608-4788eb1ff175@redhat.com> (speck for Paolo Bonzini's message of "Fri, 27 Jul 2018 11:55:56 +0200")

speck for Paolo Bonzini  <speck@linutronix.de> writes:

> On 27/07/2018 11:17, speck for Nicolai Stange wrote:
>> speck for Peter Zijlstra  <speck@linutronix.de> writes:
>> 
>>> On Wed, Jul 25, 2018 at 01:45:32PM +0200, speck for Nicolai Stange wrote:
>>>> So if nobody objects, I'll go with what Paolo proposed at [1]: replace
>>>> the 'kernel_mode_irq_gen' counter with a latch flag and set that for any
>>>> irq (but NMIs for a start).
>>>
>>> Well, the reason I suggested the other counters, is to avoid adding yet
>>> another dirty cacheline to IRQs. Since we're already touching those
>>> fields for most interrupts anyway.. might as well extend them to cover
>>> what we need instead of adding more dirty lines.
>>>
>> 
>> Ah I see, that makes sense of course.
>> 
>> I think there are two possible ways forward:
>> 
>> 1.) Squeeze that new "kvm_cpu_l1tf_flush_l1d" latch flag into
>>     irq_cpustat_t. irq_cpustat_t is arch-specific and there
>>     is some room in its first cacheline, for example inserting
>>     up to four bytes right after ->irq_tlb_count wouldn't move
>>     anything critical out.
>> 
>> 2.) Make the non-do_IRQ() irqs, i.e. smp_apic_timer_interrupt() & Co,
>>     call kstat_incr_irqs_this_cpu() and adapt arch_irq_stat_cpu()
>>     accordingly. Let vmx use struct kernel_stat ->irqs_sum as a
>>     irq generation counter as before.
>> 
>> Pros 1.)
>> - Easy to implement.
>> - Doesn't rely on irq_domain drivers.
>> 
>> Cons 1.)
>> - Extra store from do_IRQ() irqs in comparison to 2.)
>> - That "kvm_cpu_l1tf_flush_l1d" flag doesn't really qualify
>>   as an "IRQ stat" and it might be surprising to have it there.
>
> There's precedent for this, for example __softirq_pending.  In fact you
> could reduce __softirq_pending to an u16 and not increase the size of
> irq_cpustat_t, since there are <16 softirqs.

Perfect, thanks!

Nicolai

  reply	other threads:[~2018-07-29 20:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23  9:54 [MODERATED] [RFC PATCH 0/6] kvm: handle host mode irqs 0 Nicolai Stange
2018-07-21 20:16 ` [MODERATED] [RFC PATCH 1/6] kvm: handle host mode irqs 1 Nicolai Stange
2018-07-21 20:25 ` [MODERATED] [RFC PATCH 2/6] kvm: handle host mode irqs 2 Nicolai Stange
2018-07-21 20:35 ` [MODERATED] [RFC PATCH 3/6] kvm: handle host mode irqs 3 Nicolai Stange
2018-07-22  9:35 ` [MODERATED] [RFC PATCH 4/6] kvm: handle host mode irqs 4 Nicolai Stange
2018-07-23 15:40   ` [MODERATED] " Andi Kleen
2018-07-24  5:58     ` Nicolai Stange
2018-07-24 14:12       ` Andi Kleen
2018-07-24 14:39         ` Paolo Bonzini
2018-07-24 15:21   ` Peter Zijlstra
2018-07-25 11:45     ` Nicolai Stange
2018-07-27  7:45       ` Peter Zijlstra
2018-07-27  9:17         ` Nicolai Stange
2018-07-27  9:55           ` Paolo Bonzini
2018-07-29 20:00             ` Nicolai Stange [this message]
2018-07-22 11:06 ` [MODERATED] [RFC PATCH 5/6] kvm: handle host mode irqs 5 Nicolai Stange
2018-07-22 11:38 ` [MODERATED] [RFC PATCH 6/6] kvm: handle host mode irqs 6 Nicolai Stange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fu01ak2x.fsf_-_@suse.de \
    --to=nstange@suse.de \
    --cc=speck@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).