The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Woodhouse, David" <dwmw@amazon.co.uk>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"seanjc@google.com" <seanjc@google.com>,
	Michal Luczaj <mhal@rbox.co>
Subject: Re: [PATCH] KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET
Date: Wed, 28 Dec 2022 14:21:51 +0100	[thread overview]
Message-ID: <3619dc3b-d1b9-ab76-a008-2c45799d5803@redhat.com> (raw)
In-Reply-To: <62d7c91f-1486-4aea-8764-352efb383326@email.android.com>

On 12/28/22 12:55, Woodhouse, David wrote:
> 
> IIRC the send_port and type aren't used from hcall_send so we could 
> stick those in a union with a 'next' pointer and use it to build a list 
> instead of having to allocate the array (pathological worst case 32KiB).

Yeah I thought about using a list.  The union is doable as you say, but 
I wasn't sure if things were going to change in kvm_xen_evtchn_send later.

And the worst case is order 3, which is within PAGE_ALLOC_COSTLY_ORDER, 
so I decided to go with the array which only consumes memory on reset 
rather than always; it's much more likely that the array will be smaller 
than a page.

Paolo

> Or if the union is a bit icky, we could just add the 'next' pointer 
> unconditionally.
> 


       reply	other threads:[~2022-12-28 13:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <62d7c91f-1486-4aea-8764-352efb383326@email.android.com>
2022-12-28 13:21 ` Paolo Bonzini [this message]
2022-12-28 11:04 [PATCH] KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET Paolo Bonzini
2023-01-19 15:58 ` Yu Zhang
2023-01-19 17:57   ` Sean Christopherson
2023-01-19 18:00     ` Paolo Bonzini
2023-01-19 18:04       ` Sean Christopherson
2023-01-19 18:12         ` Paolo Bonzini
2023-01-19 18:14           ` Sean Christopherson
2023-01-19 18:16             ` Paolo Bonzini
2023-02-24 18:18 ` Michal Luczaj

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=3619dc3b-d1b9-ab76-a008-2c45799d5803@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dwmw@amazon.co.uk \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhal@rbox.co \
    --cc=seanjc@google.com \
    /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