From: Claudio Fontana <cfontana@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Gerd Hoffmann <kraxel@redhat.com>,
Roman Bolshakov <r.bolshakov@yadro.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH v2 2/6] accel: accel_available() function
Date: Thu, 26 Nov 2020 22:06:03 +0100 [thread overview]
Message-ID: <7df7713c-5125-9e41-3572-a476cad2946b@suse.de> (raw)
In-Reply-To: <f4f64154-9fbb-36fa-d9cb-e49c8ed06537@redhat.com>
On 11/26/20 3:25 PM, Paolo Bonzini wrote:
> On 26/11/20 15:13, Claudio Fontana wrote:
>> One option I see is simply to document the behavior where
>> accel_available() is declared in accel.h (ie do not use in fast
>> path), as well as in accel_find() actually, so that both accel_find()
>> and accel_available() are avoided in fast path and avoid being called
>> frequently at runtime.
>>
>> Another option could be to remove the allocation completely, and use
>> for example accel_find(ACCEL_CLASS_NAME("tcg")), or another option
>> again would be to remove the allocation and use either a fixed buffer
>> + snprintf, or alloca -like builtin code to use the stack, ...
>>
>> Not a big deal, but with a general utility and short name like
>> accel_available(name) it might be tempting to use this more in the
>> future?
>
> I think it's just that the usecase is not that common. "Is this
> accelerator compiled in the binary" is not something you need after
> startup (or if querying the monitor).
>
> Paolo
>
>
A script that repeatedly uses the QMP interface to query for the status could generate fragmentation this way I think.
Ciao,
Claudio
next prev parent reply other threads:[~2020-11-26 21:07 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 20:56 [PATCH v2 0/6] arch_init.c cleanup Eduardo Habkost
2020-11-25 20:56 ` [PATCH v2 1/6] arch_init: Move QEMU_ARCH definitions to cpu.h Eduardo Habkost
2020-11-26 12:31 ` Thomas Huth
2020-11-27 11:35 ` Cornelia Huck
2020-11-25 20:56 ` [PATCH v2 2/6] accel: accel_available() function Eduardo Habkost
2020-11-26 9:14 ` Claudio Fontana
2020-11-26 13:36 ` Eduardo Habkost
2020-11-26 14:13 ` Claudio Fontana
2020-11-26 14:25 ` Paolo Bonzini
2020-11-26 21:06 ` Claudio Fontana [this message]
2020-11-26 21:48 ` Eduardo Habkost
2020-11-27 9:04 ` Claudio Fontana
2020-11-27 14:45 ` Markus Armbruster
2020-11-27 14:58 ` Claudio Fontana
2020-11-27 16:47 ` Markus Armbruster
2020-11-27 5:00 ` Paolo Bonzini
2020-11-27 12:08 ` Cornelia Huck
2020-11-25 20:56 ` [PATCH v2 3/6] kvm: Remove kvm_available() function Eduardo Habkost
2020-11-27 12:10 ` Cornelia Huck
2020-11-25 20:56 ` [PATCH v2 4/6] xen: Delete xen_available() function Eduardo Habkost
2020-11-27 12:11 ` Cornelia Huck
2020-11-27 14:52 ` Anthony PERARD via
2020-11-25 20:56 ` [PATCH v2 5/6] Remove unnecessary usage of arch_init.h Eduardo Habkost
2020-11-27 12:23 ` Cornelia Huck
2020-11-25 20:56 ` [PATCH v2 6/6] Rename arch_init.h to arch_type.h Eduardo Habkost
2020-11-27 12:25 ` Cornelia Huck
2020-11-25 22:23 ` [PATCH v2 0/6] arch_init.c cleanup Roman Bolshakov
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=7df7713c-5125-9e41-3572-a476cad2946b@suse.de \
--to=cfontana@suse.de \
--cc=ehabkost@redhat.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=r.bolshakov@yadro.com \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.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;
as well as URLs for NNTP newsgroup(s).