[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC] mem-prealloc: Reduce large guest start-up a
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH RFC] mem-prealloc: Reduce large guest start-up and migration time. |
Date: |
Fri, 27 Jan 2017 14:06:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
On 27/01/2017 13:53, Juan Quintela wrote:
>> +static void *do_touch_pages(void *arg)
>> +{
>> + PageRange *range = (PageRange *)arg;
>> + char *start_addr = range->addr;
>> + uint64_t numpages = range->numpages;
>> + uint64_t hpagesize = range->hpagesize;
>> + uint64_t i = 0;
>> +
>> + for (i = 0; i < numpages; i++) {
>> + memset(start_addr + (hpagesize * i), 0, 1);
>
> I would use the range->addr and similar here directly, but it is just a
> question of taste.
>
>> - /* MAP_POPULATE silently ignores failures */
>> - for (i = 0; i < numpages; i++) {
>> - memset(area + (hpagesize * i), 0, 1);
>> + /* touch pages simultaneously for memory >= 64G */
>> + if (memory < (1ULL << 36)) {
>
> 64GB guest already took quite a bit of time, I think I would put it
> always as min(num_vcpus, 16). So, we always execute the multiple theard
> codepath?
I too would like some kind of heuristic to choose the number of threads.
Juan's suggested usage of the VCPUs (smp_cpus) is a good one.
Paolo