[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 4/6] xen/cpupool: Create different cpupools at boot time


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 21 Mar 2022 17:19:40 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YnE7Q1HVCAfMp+GsTmO8+lyaDeda8GLWEWGTk+z4Wek=; b=aaWwCCycQg9xpkY8TFqbr4G0RWaqQdKWyROKCHWJRn9lJPXeTSqIiI3jI0kI0QSP3RPEzQtx2Fcp0DS08JPyNZtUKFOxQrsQYYJQdcSkeCsPpNsx6n2d20DOmeoZYnaahB1X5wIvKRKeFu2cTJtwmVP4OXJsOrMqTR82c9Kf26ifTp6sFNb9RxTUQIiYyvegUbDaBaz6kJ520nNADyNyKHN+bHXWTiSK8R0FprdIBU+BPTHLGAAhbj2o6FvinkJuAGpcGIY7jUtp/dVuHe7/7EHFhnOnWAdV+T2JD795bUvat/ScPOTuAQgJvgvCgDDXq8If7IOt1q+tp3DPNA63Ug==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YcTvyNsQUwz9fjHwjGXPpQojKQtUS0oNGJnvLGaoU2xSni6RtsutlFqoEz5gzDjOSoD0KSsQ1XAkj5YXp+B8JiUo5QeguTiCmLukWyAEE3WmMC2yYvEp5ckmmH4hanvQTdAKbV8644UrWRp+wuOjppLMPLT5H5qtnOFOLrQui0fpakmuM8PJDbVbAlHZ4LZgg9Fh/95Y+41otmqLDObiV8oy0W8iQ45MzFX79TuFFZsbiWvPeXzGeGJ4YmnRM73JJSRDX8mgm9RcdE4tqo8uSp8DQq8QL7t9cGvTISduIC+UVlmT/ybduKegA/INIRNNescZwD8Pmp/IXiqpt3e6Rw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Luca Fancellu <Luca.Fancellu@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>
  • Delivery-date: Mon, 21 Mar 2022 17:20:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYOtyBwlLK7ts4vEKxgpEPsRlgQ6zFUCoAgASzLwCAAAp/AIAADB+A
  • Thread-topic: [PATCH v3 4/6] xen/cpupool: Create different cpupools at boot time

Hi Julien,

> On 21 Mar 2022, at 17:36, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi,
> 
> On 21/03/2022 15:58, Luca Fancellu wrote:
>>> On 18 Mar 2022, at 16:12, Julien Grall <julien@xxxxxxx> wrote:
>>> 
>>> Hi Luca,
>>> 
>>> I only skimmed through the series. I have one question below:
>>> 
>>> On 18/03/2022 15:25, Luca Fancellu wrote:
>>>> +void __init btcpupools_allocate_pools(void)
>>>> +{
>>>> +    unsigned int i;
>>>> +    bool add_extra_cpupool = false;
>>>> +
>>>> +    /*
>>>> +     * If there are no cpupools, the value of next_pool_id is zero, so 
>>>> the code
>>>> +     * below will assign every cpu to cpupool0 as the default behavior.
>>>> +     * When there are cpupools, the code below is assigning all the not
>>>> +     * assigned cpu to a new pool (next_pool_id value is the last id + 1).
>>>> +     * In the same loop we check if there is any assigned cpu that is not
>>>> +     * online.
>>>> +     */
>>>> +    for ( i = 0; i < nr_cpu_ids; i++ )
>>>> +        if ( cpumask_test_cpu(i, &cpu_online_map) )
>>>> +        {
>>>> +            /* Unassigned cpu gets next_pool_id pool id value */
>>>> +            if ( pool_cpu_map[i] < 0 )
>>>> +            {
>>>> +                pool_cpu_map[i] = next_pool_id;
>>>> +                add_extra_cpupool = true;
>>>> +            }
>>>> +            printk(XENLOG_INFO "Logical CPU %u in Pool-%u.\n", i,
>>>> +                   pool_cpu_map[i]);
>>>> +        }
>>>> +        else
>>>> +        {
>>>> +            if ( pool_cpu_map[i] >= 0 )
>>>> +                panic("Pool-%d contains cpu%u that is not online!\n",
>>>> +                      pool_cpu_map[i], i);
>>>> +        }
>>>> +
>>>> +    if ( add_extra_cpupool )
>>>> +        next_pool_id++;
>>>> +
>>>> +    /* Create cpupools with selected schedulers */
>>>> +    for ( i = 0; i < next_pool_id; i++ )
>>>> +        cpupool_create_pool(i, pool_sched_map[i]);
>>>> +
>>>> +#ifdef CONFIG_X86
>>>> +    /* Cpu0 must be in cpupool0 for x86 */
>>>> +    if ( pool_cpu_map[0] != 0 )
>>>> +        panic("Cpu0 must be in Pool-0\n");
>>>> +#endif
>>> 
>>> Can you document why this is necessary on x86 but not on other 
>>> architectures?
>> Hi Julien,
>> I received the warning by Juergen here: 
>> https://patchwork.kernel.org/comment/24740762/ that at least on x86 there 
>> could be
>> some problems if cpu0 is not in cpupool0, I tested it on arm and it was 
>> working fine and I didn’t find any restriction.
> 
> What exactly did you test on Arm?
> 
>> So I don’t know why on x86 we must have cpu0 in cpupool0, maybe x86 
>> maintainer have more knowledge about that and
>> I can put a comment here.
> 
> On Arm, we are not yet supporting all the CPU features that x86 supports 
> (e.g. CPU hotplug, suspend/resume...). So I a am bit concerned that the 
> restriction is just not there yet (or possibly hidden).
> 
> Therefore, before lifting the restriction on Arm (and other arch), I would 
> like us to understand why it is necessary on x86.
> 
> We may not have the answer quickly, so is it going to be a problem to keep 
> the restriction on Arm?

I am ok to keep the limitation to have dom0 always running on cpu0.
Only limitation I can see is that on a big little system, dom0 needs to stay on 
the type of core of the first booted core.
But as the user could modify his firmware to boot on the type of core he wants, 
this limitation can usually be worked around.
So it is not a problem.
Maybe we could make that an unsupported feature that one could activate through 
the configuration ?

Cheers
Bertrand

> 
> Cheers,
> 
> -- 
> Julien Grall


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.