[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: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Mon, 21 Mar 2022 15:58:42 +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=J/xnS8kNoPMOayS0aIq//hLNtA7sNNktxCNdejPkBpM=; b=ntv5Bvsvxnh6rI26i8dOIK1p8S8i3bV+IXN6ZFqpGMY3V8snbnox0buufwPxvuB+8CGnOaZsOcteGP8dNOuvDaYj1xRUtBzdAwHkVKtCIQGyygJQWfuSulowg/pxgX/2mZ1QE4zDjHqnTvK4S5sPXTmdcyKggANXuABrL9X08VPrR6q7CQE3+8TG8Ii5++r3IFyb4AooknM7/rwlbN3lRuVH+xbo+a+uvthlVjDh9gPnFfab1IrONZsyK129qUtEiZmMD7RXlTiHqrNpb5EII2XsDVrmkeP/vCGWDRTH/yO3b9FKhzJ4B+hlGlh5WiJaugi72J5xTLfe1Ss0ELo0OA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MFVfCXrJ3dNdPH8U9Sxmd8QJVoPpW/HLmU95vnxPqgOlN1yP0r01Qr7hL+N1dGQpHUPdNjdRaJZ82R/yQStCNkGUFojD6gnRdu/oEkTwMv/nEZm8DQFWISP4Qkj0sA/R26NC2qBc6J4ELofaMoA5Yi9oWexctvog9AnVfKr1QgERy6Kyzk15wWTXjBcdDbxORAb72gRe6cmkiqL0+VU39P3WoQ9AsnqWiKu54/ALSU++uT2EghbIWTF2GmD0OjGxs5uSv4ZX1cLjcjo+bYGZpL2TlAnMr0jvLf2aKsMoRgqkxUNCMTK4dwDvUb+cMULi2qizxZ10EO2Wz4hMveNADA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, 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 15:59:21 +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: AQHYOtySiWfuTiIQkkqv44WbBvDftKzFUCoAgASzLoA=
  • Thread-topic: [PATCH v3 4/6] xen/cpupool: Create different cpupools at boot time


> 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.

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.

Cheers,
Luca

> 
> Cheers,
> 
> -- 
> Julien Grall


 


Rackspace

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