[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v6 2/6] xen/x86: move generically usable NUMA code from x86 to common
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Wei Chen <Wei.Chen@xxxxxxx>
- Date: Wed, 19 Oct 2022 01:58:31 +0000
- Accept-language: en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- 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=2; 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=i1w6JL9suuS75LD7hgwtYV7oE2h10TSLhKXd1ToEJSU=; b=mrYfEmDPJPVEDdRfBacv6zZm5kBLVJJ8y3AuPc+9zVxV8DwaF8X3v7UQly8BIDGh99213kfkLg0a/XxxjuEWd9FppeWZfEdmF4j9MlEEc85smfT/YxIOWR3tefgmocf/btPxAtaZtSaGLhk7WSvPl73kTRyK/LCXp5qBYeTcLDxduyEATVsB9e4COt1IStAyAi5h7OoAGCzRyu3BiNhIaZzHNvma6RpZLd5A1A7QO38WgFb7dtOd+IiTBc8uVslJ7nZuL8gTf2v53TI08gaYyqoVQk02kdPaYqfFxBVIGLs9KBiTH+8PW/hrtrzq8hCKzV1e79Uza5A03ZcIvTYdPg==
- 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=i1w6JL9suuS75LD7hgwtYV7oE2h10TSLhKXd1ToEJSU=; b=cXbILwK/oHxMr3jfz2u0zDDvoiSBhTDRULjd5Juj9bpjBJmQNUDG0EVUYcVXI6k0/QastCqTFMV5kMWA0o/vT0n4jB6RfjsJhkUnO2zRDTFHFJol1kqZYzcjZhPIy9rWl5hezZz2w06v5Bt2E0FEuLaySD6bhEHYgPnWJ1VRoP3I1wG2BV9gy1lsIV/N/GzDAWcrX86nTgYDAVPpz4TNfjYHh65c4HoK/29Uov6d9cCMkq+Sa8k/pWwS17yaC41p2oFlVq8t+2+E0EvGH+OsM1cJrLvpNrZc5W7LrJqJpufhi+e4cOJwXLi9sG4gqpqvsj7xgML+78vkX4fHQZJGbw==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=jXasIwam82MYKrekQvkIeHb13B2de5cwEud1W8FPZQUHwl/7FpjojB/kla2MZFiWtBbnS+MJc3d3RzGiDuMJwUmgGHiOCmsQhucrsoza1EGXgU05a3bgbtaPm7gh9xpLJnETBKlo2YMPfoPEFYuzW9ZqaRu9oyjhDYHCF79+A92S074ri0p6hnwEZbQ7ASWAtsceDd1cWynqud8QZV1Y4ZkBmPbymOlWMCnNWXlbtGSP6AJut1RpCur7yv8kTj4riZ06ZexE2pgGvrhJ/iphdFcTbWqrM0BP/sefiuaB2P810dVCI/m8Q6C0NmY57xE8Y7jDirZJ4ITJnM260eShrQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i5p6j9N5HKRJJO5Br83OSDI4Qi4/htLYWuvZqhHLcdo2PBzePdbDDZEAtsFihMcWZt6BUD3rkm9/2rWn9YZVI8ROaQhj2J3EafWLrAILwwYfmai3D139Ob1feNsfRczdwRZaN5Egpf7RADwIPOf1opy6PGwBzAM9ft7CHogNCAbIqoWwgEbFGBTPy7KZEJ0IDRqZtfUGAev2H8jERAuOPPyLKQjx5nopvhrgg6fCZpITdlazmaZNYwIT0agygO9dXhmSJlnZrkexyZVBjbRZ/zeIGrmXt31NCrOH2pQofxYZttKn6F5yhtW67gwYZJrvAO+OD08TklTcZrR0+K/2xA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: nd <nd@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 19 Oct 2022 01:58:52 +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: AQHY3WMXl9OYk9SO1UmCbrdWlsAFLa4UNRwAgADISRA=
- Thread-topic: [PATCH v6 2/6] xen/x86: move generically usable NUMA code from x86 to common
Hi Jan,
> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 2022年10月18日 21:46
> To: Wei Chen <Wei.Chen@xxxxxxx>
> Cc: nd <nd@xxxxxxx>; Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; Roger Pau
> Monné <roger.pau@xxxxxxxxxx>; Wei Liu <wl@xxxxxxx>; George Dunlap
> <george.dunlap@xxxxxxxxxx>; Julien Grall <julien@xxxxxxx>; Stefano
> Stabellini <sstabellini@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v6 2/6] xen/x86: move generically usable NUMA code
> from x86 to common
>
> On 11.10.2022 13:17, Wei Chen wrote:
> > v5 -> v6:
> > 1. Replace numa_scan_node to numa_process_nodes in commit log.
> > 2. Limit the scope of page_num_node, vnuma and page of numa_setup
> > function.
> > 3. Use memset to init page_num_node instead of for_each_online_node.
> > 4. Use %u instead of %d for nodeid_t and j in numa_setup print
> > messages.
>
> The only instances of nodeid_t typed variable uses that I was able to
> find are in dump_numa(). I guess you can leave them that way, but
> strictly speaking %u isn't correct to use for nodeid_t (as it promotes
> to int, not to unsigned int).
In this case, I will restore them to %d.
>
> > 5. Use min(PADDR_BITS, BITS_PER_LONG - 1) to calculate the shift
> > when only one node is in the system.
>
> This change needs mentioning / justifying in the description.
>
I will do it.
> > +static void cf_check dump_numa(unsigned char key)
> > +{
> > + s_time_t now = NOW();
> > + unsigned int i, j, n;
> > +
> > + printk("Memory location of each domain:\n");
> > + for_each_domain ( d )
> > + {
> > + const struct page_info *page;
> > + unsigned int page_num_node[MAX_NUMNODES];
> > + const struct vnuma_info *vnuma;
> > +
> > + process_pending_softirqs();
> > +
> > + printk("Domain %u (total: %u):\n", d->domain_id,
> domain_tot_pages(d));
>
> Perhaps switch to using %pd here?
>
Did you mean %d for d->domain_id here?
> > + memset(page_num_node, 0, sizeof(unsigned int) * MAX_NUMNODES);
>
> Simply (and less fragile) sizeof(page_num_node)?
Ok.
Thanks,
Wei Chen
>
> Jan
|