All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Claudio Fontana <cfontana@suse.de>
Cc: Thomas Huth <thuth@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, Roman Bolshakov <r.bolshakov@yadro.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2 2/6] accel: accel_available() function
Date: Fri, 27 Nov 2020 15:45:37 +0100	[thread overview]
Message-ID: <87y2imq2ni.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <55ed249f-9fd3-fe3d-c63a-8d74803a72ca@suse.de> (Claudio Fontana's message of "Fri, 27 Nov 2020 10:04:37 +0100")

Claudio Fontana <cfontana@suse.de> writes:

> On 11/26/20 10:48 PM, Eduardo Habkost wrote:
>> On Thu, Nov 26, 2020 at 10:06:03PM +0100, Claudio Fontana wrote:
>>> 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.
>> 
>> Is this a problem?  Today, execution of a "query-kvm" command
>> calls g_malloc() 37 times.
>> 
>
> Not ideal in my view, but not the end of the world either.

QMP's appetite for malloc is roughly comparable to a pig's for truffles.



  reply	other threads:[~2020-11-27 14:47 UTC|newest]

Thread overview: 37+ 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-25 20:56   ` Eduardo Habkost
2020-11-26 12:31   ` Thomas Huth
2020-11-26 12:31     ` Thomas Huth
2020-11-27 11:35   ` Cornelia Huck
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
2020-11-26 21:48             ` Eduardo Habkost
2020-11-27  9:04               ` Claudio Fontana
2020-11-27 14:45                 ` Markus Armbruster [this message]
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-25 20:56   ` Eduardo Habkost
2020-11-27 12:10   ` Cornelia Huck
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-25 20:56   ` Eduardo Habkost
2020-11-27 12:11   ` Cornelia Huck
2020-11-27 12:11     ` Cornelia Huck
2020-11-27 14:52   ` Anthony PERARD via
2020-11-27 14:52     ` Anthony PERARD
2020-11-25 20:56 ` [PATCH v2 5/6] Remove unnecessary usage of arch_init.h Eduardo Habkost
2020-11-25 20:56   ` Eduardo Habkost
2020-11-27 12:23   ` Cornelia Huck
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=87y2imq2ni.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.