qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: zhanghailiang <zhang.zhanghailiang@huawei.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Markus Armbruster <armbru@redhat.com>
Cc: hangaohuai@huawei.com, peter.huangpeng@huawei.com,
	Xiangyou Xie <xiexiangyou@huawei.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	"Gonglei (Arei)" <arei.gonglei@huawei.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] vl: Adjust the place of processing '-mon'
Date: Fri, 6 Mar 2015 18:08:53 +0800	[thread overview]
Message-ID: <54F97CB5.2030204@huawei.com> (raw)
In-Reply-To: <CAFEAcA8pGxrX=8k12rSpZ=wGTUZSuc7zoENXSOrqo_yMHYdR7Q@mail.gmail.com>

On 2015/3/6 17:51, Peter Maydell wrote:
> On 5 March 2015 at 02:02, Markus Armbruster <armbru@redhat.com> wrote:
>> zhanghailiang <zhang.zhanghailiang@huawei.com> writes:
>>
>>> From: Xiangyou Xie <xiexiangyou@huawei.com>
>>>
>>> If VM is configured with large size of hugepage, when startup,
>>> it will consume lots of time to zero the hugepage memory in the function
>>> 'os_mem_prealloc'.
>>> Libvirtd will wait 30 seconds for qemu to establish the monitor,
>>> If the timeout triggers, libvirtd will send TERM signal to kill qemu.
>>>
>>> To solve the problem, adjust the processing of '-mon' to the ahead of '-object'.
>>>
>>> Signed-off-by: Xiangyou Xie <xiexiangyou@huawei.com>
>>> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
>>> ---
>>>   vl.c | 8 ++++----
>>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/vl.c b/vl.c
>>> index 86bdce0..d0c03fe 100644
>>> --- a/vl.c
>>> +++ b/vl.c
>>> @@ -4000,6 +4000,10 @@ int main(int argc, char **argv, char **envp)
>>>           exit(0);
>>>       }
>>>
>>> +    if (qemu_opts_foreach(qemu_find_opts("mon"), mon_init_func, NULL, 1) != 0) {
>>> +        exit(1);
>>> +    }
>>> +
>>>       if (qemu_opts_foreach(qemu_find_opts("object"),
>>>                             object_create, NULL, 0) != 0) {
>>>           exit(1);
>>> @@ -4154,10 +4158,6 @@ int main(int argc, char **argv, char **envp)
>>>
>>>       parse_numa_opts();
>>>
>>> -    if (qemu_opts_foreach(qemu_find_opts("mon"), mon_init_func, NULL, 1) != 0) {
>>> -        exit(1);
>>> -    }
>>> -
>>>       if (foreach_device_config(DEV_SERIAL, serial_parse) < 0)
>>>           exit(1);
>>>       if (foreach_device_config(DEV_PARALLEL, parallel_parse) < 0)
>>
>>
>> Errors after monitor initialization look n a monitor is on
>> stdio:
>>
>>      $ qemu -nodefaults -monitor stdio -vga xxx
>>      QEMU 2.2.50 monitor - type 'help' for more information
>>      (qemu) Unknown vga type: xxx
>>      $
>>
>> This patch initializes monitors earlier, thus makes more errors look
>> ugly.  Do we care?
>
> Yeah, this doesn't seem great. Surely the actual problem here
> is that we're doing something that takes 30 seconds to initialise
> as part of our command line option parsing phase ?
>

Yes, it is the problem of memset() in os_mem_prealloc,
if we configure VM with large size memory (prealloc is also configured),
it will consume lots of time. we can certainly do this consuming time work later,
after command line option parsing phase, but this scenario is more easy.

> -- PMM
>
> .
>

  reply	other threads:[~2015-03-06 10:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 10:59 [Qemu-devel] [PATCH] vl: Adjust the place of processing '-mon' zhanghailiang
2015-03-04 11:08 ` Paolo Bonzini
2015-03-04 17:02 ` Markus Armbruster
2015-03-06  8:58   ` zhanghailiang
2015-03-06  9:51   ` Peter Maydell
2015-03-06 10:08     ` zhanghailiang [this message]
2015-03-06 12:05     ` Markus Armbruster
2015-03-06 12:11       ` Peter Maydell

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=54F97CB5.2030204@huawei.com \
    --to=zhang.zhanghailiang@huawei.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=hangaohuai@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=xiexiangyou@huawei.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).