kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] KVM: selftests: Always run vCPU thread with blocked SIG_IPI
Date: Tue, 20 Apr 2021 18:24:50 +0200	[thread overview]
Message-ID: <84c52ebe-58a2-6188-270e-c86409e44fa3@redhat.com> (raw)
In-Reply-To: <20210420153223.GB4440@xz-x1>

On 20/04/21 17:32, Peter Xu wrote:
> On Tue, Apr 20, 2021 at 10:37:39AM -0400, Peter Xu wrote:
>> On Tue, Apr 20, 2021 at 04:16:14AM -0400, Paolo Bonzini wrote:
>>> The main thread could start to send SIG_IPI at any time, even before signal
>>> blocked on vcpu thread.  Therefore, start the vcpu thread with the signal
>>> blocked.
>>>
>>> Without this patch, on very busy cores the dirty_log_test could fail directly
>>> on receiving a SIGUSR1 without a handler (when vcpu runs far slower than main).
>>>
>>> Reported-by: Peter Xu <peterx@redhat.com>
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>
>> Yes, indeed better! :)
>>
>> Reviewed-by: Peter Xu <peterx@redhat.com>
> 
> I just remembered one thing: this will avoid program quits, but still we'll get
> the signal missing.

In what sense the signal will be missing?  As long as the thread exists, 
the signal will be accepted (but not delivered because it is blocked); 
it will then be delivered on the first KVM_RUN.

Paolo

   From that pov I slightly prefer the old patch.  However
> not a big deal so far as only dirty ring uses SIG_IPI, so there's always ring
> full which will just delay the kick. It's just we need to remember this when we
> extend IPI to non-dirty-ring tests as the kick is prone to be lost then.
> 
> Thanks,
> 


  reply	other threads:[~2021-04-20 16:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20  8:16 [PATCH] KVM: selftests: Always run vCPU thread with blocked SIG_IPI Paolo Bonzini
2021-04-20 14:37 ` Peter Xu
2021-04-20 15:32   ` Peter Xu
2021-04-20 16:24     ` Paolo Bonzini [this message]
2021-04-20 16:58       ` Peter Xu

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=84c52ebe-58a2-6188-270e-c86409e44fa3@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=stable@vger.kernel.org \
    /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 NNTP newsgroup(s).